I have the coordinates of an specific Pixel and the color of it.
Now i need help on how to work with it!
I want to make a script, that presses a key, looks if the color in that pixel is corect and if the color is corect it presses another key. if the color is wrong it presses the first key again.
and then i need a detection, that waits until the color of that specific pixel is changed and then it should start another script, where it presses another key and waits some time and then starts in the beginning with the first key again.
can somebody write me code that does something like that?
Global $KEY[2]=["A","B"]
Global $COLOR=0
Global $X=0,$Y=0
While 1
LearnBasics()
WEnd
Func LearnBasics()
Send($KEY[0])
If PixelGetColor($X,$Y)=$COLOR Then
Send($KEY[1])
Return 1
Else
Return 0
Endif
EndFunc
If WinExists("ZENSIERT") Then
WinActivate("ZENSIERT")
WinWaitActive("ZENSIERT")
EndIf
While 1
fight()
WEnd
Func fight()
If PixelGetColor (560, 70) = 0xFFFFFF Then
Send("1")
Else
While Send("3")
Sleep (500)
Send("2")
Sleep (1500)
WEnd
EndIf
EndFunc
Thats my Code till now, only Problem with it, it is spamming the Keys. That is a Problem, becaus "2" is to sit down and recover and if u press it again he will stand up and stop recovering. I need the "2" only pressed once after the Pixelcolor doesn`t match.
Any suggestions for a command to insert?
das ist mein script bis jetzt. es funktioniert noch nicht wirklich gut.
"1" ist zum Angreifen
"2" ist zum Hinsetzen
"3" ist zum Loot aufsammeln
das einzige Problem am jetzigen Script ist, dass er die Tasten spammt. Was bei "1" und "3" nicht wirklich das Problem ist, dort schadet es nicht, wenn der Befehl mehrfach gesendet wird, allerdings bei "2" wird es zum Problem, da er automatisch wieder aufsteht, wenn die Taste erneut gedrückt wird.
Hat jemand eine Ahnung, welchen Befehl ich einfügen muss, damit die 2 nur einmal gesendet wird?
Thats my Code till now, only Problem with it, it is spamming the Keys. That is a Problem, becaus "2" is to sit down and recover and if u press it again he will stand up and stop recovering. I need the "2" only pressed once after the Pixelcolor doesn`t match.
Any suggestions for a command to insert?
das ist mein script bis jetzt. es funktioniert noch nicht wirklich gut.
"1" ist zum Angreifen
"2" ist zum Hinsetzen
"3" ist zum Loot aufsammeln
das einzige Problem am jetzigen Script ist, dass er die Tasten spammt. Was bei "1" und "3" nicht wirklich das Problem ist, dort schadet es nicht, wenn der Befehl mehrfach gesendet wird, allerdings bei "2" wird es zum Problem, da er automatisch wieder aufsteht, wenn die Taste erneut gedrückt wird.
Hat jemand eine Ahnung, welchen Befehl ich einfügen muss, damit die 2 nur einmal gesendet wird?
use memory functions, instead of pixel checking/searching to determine if you standing up or sitting. search for the bit value (0/1) in memory, get address, use it.
use memory functions, instead of pixel checking/searching to determine if you standing up or sitting. search for the bit value (0/1) in memory, get address, use it.
when i get u the adress, can u write me the code i need? i am new to autoit as u can see