Hello!
Here I'm again.
I'm reading help files, but it is my "English" or it is just a bit too complcated for now, but - here is my script -
HTML Code:
HotKeySet("{Del}", "TooglePause")
Global $Paused
Opt('PixelCoordMode', 0)
Global $handle = WinGetHandle("Lineage*II * ", "")
While 1
WEnd
Func TooglePause()
$Paused = Not $Paused
While $Paused
;target hp bar check at 0 HP
$tHppixel = PixelSearch(787, 58, 787, 58, 0x6F1713, 2, 1, $handle)
If IsArray($tHppixel) = 0 Then
Send("{F12}") ;finding next mob
Sleep(20)
If IsArray($tHppixel) = 0 Then
Send("{F11}") ;finding next mob
Sleep(20)
If IsArray($tHppixel) = 0 Then
Send("{F10}") ;finding next mob
Sleep(20)
EndIf
EndIf
;target should be found at this point, so attacking
Else
Send("{F2}") ;attacking mob skill 1
Sleep(20)
Send("{F3}") ;attacking mob skill 2
Sleep(20)
EndIf
WEnd
EndFunc ;==>TooglePause
I'm trying to next target mob if previous mob HP didn't show up. What happens is it presses F12,F11,F10 and stops at F10. I tried to implement ElseIf, but result is exactly the same. What am I doing wrong this time?
And one more question - is it possible to stop script with different script?
What I mean is if have script no1 running which every 1h stops other script no2 by pressing no1 hotkey for 1 minute and then again presses no1 hotkey and script no1 starts?! Or it should be implemented in script no2?
Opt('PixelCoordMode', 0)
Opt('SendKeyDelay', 25)
HotKeySet("{Del}", "TooglePause")
Global $paused = True
Global $handle
While Sleep(10)
If Not $paused Then
$handle = WinGetHandle("Lineage*II * ", "")
If Not @error Then
;target hp bar check at 0 HP
$tHppixel = PixelSearch(787, 58, 787, 58, 0x6F1713, 2, 1, $handle)
If @error Then
Send("{F12}") ;finding next mob
$tHppixel = PixelSearch(787, 58, 787, 58, 0x6F1713, 2, 1, $handle)
If @error Then
Send("{F11}") ;finding next mob
$tHppixel = PixelSearch(787, 58, 787, 58, 0x6F1713, 2, 1, $handle)
If IsArray($tHppixel) = 0 Then
Send("{F10}") ;finding next mob
EndIf
EndIf
EndIf
If IsArray($tHppixel) Then
;target found, attacking
Send("{F2}") ;attacking mob skill 1
Send("{F3}") ;attacking mob skill 2
EndIf
EndIf
EndIf
WEnd
Func TooglePause()
$Paused = Not $Paused
EndFunc
Thank you!
Added few extra sleep and now works as a charm. Your script gives me a good lesson of how to put things together and save pc resources as well. Cheers!
Opt('PixelCoordMode', 0)
Opt('SendKeyDelay', 25)
HotKeySet("{Del}", "TooglePause")
Global $paused = True
Global $handle
While Sleep(10)
If Not $paused Then
$handle = WinGetHandle("Lineage*II * ", "")
If Not @error Then
;target hp bar check at 0 HP
$tHppixel = PixelSearch(787, 58, 787, 58, 0x6F1713, 2, 1, $handle)
If @error Then
Send("{F12}") ;finding next mob
$tHppixel = PixelSearch(787, 58, 787, 58, 0x6F1713, 2, 1, $handle)
If @error Then
Send("{F11}") ;finding next mob
$tHppixel = PixelSearch(787, 58, 787, 58, 0x6F1713, 2, 1, $handle)
If IsArray($tHppixel) = 0 Then
Send("{F10}") ;finding next mob
EndIf
EndIf
EndIf
If IsArray($tHppixel) Then
;target found, attacking
Send("{F2}") ;attacking mob skill 1
Send("{F3}") ;attacking mob skill 2
EndIf
EndIf
EndIf
WEnd
Func TooglePause()
$Paused = Not $Paused
EndFunc
Was macht While Sleep(10) ?
Also läuft die Schleife 10 Millisekunden lang? Wenn ja, wozu ist das gut
[NOOB] AutoIt Multiple Image Search 08/01/2014 - AutoIt - 0 Replies Hello there,
I am trying to make a very simple bot for a game I am currently playing.
Here's the concept:
There's an event every 30 minutes, so I'd like the bot to click on an image to open the window, then wait for the button to appear (there's a 30 minute timer before the image appears) then I want it to click on another image that will appear to start the actual battle. Once again wait for the battle to end and press X to close the window + repeat.
Whilst in the battle, the timer...
Incomplete AutoIt Login Script for Multiple Accounts 10/27/2013 - League of Legends - 0 Replies Hello guys,
got quite bored today and wrote a little AutoIt Script, because I was pissed to change my account name and write the password all the time.
When you start it, you can Choose your account Name, press Log In and it automatically starts the launcher and logs in.
Bad thing is, I have no clue about Auto It Programming so it's needed to add all things manually. Also all accounts must have the same password and the "Remember Username" should not be checked.
#cs...
Autoit multiple windows 10/17/2013 - AutoIt - 8 Replies Hi
IS it possible to make autoit work with multiple window for example i have 5 windows of running game, now i need when i start bot to ask me what window i want to choose. Please help :)
[Frage] If...Then...Endif 12/19/2010 - AutoIt - 13 Replies Hallo,
Hab da ein problem und zwar will ich das sich ne msgbox öffnet wenn eine gewisse uhrzeit und datum erreicht ist, die in einer listbox stehen:
$_hb_date1 = GUICtrlRead($lbl_date)
$_fw_date1 = GUICtrlRead($lb_fw_date)
$_fw_time1 = GUICtrlRead($lb_fw_time)
$_hb_time1 = GUICtrlread($lbl_uhrzeit)