Jump to content
Sign in to follow this  
DanHibiki

Troubles with select loop

Recommended Posts

DanHibiki

Hi, I got this little snippet of code from a friend, and he's having trouble trying to loop it properly. Without further adieu, here it is.

#include <Array.au3>
While 1
    $data = WinGetText("eaa")
    $split = StringSplit($data,"Clone Action: ",1)
;~  _ArrayDisplay($split, "$avArray as a 2D array")
    $splited = StringLeft($split[$split[0]],8)
    Select
        Case $splited = "dodges l"
            ToolTip("LEFT",0,0)
        Case $splited = "dodges r"
            ToolTip("RIGHTT",0,0)
        Case $splited = "no movem"
            ToolTip("NO MOVEMENT",0,0)
        Case Else 
            ToolTip("I DONT SEE ANYTHING",0,0)
    EndSelect
    Sleep(100)
WEnd

Now, this functions fine and well, tells you which direction it is going, but when a Send proc is added to it, it gets jumbled. It will continously send the same key, even if the direction changes. (It goes from right to say, left, it will still send right, causing the training to stop in game)

I've tried adding a sleep before the select fork. Is thre something I'm missing with this? Anyone to point me in the right direction would be great, thanks!

Edited by DanHibiki

Share this post


Link to post
Share on other sites
DanHibiki

Tried that, it ended the script entirely. This is a continuous thing, so for it to end after one detect would be somewhat fruitless (Unless I had another script restarting that script, but that seems a little hectic and not the right way) Should I use a certain level of exitloop?

Share this post


Link to post
Share on other sites
CrewXp

Need the Full Script Buddy' if you want help.

But from the sound of it, you're using HotKeys and aren't uninitializing its declaration of the hook? Idk, just post the script and we can help.

Share this post


Link to post
Share on other sites
DanHibiki

Thats the thing, this isn't exactly my script. This was given to me by a friend. I told him I would try to dabble and see if I could make it work, but I'm not exactly familiar with the language.

There are no hotkeys, but I looked at some examples on here of various things and noticed them.

This is the entire script. Is a hotkey to read the only thing I'm missing?

Share this post


Link to post
Share on other sites
James

Thats the thing, this isn't exactly my script. This was given to me by a friend. I told him I would try to dabble and see if I could make it work, but I'm not exactly familiar with the language.

Well that was just plain stupid. Surely the person who wrote the script in the first place knows more and could understand the help we give?

Share this post


Link to post
Share on other sites
CrewXp

It will continously send the same key, even if the direction changes.

2 Questions.

1.) How does the script 'continously' send the same key if there's no Send() Function even in it?

2.) And most important of all..how are you supposed to 'dabble' with it and get it to work if you don't even have the full script?

Share this post


Link to post
Share on other sites
DanHibiki

Excuse me, I didn't include the send functions that I added. I removed them because they kept continously sending the key after a change of input should have occured. Here is what it is, in full, at current time.

#include <Array.au3>
While 1
    $data = WinGetText("eaa")
    $split = StringSplit($data,"Clone Action: ",1)
;~  _ArrayDisplay($split, "$avArray as a 2D array")
    $splited = StringLeft($split[$split[0]],8)
    sleep(50)
    Select
        Case $splited = "dodges l"
            ToolTip("LEFT",0,0)
            send("u")
        Case $splited = "dodges r"
            ToolTip("RIGHTT",0,0)
            send("o")
        Case $splited = "no movem"
            ToolTip("NO MOVEMENT",0,0)
            Send("i")
        Case Else 
            ToolTip("I DONT SEE ANYTHING",0,0)
    EndSelect
    Sleep(100)
WEnd

I only said it was a snippet because of its size. I don't know wether its the full outline of the script, or merely a part of it, but the function that is junking up is right in this area definately. Obviously stopping the script would be added later via hotkeys, but the problem I'm having right now is with the actual input itself. I figured taking it one step at a time would be good.

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  

×