Jump to content

Noob learning need alittle help


 Share

Recommended Posts

i am tring to mnake a simple bot.

let me post the code then tell me why when i hit F7 it turns off the function for F5.

; Script Start - Add your code below here

HotKeySet("{F5}", "Begin")

HotKeySet("{F6}", "Pause")

HotKeySet("{F7}", "Auto")

HotKeySet("{F8}", "Terminate")

MsgBox ( 0, "Buff", "(Freezer Bot)" )

TrayTip("Buff", "F5 start, F6 stop, F7 Loot", 5,1)

Func Begin ()

While 1

Send("2")

Sleep(1000)

Send("3")

Sleep(1000)

Send("4")

Sleep(1000)

Send("1")

Sleep(30000)

WEnd

EndFunc

Func Pause ()

While 1

Sleep(1)

WEnd

EndFunc

Func Auto ()

While 1

Send("{SPACE}")

Sleep(300)

WEnd

EndFunc

Func Terminate ()

MsgBox(0, "Buff", "Thanks for using the bot.")

Exit

EndFunc

While 1

Sleep(1)

WEnd

Link to comment
Share on other sites

i am tring to mnake a simple bot.

let me post the code then tell me why when i hit F7 it turns off the function for F5.

; Script Start - Add your code below here

HotKeySet("{F5}", "Begin")

HotKeySet("{F6}", "Pause")

HotKeySet("{F7}", "Auto")

HotKeySet("{F8}", "Terminate")

MsgBox ( 0, "Buff", "(Freezer Bot)" )

TrayTip("Buff", "F5 start, F6 stop, F7 Loot", 5,1)

Func Begin ()

While 1

Send("2")

Sleep(1000)

Send("3")

Sleep(1000)

Send("4")

Sleep(1000)

Send("1")

Sleep(30000)

WEnd

EndFunc

Func Pause ()

While 1

Sleep(1)

WEnd

EndFunc

Func Auto ()

While 1

Send("{SPACE}")

Sleep(300)

WEnd

EndFunc

Func Terminate ()

MsgBox(0, "Buff", "Thanks for using the bot.")

Exit

EndFunc

While 1

Sleep(1)

WEnd

Works fine for me. I can hit F5 to start, F7 to send spaces, F6 to pause and then F5 to restart.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

when i run it i hit F5 to start2341 count it should repeat every 30secs.but when i hit F7 to start spacebar it stops the 30sec count down for the F5.i want spacbar to click every 300ms and there other to repeat every 30secs

Link to comment
Share on other sites

when i run it i hit F5 to start2341 count it should repeat every 30secs.but when i hit F7 to start spacebar it stops the 30sec count down for the F5.i want spacbar to click every 300ms and there other to repeat every 30secs

Only in a multithread application, which AutoIt is not. When you press one key, the program stops what it was doing and jumps to the other code. You can do what you want with a state machine, but not the way you have things coded. Do a search for "state machine" and you'll get hits on this as I've showed others how to do this.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...