Jump to content
Sign in to follow this  
seres

mouse move faster

Recommended Posts

seres

hello, im trying to get the mouse move faster but i get stuck, can someone help me

here is my code

i want my scrip to be faster is i press ^+! so that the step becomes 25

#Include <Misc.au3>

$sPos = MouseGetPos()

if hotKeySet("^+!") then $Step = 25 else

$step=6

EndIf

While 1

If _IsPressed("25") And _IsPressed("26") Then

MouseMove($sPos[0]-$Step,$sPos[1]-$Step,0)

ElseIf _IsPressed("27") And _IsPressed("26") Then

MouseMove($sPos[0]+$Step,$sPos[1]-$Step,0)

ElseIf _IsPressed("25") And _IsPressed("28") Then

MouseMove($sPos[0]-$Step,$sPos[1]+$Step,0)

ElseIf _IsPressed("27") And _IsPressed("28") Then

MouseMove($sPos[0]+$Step,$sPos[1]+$Step,0)

ElseIf _IsPressed("25") Then

MouseMove($sPos[0]-$Step,$sPos[1],0)

ElseIf _IsPressed("26") Then

MouseMove($sPos[0],$sPos[1]-$Step,0)

ElseIf _IsPressed("27") Then

MouseMove($sPos[0]+$Step,$sPos[1],0)

ElseIf _IsPressed("28") Then

MouseMove($sPos[0],$sPos[1]+$Step,0)

EndIf

Sleep(1)

WEnd

Share this post


Link to post
Share on other sites
ofLight

im not sure i understand exactly what you want. :P

I also am not sure you can JUST use modifier keys when setting a Hotkey I think it hasto be like Modifier+modifier+Key or somethin like that. So in my example I set F1 instead.

#Include <Misc.au3>

HotKeySet("{F1}","_SetStep")

$sPos = MouseGetPos()
$step = 6

While 1
    If _IsPressed("25") And _IsPressed("26") Then
        MouseMove($sPos[0]-$Step,$sPos[1]-$Step,0)
    ElseIf _IsPressed("27") And _IsPressed("26") Then
        MouseMove($sPos[0]+$Step,$sPos[1]-$Step,0)
    ElseIf _IsPressed("25") And _IsPressed("28") Then
        MouseMove($sPos[0]-$Step,$sPos[1]+$Step,0)
    ElseIf _IsPressed("27") And _IsPressed("28") Then
        MouseMove($sPos[0]+$Step,$sPos[1]+$Step,0)
    ElseIf _IsPressed("25") Then
        MouseMove($sPos[0]-$Step,$sPos[1],0)
    ElseIf _IsPressed("26") Then
        MouseMove($sPos[0],$sPos[1]-$Step,0)
    ElseIf _IsPressed("27") Then
        MouseMove($sPos[0]+$Step,$sPos[1],0)
    ElseIf _IsPressed("28") Then
        MouseMove($sPos[0],$sPos[1]+$Step,0)
    EndIf
    Sleep(1)
WEnd

Func _SetStep()
    $Step = 25
EndFunc

There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Share this post


Link to post
Share on other sites
PsaltyDS

...

here is my code

...

$sPos = MouseGetPos()

if hotKeySet("^+!") then $Step = 25 else

$step=6

EndIf

You're not a big fan of the help file, are you? If HotKeySet()...??? :P

Read the help file on HotKeySet() and look at the example there.

Then and Else on the same line...??? ;)

Read the help file on If/Then/Else/EndIf and look at the example there.

(Are you detecting a pattern here?)

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
seres

You're not a big fan of the help file, are you? If HotKeySet()...??? :P

Read the help file on HotKeySet() and look at the example there.

Then and Else on the same line...??? ;)

Read the help file on If/Then/Else/EndIf and look at the example there.

(Are you detecting a pattern here?)

:)

i read it and i found hotkeyset but i thought it will work with out a function and yust with ("^+!").

i gess i didnt undestand

Share this post


Link to post
Share on other sites
seres

im not sure i understand exactly what you want. :P

I also am not sure you can JUST use modifier keys when setting a Hotkey I think it hasto be like Modifier+modifier+Key or somethin like that. So in my example I set F1 instead.

#Include <Misc.au3>

HotKeySet("{F1}","_SetStep")

$sPos = MouseGetPos()
$step = 6

While 1
    If _IsPressed("25") And _IsPressed("26") Then
        MouseMove($sPos[0]-$Step,$sPos[1]-$Step,0)
    ElseIf _IsPressed("27") And _IsPressed("26") Then
        MouseMove($sPos[0]+$Step,$sPos[1]-$Step,0)
    ElseIf _IsPressed("25") And _IsPressed("28") Then
        MouseMove($sPos[0]-$Step,$sPos[1]+$Step,0)
    ElseIf _IsPressed("27") And _IsPressed("28") Then
        MouseMove($sPos[0]+$Step,$sPos[1]+$Step,0)
    ElseIf _IsPressed("25") Then
        MouseMove($sPos[0]-$Step,$sPos[1],0)
    ElseIf _IsPressed("26") Then
        MouseMove($sPos[0],$sPos[1]-$Step,0)
    ElseIf _IsPressed("27") Then
        MouseMove($sPos[0]+$Step,$sPos[1],0)
    ElseIf _IsPressed("28") Then
        MouseMove($sPos[0],$sPos[1]+$Step,0)
    EndIf
    Sleep(1)
WEnd

Func _SetStep()
    $Step = 25
EndFunc

thanks for the help

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.