ไม่ใช่เลขบัตรจริงนะครับ สุ่มตามหลักการตรวจเลขบัตร ดัดแปลงเอามาจาก [You must be registered and logged in to see this link.] ห้ามเอาไปทำผิดกฏหมายนะ
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("โปรจำลองสุ่มเลขบัตร", 253, 109, 192, 124)
$Button1 = GUICtrlCreateButton("สุ่มเลขใหม่", 40, 72, 75, 25)
$Button2 = GUICtrlCreateButton("ก๊อป", 152, 72, 75, 25)
$Input1 = GUICtrlCreateInput("", 16, 24, 217, 21)
GUISetState(@SW_SHOW)
GUICtrlSetData($Input1,RandomNum())
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUICtrlSetData($Input1,RandomNum())
Case $Button2
ClipPut(GUICtrlRead($Input1))
MsgBox(64,"ก็อปเสร็จ","ก็อปเลข "&GUICtrlRead($Input1)&" ลงคลิปบอร์ด")
EndSwitch
WEnd
Func RandomNum()
$n1 = Random(0,9,1)
$n2 = Random(0,9,1)
$n3 = Random(0,9,1)
$n4 = Random(0,9,1)
$n5 = Random(0,9,1)
$n6 = Random(0,9,1)
$n7 = Random(0,9,1)
$n8 = Random(0,9,1)
$n9 = Random(0,9,1)
$n10 = Random(0,9,1)
$n11 = Random(0,9,1)
$n12 = Random(0,9,1)
$sumdigit = ($n1 * 13)+($n2 * 12)+($n3 * 11)+($n4 * 10)+($n5 * 9)+($n6 * 8)+($n7 * 7)+($n8 * 6)+($n9 * 5)+($n10 * 4)+($n11 * 3)+($n12 * 2)
$snum = 11 - mod($sumdigit,11)
if $snum =10 Then
$digit1 = $n1&$n2&$n3&$n4&$n5&$n6&$n7&$n8&$n9&$n10&$n11&$n12&"0"
ElseIf $snum =11 Then
$digit1 = $n1&$n2&$n3&$n4&$n5&$n6&$n7&$n8&$n9&$n10&$n11&$n12&"1"
Else
$digit1 = $n1&$n2&$n3&$n4&$n5&$n6&$n7&$n8&$n9&$n10&$n11&$n12&$snum
EndIf
Return $digit1
EndFunc
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("โปรจำลองสุ่มเลขบัตร", 253, 109, 192, 124)
$Button1 = GUICtrlCreateButton("สุ่มเลขใหม่", 40, 72, 75, 25)
$Button2 = GUICtrlCreateButton("ก๊อป", 152, 72, 75, 25)
$Input1 = GUICtrlCreateInput("", 16, 24, 217, 21)
GUISetState(@SW_SHOW)
GUICtrlSetData($Input1,RandomNum())
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUICtrlSetData($Input1,RandomNum())
Case $Button2
ClipPut(GUICtrlRead($Input1))
MsgBox(64,"ก็อปเสร็จ","ก็อปเลข "&GUICtrlRead($Input1)&" ลงคลิปบอร์ด")
EndSwitch
WEnd
Func RandomNum()
$n1 = Random(0,9,1)
$n2 = Random(0,9,1)
$n3 = Random(0,9,1)
$n4 = Random(0,9,1)
$n5 = Random(0,9,1)
$n6 = Random(0,9,1)
$n7 = Random(0,9,1)
$n8 = Random(0,9,1)
$n9 = Random(0,9,1)
$n10 = Random(0,9,1)
$n11 = Random(0,9,1)
$n12 = Random(0,9,1)
$sumdigit = ($n1 * 13)+($n2 * 12)+($n3 * 11)+($n4 * 10)+($n5 * 9)+($n6 * 8)+($n7 * 7)+($n8 * 6)+($n9 * 5)+($n10 * 4)+($n11 * 3)+($n12 * 2)
$snum = 11 - mod($sumdigit,11)
if $snum =10 Then
$digit1 = $n1&$n2&$n3&$n4&$n5&$n6&$n7&$n8&$n9&$n10&$n11&$n12&"0"
ElseIf $snum =11 Then
$digit1 = $n1&$n2&$n3&$n4&$n5&$n6&$n7&$n8&$n9&$n10&$n11&$n12&"1"
Else
$digit1 = $n1&$n2&$n3&$n4&$n5&$n6&$n7&$n8&$n9&$n10&$n11&$n12&$snum
EndIf
Return $digit1
EndFunc