SadBunny Posted August 1, 2016 Share Posted August 1, 2016 (edited) I guess you missed the point in my example Set the AdlibRegister outside of the function for the first time (or, alternatively, call the function once), otherwise it will never start up. So: Set adlib one initial time Enter infinite loop Inside the function that was called by the adlib: unregister adlib, beep, set new adlib with new time /edit: note that your script sets the adlib (which resets it if it was already set) EVERY TIME the error box is NOT found. You need to set it ONE time /edit 2: you may want to Unregister the adlib when the button was found. Edited August 1, 2016 by SadBunny Dequalityy 1 Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Dequalityy Posted August 1, 2016 Author Share Posted August 1, 2016 expandcollapse popupWinActivate("Netstationen Client – Google Chrome") HotKeySet("{F4}", "ExitProg") MouseClick("left", 1078, 120, 1, 0) AdlibRegister("StayOnline", Random(2000, 2500, 1)) While (1) $blah = PixelSearch(686, 118, 1102, 487, 0xFFD166, 0) ; Search for OK button. If NOT(@error) Then ; If okay button pop's up this will execute a click on the OK button. MouseMove($blah[0]+5, $blah[1]+5, 0) Sleep(2000) MouseClick("left", $blah[0]+5, $blah[1]+5, 2, 0) Sleep(1000) ElseIf (@error) Then AdlibRegister("StayOnline", Random(2000, 2500, 1)) EndIf WEnd Func StayOnline() ; Keeps you online. AdlibUnRegister("StayOnline") Send("/goto 0", 1) Sleep(3000) Send("{ENTER}", 0) AdlibRegister("StayOnline", Random(2000, 2500, 1)) EndFunc Func ExitProg() ; Exits Auto Exit EndFunc ;==>ExitProg Like that? cuz that didnt work :/ Link to comment Share on other sites More sharing options...
SadBunny Posted August 1, 2016 Share Posted August 1, 2016 Check my edits in my previous post. Read your script: you are resetting the adlib every time the button is not found. As this happens tens or maybe hundreds of times per second, you are constantly resetting your adlib to somewhere between 2 to 2.5 seconds in the future. So it never actually happens. Dequalityy 1 Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Dequalityy Posted August 1, 2016 Author Share Posted August 1, 2016 6 minutes ago, SadBunny said: Check my edits in my previous post. Read your script: you are resetting the adlib every time the button is not found. As this happens tens or maybe hundreds of times per second, you are constantly resetting your adlib to somewhere between 2 to 2.5 seconds in the future. So it never actually happens. Think i got it this time! expandcollapse popupWinActivate("Netstationen Client – Google Chrome") HotKeySet("{F4}", "ExitProg") MouseClick("left", 1078, 120, 1, 0) Sleep(1000) AdlibRegister("StayOnline", Random(2000, 2500, 1)) While (1) $blah = PixelSearch(686, 118, 1102, 487, 0xFFD166, 0) ; Search for OK button. If NOT(@error) Then ; If okay button pop's up this will execute a click on the OK button. MouseMove($blah[0]+5, $blah[1]+5, 0) Sleep(2000) MouseClick("left", $blah[0]+5, $blah[1]+5, 2, 0) Sleep(1000) ElseIf (@error) Then Sleep(1000) ;AdlibRegister("StayOnline", Random(2000, 2500, 1)) EndIf WEnd Func StayOnline() ; Keeps you online. AdlibUnRegister("StayOnline") Sleep(500) Send("/goto 0", 1) Sleep(300) Send("{ENTER}", 0) AdlibRegister("StayOnline", Random(2000, 2500, 1)) EndFunc Func ExitProg() ; Exits Auto Exit EndFunc ;==>ExitProg Correct? Link to comment Share on other sites More sharing options...
SadBunny Posted August 1, 2016 Share Posted August 1, 2016 Looks better. Although I would still suggest to AdlibUnregister as soon as you don't need it to run any more, just because cleaning up is good practice. Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Dequalityy Posted August 1, 2016 Author Share Posted August 1, 2016 But how that ? and it should run the entire time out it shouldnt stop being paused if thats what u mean i mean it should type that message ones every 12-18th minute so it shouldnt stop being paused if thats what u mean ? :-) -Dequalityy. Link to comment Share on other sites More sharing options...
SadBunny Posted August 1, 2016 Share Posted August 1, 2016 Oh, I thought the script was supposed to stop (or continue to another part) when the button was found. Yeah, no, if you need it to continue running then of course leave it be Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Dequalityy Posted August 1, 2016 Author Share Posted August 1, 2016 Well it's supposed to type that message every 12-18 minute while it keeps searching for that pixel Link to comment Share on other sites More sharing options...
SadBunny Posted August 1, 2016 Share Posted August 1, 2016 Yes, but as soon as it finds that pixel and does the click, what needs to happen then? Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Dequalityy Posted August 1, 2016 Author Share Posted August 1, 2016 Nothing really, just keep going =) it's all for learning :-D Tyvm for your help! Link to comment Share on other sites More sharing options...
SadBunny Posted August 1, 2016 Share Posted August 1, 2016 No problem, glad I could help. Have a nice day! Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Dequalityy Posted August 1, 2016 Author Share Posted August 1, 2016 Like wise! Link to comment Share on other sites More sharing options...
AutoBert Posted August 1, 2016 Share Posted August 1, 2016 (edited) forgottemn to refresyh Browser (F5) Edited August 1, 2016 by AutoBert Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now