Advertisement
wuuyi123

L.O.V.E - edited

Apr 9th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 3.35 KB | None | 0 0
  1. #Region
  2. #AutoIt3Wrapper_Icon=heart.ico
  3. #AutoIt3Wrapper_Compression=3
  4. #AutoIt3Wrapper_UseUpx=y
  5. #EndRegion
  6. #NoTrayIcon
  7. #include <ButtonConstants.au3>
  8. #include <GUIConstantsEx.au3>
  9. #include <StaticConstants.au3>
  10. #include <WindowsConstants.au3>
  11. #include <GuiButton.au3>
  12.  
  13. #Region ;GUI
  14. $GUI = GUICreate("L.O.V.E", 440, 280, -1, -1)
  15. GUISetBkColor(0xFFFFFF)
  16. $pic = GUICtrlCreatePic(@ScriptDir&"\LoveHeart.jpg", 0, 0, 438, 278)
  17. ;~ $Label = GUICtrlCreateLabel("Em có yêu anh không?", 104, 24, 203, 27)
  18. GUICtrlSetFont(-1, 15, 400, 0, "Arial")
  19. $Yes = GUICtrlCreateButton("Có", 112, 152, 75, 25)
  20. GUICtrlSetBkColor($Yes, 0xFF0066)
  21. GUICtrlSetColor(-1, 0xFFFFFF)
  22. $No = GUICtrlCreateButton("Không", 232, 152, 75, 25)
  23. GUICtrlSetBkColor($No, 0xFF0066)
  24. GUICtrlSetState($pic, $gui_disable)
  25. GUISetState(@SW_SHOW)
  26. #EndRegion
  27. HotKeySet("{Tab}", "AntiKey")
  28. HotKeySet("{Up}", "AntiKey")
  29. HotKeySet("{Down}", "AntiKey")
  30. HotKeySet("{Left}", "AntiKey")
  31. HotKeySet("{Right}", "AntiKey")
  32. While 1
  33.     $pos = GUIGetCursorInfo($GUI)
  34.     $posctrl = ControlGetPos($GUI, "", $No)
  35.     If $pos[0] = $posctrl[0] or  $pos[1] = $posctrl[1] Then
  36.         _Move()
  37.     ElseIf $pos[0] = $posctrl[0]-5 or  $pos[1] = $posctrl[1]-5 Then
  38.         _Move()
  39.     ElseIf $pos[0] = $posctrl[0]+5 or  $pos[1] = $posctrl[1]+5 Then
  40.         _Move()
  41.     ElseIf $pos[0] = $posctrl[0]+10 or  $pos[1] = $posctrl[1]+10 Then
  42.         _Move()
  43.     ElseIf $pos[0] = $posctrl[0]+20 or  $pos[1] = $posctrl[1]+15 Then
  44.         _Move()
  45.     ElseIf $pos[0] = $posctrl[0]+30 or  $pos[1] = $posctrl[1]+20 Then
  46.         _Move()
  47.     ElseIf $pos[0] = $posctrl[0]+40 or  $pos[1] = $posctrl[1]+25 Then
  48.         _Move()
  49.     ElseIf $pos[0] = $posctrl[0]+50 or  $pos[1] = $posctrl[1]+30 Then
  50.         _Move()
  51.     ElseIf $pos[0] = $posctrl[0]+60 or  $pos[1] = $posctrl[1]-35 Then
  52.         _Move()
  53.     ElseIf $pos[0] = $posctrl[0]+70 or  $pos[1] = $posctrl[1]+40 Then
  54.         _Move()
  55.     ElseIf $pos[0] = $posctrl[0]+80 or  $pos[1] = $posctrl[1]+45 Then
  56.         _Move()
  57.     EndIf
  58.  
  59. ;~  If _GUICtrlButton_GetFocus($No) = "True" Then
  60. ;~      MsgBox(0, "Phát hiện gian lận", "Không được dùng bàn phím nhé cưng")
  61. ;~      GUICtrlSetState($Yes, $GUI_FOCUS)
  62. ;~  EndIf
  63.     $nMsg = GUIGetMsg()
  64.     Switch $nMsg
  65.         Case $GUI_EVENT_CLOSE
  66.             Exit
  67.         Case $Yes
  68.             GUISetState(@SW_HIDE, $GUI)
  69.             MsgBox(0, "Ahihi", "Anh biết mà :3")
  70.             GUISetState(@SW_SHOW, $GUI)
  71.         Case $No
  72.             $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!")
  73.             If $i = 6 Then
  74.                 ContinueLoop
  75.             Else
  76.                 Exit
  77.             EndIf
  78.     EndSwitch
  79. WEnd
  80.  
  81. Func _Move()
  82.     $yespos = ControlGetPos($GUI, "", $Yes)
  83.     $nopos = ControlGetPos($GUI, "", $No)
  84.     $index = Random(1, 3, 1)
  85.     If $index = 1 Then
  86.         GUICtrlSetPos($No, Random(0, 400, 1), Random(0, 240, 1))
  87.     ElseIf $index = 2 Then
  88.         GUICtrlSetPos($Yes, $nopos[0], $nopos[1])
  89.         GUICtrlSetPos($No, $yespos[0], $nopos[1])
  90.     ElseIf $index = 3 Then
  91.         GUICtrlSetState($No, $gui_hide)
  92.         GUICtrlSetPos($No, Random(0, 400, 1), Random(0, 240, 1))
  93.         Sleep(500)
  94.         GUICtrlSetState($No, $gui_show)
  95.     ElseIf $index = 4 Then
  96.         GUICtrlSetPos($No, 0, 0)
  97.         Sleep(100)
  98.         GUICtrlSetPos($No, 365, 0)
  99.         Sleep(100)
  100.         GUICtrlSetPos($No, 0, 255)
  101.         Sleep(100)
  102.         GUICtrlSetPos($No, 365, 255)
  103.     EndIf
  104. EndFunc
  105. Func AntiKey()
  106.     GUISetState(@SW_HIDE, $GUI)
  107.     MsgBox(0, "Phát hiện gian lận", "Không được dùng bàn phím nhé cưng")
  108.     GUICtrlSetState($Yes, $GUI_FOCUS)
  109.     GUISetState(@SW_SHOW, $GUI)
  110. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement