kazhkaz Posted January 3, 2006 Author Share Posted January 3, 2006 (edited) Very beginning of everything I did to get to my Do/Until Loop and Do/Until also this part: Run("C:\Program Files\Silkroad\Silkroad.exe") WinWaitActive("Silkroad Online Launcher"); wait 3 seconds for the window to exist Sleep(10000) MouseClick("left", 756, 510, 1, 1) WinWaitActive("SRO_Client") Sleep(15000) Send("{ENTER}") Sleep (1000) Send("user") Send("{TAB}") Sleep(500) Send("pass") Send("{ENTER}") Sleep(10000) Do; will do the pixelgetcolor every 5 seconds until it = 0x674023 MouseMove(512, 428) If PixelGetColor( 512, 428) == 0x9C4A31 Then MouseClick("left", 512, 428, 1, 1); added a 1 for 1 click, and 1 for speed Edited January 3, 2006 by kazhkaz Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 3, 2006 Moderators Share Posted January 3, 2006 Well I'm starting to get my ownself confused... try this:expandcollapse popup; how did you get your coords from the autoinfo tool, are they screen coords / window coords / or client coords ; the below OPT's will use window coords as an example the 0 indentifies window in the OPT's I'm using Opt("MouseCoordMode", 0); read the help to see if you need to change that to a 1 or 2 if it's 1, I suggest your reget your coords with window or client Opt("PixelCoordMode", 0) Opt("WinTitleMatchMode", 2); Just in case... let's make sure that if we don't have the whole title, that it finds the window all the same Dim $EndIt = '' While 1; starting of an infinite loop If Not ProcessExists('Silkroad.exe') Then Run("C:\Program Files\Silkroad\Silkroad.exe") EndIf WinWait("Silkroad Online Launcher") If Not WinActive("SilkRoad Online Launcher") Then WinActivate("SilkRoad Online Launcher"); activate if not active once window exists.. this ensures that if the window was blocked by somthing else that it will get activated EndIf Sleep(10000) MouseClick("left", 756, 510, 1, 1) WinWaitActive("SRO_Client") Sleep(10000) Send("{ENTER}") Sleep (1000) Send("user", 3) Send("{TAB}") Sleep(500) Send("pass") Send("{ENTER}") Sleep(10000) Do; will do the pixelgetcolor every 5 seconds until it = 0x674023 If PixelGetColor( 512, 428) == 0x9C4A31 Then MouseClick("left", 512, 428, 1, 1); added a 1 for 1 click, and 1 for speed Else Send("{ENTER}") ExitLoop EndIF Sleep(5000) If PixelGetColor(279, 207) == 0x674023 Then $EndIt = 1 Until $EndIt = 1 If $EndIt = 1 Then ExitLoop WEnd;going back to the beginning of While 1 MouseClick("left", 332, 372, 1, 1) MouseClick("left", 861, 704, 1, 1) Exit Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
kazhkaz Posted January 3, 2006 Author Share Posted January 3, 2006 thank u very much i think its working but one more thing were should i put sleep that it wait before starting script from the beggining? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 3, 2006 Moderators Share Posted January 3, 2006 (edited) Until $EndIt = 1 If $EndIt = 1 Then ExitLoop Sleep(5000) Edited January 3, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
kazhkaz Posted January 3, 2006 Author Share Posted January 3, 2006 (edited) smth is wrong becose everything is working fine but when it comes to Do/Until it starts the script from beggining :S i dont know why but i removed ExitLoop then it didnt start the script when if condition was true the problem is i think that ExitLoop must be in another place i think u didnt understand were i wanted to start the script from beggiing i will to explain u once more If PixelGetColor( 512, 428) == 0x9C4A31 Then MouseClick("left", 512, 428, 1, 1 thats the condition after wich the script has to start from beggining ad if its false then it has to do this till condition is true or PixelGetColor(279, 207) == 0x674023 : Else Send("{ENTER}") i hope now u will understand Edited January 3, 2006 by kazhkaz Link to comment Share on other sites More sharing options...
kazhkaz Posted January 4, 2006 Author Share Posted January 4, 2006 so can any1 help me ? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 4, 2006 Moderators Share Posted January 4, 2006 Can you put your script up there, and then use the semicolon ';' to put comments on where you want it to start over and what you'd like to do where? I made the code as you asked, so it must be a miscommunication. By the way... who is smth? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
kazhkaz Posted January 4, 2006 Author Share Posted January 4, 2006 (edited) expandcollapse popupOpt("MouseCoordMode", 1) Opt("PixelCoordMode", 1) Opt("WinTitleMatchMode", 2) Dim $EndIt = '' While 1 If Not ProcessExists('Silkroad.exe') Then Run("C:\Program Files\Silkroad\Silkroad.exe") EndIf WinWait("Silkroad Online Launcher") If Not WinActive("SilkRoad Online Launcher") Then WinActivate("SilkRoad Online Launcher") EndIf Sleep(10000) MouseClick("left", 756, 510, 1, 1) WinWaitActive("SRO_Client") Sleep(10000) Send("{ENTER}") Sleep (1000) Send("user") Send("{TAB}") Sleep(500) Send("pass") Send("{ENTER}") Sleep(10000) Do MouseMove(512, 428) If PixelGetColor( 512, 428) == 0x9C4A31 Then MouseClick("left", 512, 428, 1, 1); after this script has to begin from the beggining Else Send("{ENTER}"); this must be going till PixelGetColor( 512, 428) == 0x9C4A31 or PixelGetColor(493, 752) = 0x000000 ExitLoop EndIF Sleep(5000) If PixelGetColor(493, 752) = 0x000000 Then $EndIt = 1 Until $EndIt = 1 Sleep(1000) If $EndIt = 1 Then ExitLoop WEnd MouseClick("left", 332, 372, 1, 1) Sleep (3000) MouseClick("left", 766, 704, 1, 1); thats the end, it has to stop scirpt after this is done :) Exit thats how i want P.S. smth = something if u asked that Edit: i saw one thing that it presses Enter 3 times with a pause about 5s (<---- thats all right) but then starts script from beggining (<----- thats not it shoul be ) Edited January 4, 2006 by kazhkaz Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 4, 2006 Moderators Share Posted January 4, 2006 Do If PixelGetColor( 512, 428) == 0x9C4A31 Then MouseClick("left", 512, 428, 1, 1); after this script has to begin from the beggining ExitLoop Else Send("{ENTER}"); this must be going till PixelGetColor( 512, 428) == 0x9C4A31 or PixelGetColor(493, 752) = 0x000000 EndIF Sleep(5000) If PixelGetColor(493, 752) == 0x000000 Then $EndIt = 1 Until $EndIt = 1 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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