Sign in to follow this  
Followers 0
dlshoong

Why is the AutoIT repeating the TT twice at the same time

12 posts in this topic

HotKeySet("{PAUSE}","Escape")

Dim $GetHealth, $Color, $kills

$GameWinTitle = "Nostale"

WinActivate($GameWinTitle, "")

WinWaitActive($GameWinTitle, "", 5)

$Color = 0x00AA00; Health Color

$kills = 0

While 1

$SearchResult = PixelSearch(313, 130, 313, 131, $Color, 20)

If @error Then

Send("{T}")

Sleep("15000")

Send("{T}")

Sleep("100")

Else

Sleep("100")

Send("{SPACE}")

Sleep(100)

Send("{2}")

Sleep(100)

Send("{3}")

Sleep(1000)

Send("{4}")

Sleep(1000)

Send("{3}")

Sleep(1000)

Send("{5}")

Sleep(1000)

Send("{3}")

Sleep(100)

$kills = $kills + 1

EndIf

WEnd

Func Escape()

Exit 0

EndFunc

-----------------------------------------------------------------------------------------------------------

can anyone fix it by making it not repeating the "T" twice pls?

1. The "T" somtimes is not repeated

2.Only certain times it repeats the "T"

Share this post


Link to post
Share on other sites



Certainly the window to which the Send is expexted is not active after the 15 seconds

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

how can i fix the problem?

I already open the window.

Then The Autoit automaticly goes to the window and it works for awhile but the Twice repeated "T" at the same time sometimes interupts the activity. I only need "T" for one at a time.

Edited by dlshoong

Share this post


Link to post
Share on other sites

Any reason you put the T between {}

Send("TT") will send the letter T twice


CheersNobby

Share this post


Link to post
Share on other sites

Send("{T}")

Sleep("15000")

Send("{T}")

Sleep("100")

----------------------------------

for the first loop it only types ;

1. "T" for once

2.then sleep for 15000

3.then type "T" again

4.sleeps again

2nd loops onward,this might happen;

1. "T" for twice (which can also be represented by "TT")

2.then sleep for 15000

i cant really thing what infected the repeat in 2nd loops onwards.

anyone can help?

Share this post


Link to post
Share on other sites

Certainly the window to which the Send is expexted is not active after the 15 seconds

how can i make it active the whole time?

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Don't use quotes in sleep().

Edit - nm, that doesn't seem to matter.

Btw, have you tried just...

Send("T")

Sleep("15000")

Send("T")

Sleep("100")

?

Edited by xcal

Share this post


Link to post
Share on other sites

yes.i had tried

I found out that theres no difference between existence of quotes

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

yes.i had tried

I found out that theres no difference between existence of quotes

Send("T")

Sleep("15000")

Send("T")

Sleep("100")

You missed what he did. He removed the braces {} .... when sending text, the braces are not required. Suggestion....instead of "Send" which sends to the active window....use controlsend which is sent directly to the window in question, no matter the state (though unreliable if minimized.)

; ControlSend ( "title", "text", controlID, "string" [, flag]  )  




ControlSend($GameWinTitle, "", "", "T",1)
Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

how can i get The ControlID?

My program format is Nostale.dat and this program can only be start through Internet Explorer

i was unable to get the control is,its empty in the search

Edited by dlshoong

Share this post


Link to post
Share on other sites

how can i get The ControlID?

My program format is Nostale.dat and this program can only be start through Internet Explorer

i was unable to get the control is,its empty in the search

ControlID is not exactly required....and if you're using IE, ugh...COM time. Good luck.


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

anyway to control MouseClick same as ControlSend?

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