The problem is when the script go to the loop block the "The second Timer in the guy don't use the random function"
Can anyone please help me
Code: Select all
$string = FEED_INTEGRITY_CLICKBAIT_POST_LABELING ; Nome coda di emerald visualizzata durante le task
WaitTime := 58
Gui, 99:+AlwaysOnTop
Gui, 99:font,s9 bold,Verdana
Gui, 99:-Caption -Border -sysmenu
Gui, 99:add, text, x0 y0 w17 h12 Center vTX , %WaitTime%
Gui, 99:Show, x152 y689
loop % WaitTime-1 {
GuiControl,99:,TX,% Frmt1(--WaitTime)
sleep, 1000
}
Gui, 99:Destroy
Frmt1(secs) {
time = 20000101
time += %secs%, seconds
FormatTime, ss, %time%, ss
return ss
Sleep, 50
}
Loop
{
WinActivate, Google Chrome ahk_class Chrome_WidgetWin_1
Sleep, 50
Image := OCR([321, 151, 337, 41], "eng")
if Image not contains %$string%
{
SoundPlay, %A_ScriptDir%/error.mp3
Click, 68 124 ; Clicca Logo SRT per uscire
Random randommin, 1200, 2400 ; Secondi random per rientrare nella coda di Emerald
Gui, 99:+AlwaysOnTop
Gui, 99:font,s9 bold,Verdana
Gui, 99:-Caption -Border -sysmenu
Gui, 99:add, text, x0 y0 w35 h12 Center vTX , %randommin%
Gui, 99:Show, x152 y689
loop % randommin-1 {
GuiControl,99:,TX,% Frmt2(--randommin)
sleep, 1000
}
Gui, 99:Destroy
Frmt3(secs) {
time = 20000101
time += %secs%, seconds
FormatTime, mmss, %time%, mm:ss
return ss
}
Click, 68 124 ; Clicca Logo SRT per entrare in cod
}
initSecs := 58 ;
Sleep, 150
Sleep, 150
WinActivate, Google Chrome ahk_class Chrome_WidgetWin_1
Sleep, 333
Sleep, 250
Send, {Numpad2}
Sleep, 150
Send, {NumpadEnter}
Sleep, 150
Send, {Numpad2}
Sleep, 150
Send, {NumpadEnter}
Sleep, 150
Send, {NumpadEnter}
SoundPlay, C:\Users\Alessio\Downloads\ding.mp3
; creo la gui
Gui, 99:+AlwaysOnTop
Gui, 99:font,s9 bold,Verdana
Gui, 99:-Caption -Border -sysmenu
Gui, 99:add, text, x0 y0 w17 h12 Center vTX , %initSecs%
Gui, 99:Show, x152 y689
loop % initSecs-1 {
GuiControl,99:,TX,% Frmt(--initSecs)
sleep, 1000
}
Gui, 99:Destroy
Frmt(secs) {
time = 20000101
time += %secs%, seconds
FormatTime, ss, %time%, ss
return ss
}
}
[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]
[Mod action: Moved topic to v1 section since this is v1 code. The main section is for v2.]