hookLine Posted November 23, 2008 Share Posted November 23, 2008 Hi, I'm Alex. I'm pretty new to AutoIt, and I'm trying to create a script for a game that I play. It's called Diablo II (not like it really matters, because i just need some help with the coding). For some reason, when I hit the Hotkey that it is set to, nothing happens. Here is the script: expandcollapse popupMsgBox(0, "BoneWaller v0.1", "To start the Bonewall sequence, press - on your keyboard" & @CRLF & "Be sure that Teleport is set to F1!" & @CRLF & "Be sure that Bonewall is set to F2!") Func bw() Send("{F1}" MouseMove(252, 175, 10) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseMove(501, 351, 10) MouseClick("right") Send("{F2}" MouseClick("right") Sleep(200) Send("{ENTER}") Sleep(150) Send("Bonewall Number 1!") Sleep(150) Send("{ENTER}") Sleep(24000) MouseClick("right") Sleep(200) Send("{ENTER}") Sleep(150) Send("Bonewall Number 2!") Sleep(150) Send("{ENTER}") Sleep(24000) MouseClick("right") Sleep(200) Send("{ENTER}") Sleep(150) Send("Bonewall Number 3!") Sleep(150) Send("{ENTER}") Sleep(24000) MouseClick("right") Sleep(200) Send("{ENTER}") Sleep(150) Send("Bonewall Number 4! Last Bonewall until river break.") Sleep(150) Send("{ENTER}") Sleep(2000) MouseMove(816, 479, 10) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(50000) EndFunc HotKeySet("-", "bw") Link to comment Share on other sites More sharing options...
dbzfanatic Posted November 23, 2008 Share Posted November 23, 2008 You have to set the hotkey at the top of the script, and I'd suggest using a different key. You also (I think) need to use HotKeySet("{-}","bw") Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
Valuater Posted November 23, 2008 Share Posted November 23, 2008 (edited) Maybe... expandcollapse popupMsgBox(0, "BoneWaller v0.1", "To start the Bonewall sequence, press - on your keyboard" & @CRLF & "Be sure that Teleport is set to F1!" & @CRLF & "Be sure that Bonewall is set to F2!") HotKeySet("{-}","bw") While 1 Sleep(20) ; idle around WEnd ;----------------------- Functions ------------------ Func bw() Send("{F1}") MouseMove(252, 175, 10) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseMove(501, 351, 10) MouseClick("right") Send("{F2}") MouseClick("right") Sleep(200) Send("{ENTER}") Sleep(150) Send("Bonewall Number 1!") Sleep(150) Send("{ENTER}") Sleep(24000) MouseClick("right") Sleep(200) Send("{ENTER}") Sleep(150) Send("Bonewall Number 2!") Sleep(150) Send("{ENTER}") Sleep(24000) MouseClick("right") Sleep(200) Send("{ENTER}") Sleep(150) Send("Bonewall Number 3!") Sleep(150) Send("{ENTER}") Sleep(24000) MouseClick("right") Sleep(200) Send("{ENTER}") Sleep(150) Send("Bonewall Number 4! Last Bonewall until river break.") Sleep(150) Send("{ENTER}") Sleep(2000) MouseMove(816, 479, 10) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(50000) EndFunc ;==>bw Welcome to the forums. If you search for this game there are many scripts already made 8) Edited November 23, 2008 by Valuater Link to comment Share on other sites More sharing options...
gauss5546 Posted November 23, 2008 Share Posted November 23, 2008 Just a note on that particular hot key you will have to use the "-" that is by the backspace button, not the one that is in the numpad. If you want to use the "-" that is in the numpad then you will have to use "{NUMPADSUB}" for your hotkey. For further reference with hot keys just look in the help file under the send() command. Link to comment Share on other sites More sharing options...
hookLine Posted November 23, 2008 Author Share Posted November 23, 2008 Maybe... expandcollapse popupMsgBox(0, "BoneWaller v0.1", "To start the Bonewall sequence, press - on your keyboard" & @CRLF & "Be sure that Teleport is set to F1!" & @CRLF & "Be sure that Bonewall is set to F2!") HotKeySet("{-}","bw") While 1 Sleep(20) ; idle around WEnd ;----------------------- Functions ------------------ Func bw() Send("{F1}") MouseMove(252, 175, 10) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseMove(501, 351, 10) MouseClick("right") Send("{F2}") MouseClick("right") Sleep(200) Send("{ENTER}") Sleep(150) Send("Bonewall Number 1!") Sleep(150) Send("{ENTER}") Sleep(24000) MouseClick("right") Sleep(200) Send("{ENTER}") Sleep(150) Send("Bonewall Number 2!") Sleep(150) Send("{ENTER}") Sleep(24000) MouseClick("right") Sleep(200) Send("{ENTER}") Sleep(150) Send("Bonewall Number 3!") Sleep(150) Send("{ENTER}") Sleep(24000) MouseClick("right") Sleep(200) Send("{ENTER}") Sleep(150) Send("Bonewall Number 4! Last Bonewall until river break.") Sleep(150) Send("{ENTER}") Sleep(2000) MouseMove(816, 479, 10) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(500) MouseClick("right") Sleep(50000) EndFunc ;==>bw Welcome to the forums. If you search for this game there are many scripts already made 8) Thank you, this worked very well. Link to comment Share on other sites More sharing options...
Richard Robertson Posted November 23, 2008 Share Posted November 23, 2008 HotKeySet doesn't have to be at the top of the script. It just has to be located before it's required. If the loop (which wasn't there) was after the hotkey, it'd be fine. Link to comment Share on other sites More sharing options...
hookLine Posted November 23, 2008 Author Share Posted November 23, 2008 HotKeySet doesn't have to be at the top of the script. It just has to be located before it's required. If the loop (which wasn't there) was after the hotkey, it'd be fine.Ah I see, thanks for the help. 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