Jump to content

How do I make the script not end until I exit it?


Recommended Posts

WinActivate("Gunz Launcher")

HotKeySet("!{ESC}", "ExitGunz")
HotKeySet("{F2}", "ForwardDash")
HotKeySet("{1}", "LeftDash")
HotKeySet("{3}", "RightDash")
HotKeySet("{2}", "BackDash")

Func ExitGunz ()
Opt("SendKeyDownDelay", 10)
Send("!{F4}")
EndFunc

Func ForwardDash ()
Opt("SendKeyDownDelay", 10)
Send("{W 2}")
EndFunc

Func LeftDash ()
Opt("SendKeyDownDelay", 10)
Send("{A 2}")
EndFunc

Func RightDash ()
Opt("SendKeyDownDelay", 10)
Send("{D 2}")
EndFunc

Func BackDash ()
Opt("SendKeyDownDelay", 10)
Send("{S 2}")
EndFunc

Ok, Ive got this, everytime I run it, it Ends, but I dont want it to end unless I end it.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

Add

while 1
sleep(10)
Wend

After the HotKeys

Edit - Beaten again.

Edited by BigDod


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

...and I was ready to post a loop with Sleep(111)

Edit: BTW, HotKeys interrupt Sleeps - so it really does not matter how long of a sleep you use, but too short of a sleep can impact the CPU cycles consumed during the idling loop. [There, now maybe that post was worth something :-)]

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Thanks for the quick help ^^

Ok, another problem, when I run the script, I test it in Scite, example

I run the script

I click on the text box

I press "2" which is one of the hotkeys, but its meant to then "Send" the "S" key twice.

But it isnt, its just sending the number "2"

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

Are you using the numpad numbers or the regular numbers as they are different.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

You can also do this:

Send("WW")

@Others,

Does the help file suggest the {} are needed or best for a string?

I am pretty sure....No

however when making send commands with multiple letters, its probably safer to use the "raw" method

Send("WW", 1)

8)

NEWHeader1.png

Link to comment
Share on other sites

Ok, I tested it in a text box, works fine, it sends the right keys, everythings fine...But, when i use the hotkeys In-Game, they dont do anything, its supposed to

example DashForward is the w key twice, because w is to walk forward, on the game, if you want to dash, you press it twice...

but its not doing anything...Any ideas?

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

Have you seen behavior other than that described in the help file?

When you set a hotkey, AutoIt captures the keypress and does not pass it on to the active application...

Edit: Or am I still not understanding "output to the screen".

Exceptions: http://www.autoitscript.com/forum/index.php?showtopic=26920

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Wha? im getting confused, does this have anything to do with the question i asked about 4 posts ago?

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

Plato... you are correct

it does lock the "output"

i never used letters or numbers for hot keys ( directly) for the main reason of wanting full use of the keyboard letter/numbers for writting....

and not getting a letter/number and the hotkey/send

( i really thought i tested this before)

HotKeySet("a", "Sendit")


Run("notepad.exe")
WinWaitActive("")


While 1
    Sleep(10)
WEnd

Func Sendit()
    Send("test")
EndFunc

sorry for the mis-direction

8)

NEWHeader1.png

Link to comment
Share on other sites

Wha? im getting confused, does this have anything to do with the question i asked about 4 posts ago?

Sorry for the confusion. That is what I meant by "...and since I've hijacked yet another thread..." you can ignore all of the banter below that post (or you could learn from it - it is related). You got your answer in post #10 (meaning that your script should work fine as is - you can keep the {} around your characters if you wish) - the rest is just FYI for you and us having a discussion about HotKeySet (in your thread - sorry again).

@Valuater,

No problem, I just could not reconcile the help file with that statement and thought that I did not understand the statement. I've spent a lot of time with CapsLock and ScrollLock due to that bug report... so all of this is fresh (but confused) in my mind.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Its still not working though, the script is working fine, but not ingame, i go into the game, run the script, but nothing happens.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
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...