Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_Icon=icon.ico
- #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
- #include <misc.au3>
- global $ON = false
- global $startSet = false
- global $EndSet = false
- 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")
- Func showInstr()
- if _IsPressed(65) Then
- 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")
- endif
- EndFunc
- func toggle()
- $ON = not $ON
- if $ON Then
- msgbox(0, "","Drag/Drop script ON")
- ToolTip("SCRIPT ON", 15, 15)
- Else
- msgbox(0, "","Drag/Drop script OFF")
- ToolTip("SCRIPT OFF", 15, 15)
- endif
- endfunc
- HotKeySet("0", "toggle")
- func SetStart()
- if _IsPressed(61) Then
- local $mouseposorgin = MouseGetpos()
- global $mouseorginX = $mouseposorgin[0]
- global $mouseorginY = $mouseposorgin[1]
- $startSet = true
- msgbox(0, "Set", "Set coord: " & $mouseorginX & " x " & $mouseorginY)
- EndIf
- endfunc
- func SetEnd()
- if _IsPressed(62) Then
- local $mouseposend = MouseGetpos()
- global $mouseendX = $mouseposend[0]
- global $mouseendY = $mouseposend[1]
- $EndSet = true
- msgbox(0, "Set", "Set coord: " & $mouseendX & " x " & $mouseendY)
- endif
- endfunc
- func closescr()
- if _IsPressed(63) then
- msgbox(0,"","Drag/Drop Script Exiting...")
- Exit
- endif
- endfunc
- runScr()
- func runScr()
- while true
- sleep(10)
- closescr()
- showInstr()
- If $ON Then
- SetStart()
- setEnd()
- if $startSet = true and $EndSet = True Then
- MouseClickDrag("LEFT", $mouseorginX, $mouseorginY, $mouseendX, $mouseendY)
- $startSet = False
- $EndSet = false
- endif
- Else
- tooltip("SCRIPT OFF", 15, 15)
- endif
- wend
- endfunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement