jpres Posted June 2, 2009 Share Posted June 2, 2009 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. Link to comment Share on other sites More sharing options...
James Posted June 2, 2009 Share Posted June 2, 2009 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 Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now