Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region
- #AutoIt3Wrapper_Icon=heart.ico
- #AutoIt3Wrapper_Compression=3
- #AutoIt3Wrapper_UseUpx=y
- #EndRegion
- #NoTrayIcon
- #include <ButtonConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #include <GuiButton.au3>
- #Region ;GUI
- $GUI = GUICreate("L.O.V.E", 440, 280, -1, -1)
- GUISetBkColor(0xFFFFFF)
- $pic = GUICtrlCreatePic(@ScriptDir&"\LoveHeart.jpg", 0, 0, 438, 278)
- ;~ $Label = GUICtrlCreateLabel("Em có yêu anh không?", 104, 24, 203, 27)
- GUICtrlSetFont(-1, 15, 400, 0, "Arial")
- $Yes = GUICtrlCreateButton("Có", 112, 152, 75, 25)
- GUICtrlSetBkColor($Yes, 0xFF0066)
- GUICtrlSetColor(-1, 0xFFFFFF)
- $No = GUICtrlCreateButton("Không", 232, 152, 75, 25)
- GUICtrlSetBkColor($No, 0xFF0066)
- GUICtrlSetState($pic, $gui_disable)
- GUISetState(@SW_SHOW)
- #EndRegion
- HotKeySet("{Tab}", "AntiKey")
- HotKeySet("{Up}", "AntiKey")
- HotKeySet("{Down}", "AntiKey")
- HotKeySet("{Left}", "AntiKey")
- HotKeySet("{Right}", "AntiKey")
- While 1
- $pos = GUIGetCursorInfo($GUI)
- $posctrl = ControlGetPos($GUI, "", $No)
- If $pos[0] = $posctrl[0] or $pos[1] = $posctrl[1] Then
- _Move()
- ElseIf $pos[0] = $posctrl[0]-5 or $pos[1] = $posctrl[1]-5 Then
- _Move()
- ElseIf $pos[0] = $posctrl[0]+5 or $pos[1] = $posctrl[1]+5 Then
- _Move()
- ElseIf $pos[0] = $posctrl[0]+10 or $pos[1] = $posctrl[1]+10 Then
- _Move()
- ElseIf $pos[0] = $posctrl[0]+20 or $pos[1] = $posctrl[1]+15 Then
- _Move()
- ElseIf $pos[0] = $posctrl[0]+30 or $pos[1] = $posctrl[1]+20 Then
- _Move()
- ElseIf $pos[0] = $posctrl[0]+40 or $pos[1] = $posctrl[1]+25 Then
- _Move()
- ElseIf $pos[0] = $posctrl[0]+50 or $pos[1] = $posctrl[1]+30 Then
- _Move()
- ElseIf $pos[0] = $posctrl[0]+60 or $pos[1] = $posctrl[1]-35 Then
- _Move()
- ElseIf $pos[0] = $posctrl[0]+70 or $pos[1] = $posctrl[1]+40 Then
- _Move()
- ElseIf $pos[0] = $posctrl[0]+80 or $pos[1] = $posctrl[1]+45 Then
- _Move()
- EndIf
- ;~ If _GUICtrlButton_GetFocus($No) = "True" Then
- ;~ MsgBox(0, "Phát hiện gian lận", "Không được dùng bàn phím nhé cưng")
- ;~ GUICtrlSetState($Yes, $GUI_FOCUS)
- ;~ EndIf
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $Yes
- GUISetState(@SW_HIDE, $GUI)
- MsgBox(0, "Ahihi", "Anh biết mà :3")
- GUISetState(@SW_SHOW, $GUI)
- Case $No
- $i = MsgBox(4, "It me!!!", "Em có muốn thử lại không?" &@CRLF& "Còn không thì... cút ngay cho anh!")
- If $i = 6 Then
- ContinueLoop
- Else
- Exit
- EndIf
- EndSwitch
- WEnd
- Func _Move()
- $yespos = ControlGetPos($GUI, "", $Yes)
- $nopos = ControlGetPos($GUI, "", $No)
- $index = Random(1, 3, 1)
- If $index = 1 Then
- GUICtrlSetPos($No, Random(0, 400, 1), Random(0, 240, 1))
- ElseIf $index = 2 Then
- GUICtrlSetPos($Yes, $nopos[0], $nopos[1])
- GUICtrlSetPos($No, $yespos[0], $nopos[1])
- ElseIf $index = 3 Then
- GUICtrlSetState($No, $gui_hide)
- GUICtrlSetPos($No, Random(0, 400, 1), Random(0, 240, 1))
- Sleep(500)
- GUICtrlSetState($No, $gui_show)
- ElseIf $index = 4 Then
- GUICtrlSetPos($No, 0, 0)
- Sleep(100)
- GUICtrlSetPos($No, 365, 0)
- Sleep(100)
- GUICtrlSetPos($No, 0, 255)
- Sleep(100)
- GUICtrlSetPos($No, 365, 255)
- EndIf
- EndFunc
- Func AntiKey()
- GUISetState(@SW_HIDE, $GUI)
- MsgBox(0, "Phát hiện gian lận", "Không được dùng bàn phím nhé cưng")
- GUICtrlSetState($Yes, $GUI_FOCUS)
- GUISetState(@SW_SHOW, $GUI)
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement