Sign in to follow this  
Followers 0
hookLine

newbie needs help!

7 posts in this topic

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:

MsgBox(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")

Share this post


Link to post
Share on other sites



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")

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Maybe...

MsgBox(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 by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Maybe...

MsgBox(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. :)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

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