Advertisement
TheVideoVolcano

Simple DragDrop Script

Feb 1st, 2014
575
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.99 KB | None | 0 0
  1. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_Icon=icon.ico
  3. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  4.  
  5. #include <misc.au3>
  6.  
  7. global $ON = false
  8.  
  9.  global $startSet = false
  10.  global $EndSet = false
  11.  
  12. msgbox(0, "","Drag/Drop Script by Ric is IDLE" & @LF & @LF & "Toggle ON/OFF Script Key = 0" & @LF & "Close Script = Num 3" & @LF & "Set Mouse Orgin Pos = num 1" & @LF & "Set Mouse End Pos = num 2" & @LF & "Show This MsgBox = num 5")
  13.  
  14. Func showInstr()
  15.     if _IsPressed(65) Then
  16.     msgbox(0, "","Drag/Drop Script by Ric is IDLE" & @LF & @LF & "Toggle ON/OFF Script Key = 0" & @LF & "Close Script = Num 3" & @LF & "Set Mouse Orgin Pos = num 1" & @LF & "Set Mouse End Pos = num 2" & @LF & "Show This MsgBox = num 5")
  17. endif
  18. EndFunc
  19.  
  20. func toggle()
  21.  
  22.     $ON = not $ON
  23. if $ON Then
  24. msgbox(0, "","Drag/Drop script ON")
  25. ToolTip("SCRIPT ON", 15, 15)
  26. Else
  27.     msgbox(0, "","Drag/Drop script OFF")
  28.     ToolTip("SCRIPT OFF", 15, 15)
  29.     endif
  30.     endfunc
  31.  
  32. HotKeySet("0", "toggle")
  33.  
  34.  
  35. func SetStart()
  36.  
  37.     if _IsPressed(61) Then
  38.  
  39.         local $mouseposorgin = MouseGetpos()
  40.  
  41.         global $mouseorginX = $mouseposorgin[0]
  42.         global $mouseorginY = $mouseposorgin[1]
  43. $startSet = true
  44. msgbox(0, "Set", "Set coord: " & $mouseorginX & " x " & $mouseorginY)
  45.     EndIf
  46. endfunc
  47.  
  48. func SetEnd()
  49. if _IsPressed(62) Then
  50.  
  51.     local $mouseposend = MouseGetpos()
  52.  
  53.     global $mouseendX = $mouseposend[0]
  54.     global $mouseendY = $mouseposend[1]
  55.     $EndSet = true
  56. msgbox(0, "Set", "Set coord: " & $mouseendX & " x " & $mouseendY)
  57. endif
  58. endfunc
  59.  
  60. func closescr()
  61. if _IsPressed(63) then
  62. msgbox(0,"","Drag/Drop Script Exiting...")
  63.     Exit
  64. endif
  65. endfunc
  66.  
  67. runScr()
  68.  
  69. func runScr()
  70. while true
  71. sleep(10)
  72. closescr()
  73. showInstr()
  74. If $ON Then
  75.     SetStart()
  76.     setEnd()
  77.  
  78.     if $startSet = true and $EndSet = True Then
  79.  
  80.     MouseClickDrag("LEFT", $mouseorginX, $mouseorginY, $mouseendX, $mouseendY)
  81.  
  82.      $startSet = False
  83.      $EndSet = false
  84.  
  85. endif
  86.  Else
  87.      tooltip("SCRIPT OFF", 15, 15)
  88. endif
  89. wend
  90.  
  91. endfunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement