Jump to content
Sign in to follow this  
DNnlee

Moving Mouse with up down left right

Recommended Posts

DNnlee

Hi, I've broke my mouse, and won't be getting another one within a week....

wrote this script so i can move my mouse with "UP DOWN LEFT RIGHT arrow keys"

need help to disable it when i need to pause

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
hotkeyset("{up}", "Moveup")
hotkeyset("{down}", "Movedown")
hotkeyset("{left}", "Moveleft")
hotkeyset("{right}", "Moveright")
hotkeyset("{F9}", "Click")




$pos = MouseGetPos()
while 1
    sleep(20)
    $pos = MouseGetPos()
    WEnd

Func Click()
    mouseclick("left", $pos[0], $pos[1])
EndFunc

Func Moveup()
    MouseMove( $pos[0] , $pos[1] - 5, 3 )
EndFunc

Func Movedown()
    MouseMove( $pos[0], $pos[1] + 5 , 3 )
EndFunc

Func Moveleft()
    MouseMove( $pos[0] - 5, $pos[1], 3 )
EndFunc

Func Moveright()
    MouseMove( $pos[0] + 5, $pos[1], 3 )
EndFunc

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    tooltip("")
    WinWaitActive("d2jsp - Ladder Slasher")
    WinMove ( "d2jsp - Ladder Slasher", "", 0, 0 , 225, 337, 25)
    
EndFunc

Func Terminate()
    Exit 0
EndFunc

When i want to Pause it, it still controls my mouse... any way to make it better?

Share this post


Link to post
Share on other sites
monoceres

You also need to unset the HotKeys while it's in the loop, like this for example: hotkeyset("{up}")


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
zackrspv

Hi, I've broke my mouse, and won't be getting another one within a week....

wrote this script so i can move my mouse with "UP DOWN LEFT RIGHT arrow keys"

need help to disable it when i need to pause

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
hotkeyset("{up}", "Moveup")
hotkeyset("{down}", "Movedown")
hotkeyset("{left}", "Moveleft")
hotkeyset("{right}", "Moveright")
hotkeyset("{F9}", "Click")




$pos = MouseGetPos()
while 1
    sleep(20)
    $pos = MouseGetPos()
    WEnd

Func Click()
    mouseclick("left", $pos[0], $pos[1])
EndFunc

Func Moveup()
    MouseMove( $pos[0] , $pos[1] - 5, 3 )
EndFunc

Func Movedown()
    MouseMove( $pos[0], $pos[1] + 5 , 3 )
EndFunc

Func Moveleft()
    MouseMove( $pos[0] - 5, $pos[1], 3 )
EndFunc

Func Moveright()
    MouseMove( $pos[0] + 5, $pos[1], 3 )
EndFunc

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    tooltip("")
    WinWaitActive("d2jsp - Ladder Slasher")
    WinMove ( "d2jsp - Ladder Slasher", "", 0, 0 , 225, 337, 25)
    
EndFunc

Func Terminate()
    Exit 0
EndFunc

When i want to Pause it, it still controls my mouse... any way to make it better?

Clearing the hotkeys, likt this, should do what you want:

Seemd to work on my system at least:

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
setkeys()


$called = 0
$pos = MouseGetPos()
While 1
    Sleep(20)
    $pos = MouseGetPos()
WEnd

Func Click()
    MouseClick("left", $pos[0], $pos[1])
EndFunc  ;==>Click

Func Moveup()
    MouseMove($pos[0], $pos[1] - 5, 3)
EndFunc  ;==>Moveup

Func Movedown()
    MouseMove($pos[0], $pos[1] + 5, 3)
EndFunc  ;==>Movedown

Func Moveleft()
    MouseMove($pos[0] - 5, $pos[1], 3)
EndFunc  ;==>Moveleft

Func Moveright()
    MouseMove($pos[0] + 5, $pos[1], 3)
EndFunc  ;==>Moveright

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        If $called = 0 Then ClearKeys()
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    If $called = 1 Then setkeys()
    ToolTip("")
    WinWaitActive("d2jsp - Ladder Slasher")
    WinMove("d2jsp - Ladder Slasher", "", 0, 0, 225, 337, 25)
EndFunc  ;==>TogglePause

Func Terminate()
    Exit 0
EndFunc  ;==>Terminate

Func ClearKeys()
    $called = 1
    HotKeySet("{up}")
    HotKeySet("{down}")
    HotKeySet("{left}")
    HotKeySet("{right}")
    HotKeySet("{F9}")
EndFunc  ;==>ClearKeys
Func setkeys()
    $called = 0
    HotKeySet("{up}", "Moveup")
    HotKeySet("{down}", "Movedown")
    HotKeySet("{left}", "Moveleft")
    HotKeySet("{right}", "Moveright")
    HotKeySet("{F9}", "Click")
EndFunc  ;==>setkeys

-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites
DNnlee

You also need to unset the HotKeys while it's in the loop, like this for example: hotkeyset("{up}")

thanks, i got that part now. :)

any other advice on how to make it better is appreciated tho :(

Share this post


Link to post
Share on other sites
zackrspv

thanks, i got that part now. :)

any other advice on how to make it better is appreciated tho :(

You should add the Shift UP, Shift Down, Shift Left and Shift Right (or control or alt, as example) to allow it to move by 10's, thus making your time holding down those buttons less.

-OR-

Better yet, make the up/down/left/right commands move the cursor by 10, until you get to the general area you want and use the shift/up/down/left/right to narrow down the exact location you need.

-or-

Buy a mouse. :D


-_-------__--_-_-____---_-_--_-__-__-_ ^^€ñ†®øÞÿ ë×阮§ wï†høµ† ƒë@®, wï†høµ† †ïmë, @ñd wï†høµ† @ †ïmïdï†ÿ ƒø® !ïƒë. €×阮 ñø†, bµ† ïñ§†ë@d wï†hïñ, ñ@ÿ, †h®øµghøµ† †hë 맧ëñ§ë øƒ !ïƒë.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.