Sign in to follow this  
Followers 0
jpres

Coords Driving me Crazy

2 posts in this topic

HotKeySet("{F1}", "Attack")
HotKeySet("{F2}", "Sendz")
MsgBox(0,"!","Loaded! - Jpres")

While 1
    sleep(50)
WEnd

Func Attack()
    $CoordX = MouseGetPos(0)
    $CoordY = MouseGetPos(1)
EndFunc

Func Sendz()
    MouseClick("right")
    sleep(50)
    Send("{ShiftDown}",0)
    sleep(50)
    MouseClick("right")
    sleep(50)
    Send("a",1)
    sleep(50)
    if not @error Then
        sleep(50)
        MouseMove($CoordX,$CoordY)
        if not @error Then
        sleep(50)
        MouseClick("left")
        EndIf
    EndIf
                Send("{ShiftUp}",0)
EndFunc

Everytime it gets to MouseMove$CoordX,$CoordY) - I get an error - Variable used without being declared - the problem is I don't get what i'm doing wrong, since I thought the pressing of F1 would've declared it.

Share this post


Link to post
Share on other sites



Like this:

HotKeySet("{F1}", "Attack")
HotKeySet("{F2}", "Sendz")
MsgBox(0,"!","Loaded! - Jpres")

Dim $CoordX, $CoordY

While 1
    Sleep(50)
WEnd

Func Attack()
    $CoordX = MouseGetPos(0)
    $CoordY = MouseGetPos(1)
EndFunc

Func Sendz()
    MouseClick("right")
    Sleep(50)
    Send("{ShiftDown}",0)
    Sleep(50)
    MouseClick("right")
    Sleep(50)
    Send("a",1)
    Sleep(50)
    If Not @error Then
            Sleep(50)
            MouseMove($CoordX,$CoordY)
            If Not @error Then
            Sleep(50)
            MouseClick("left")
        EndIf
    EndIf
    Send("{ShiftUp}",0)
EndFunc

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  
Followers 0