Kiesa Posted January 9, 2010 Posted January 9, 2010 (edited) Hello, am sorry for bad english, am using autoit like 6 month But still just learning, and now need help.. With autoit am runing program (program change ip) and i want do: When program runing script should not restart, but wait untill firefox get another tab.. Example.. Am on - 'Register - Mozilla Firefox' So script should wait untill the registration will be sucefully complited.. 'Sucefully registred - Mozilla Firefox'... Hope so you guys understand what i mean.. This is script i have dont by atm.. Now it's runing the software and active mozilla firefox tab 'Register - Mozilla firefox' $i = 0 $x = 0 $r = 0 $t = 0 While $i <= 10 Do Run("Conexion.cmd") sleep(800) Winwait("AOL 9.5 - Connected, Signed-On","",60) If WinExists("AOL 9.5 - Connected, Signed-On") Then $x = 5 WinWaitActive("AOL 9.5 - Connected, Signed-On","",80) WinActivate("Deposit file - Mozilla Firefox") sleep(500) Until $x = 2 Send("{CTRLDOWN}w{CTRLUP}") Send("{CTRLDOWN}{SHIFTDOWN}{DEL}{CTRLUP}{SHIFTUP}") Wend Edited January 9, 2010 by Kiesa
gte Posted January 9, 2010 Posted January 9, 2010 Hi, I'm having a hard time understanding this, but respect anyone who knows 2 languages, so no disrespect intended Are you trying to run a command, wait until a firefox tab has "successfully completed text" in that tab, and then loop and do the same function? If so, you can have a Do ConsoleWrite("Waiting for window to successfully register" & @crlf) Sleep(500) Until WinExists("Mozilla Firefox", "Successfully registered") Hello, am sorry for bad english, am using autoit like 6 month But still just learning, and now need help.. With autoit am runing program (program change ip) and i want do: When program runing script should not restart, but wait untill firefox get another tab.. Example.. Am on - 'Register - Mozilla Firefox' So script should wait untill the registration will be sucefully complited.. 'Sucefully registred - Mozilla Firefox'... Hope so you guys understand what i mean.. This is script i have dont by atm.. Now it's runing the software and active mozilla firefox tab 'Register - Mozilla firefox' $i = 0 $x = 0 $r = 0 $t = 0 While $i <= 10 Do Run("Conexion.cmd") sleep(800) Winwait("AOL 9.5 - Connected, Signed-On","",60) If WinExists("AOL 9.5 - Connected, Signed-On") Then $x = 5 WinWaitActive("AOL 9.5 - Connected, Signed-On","",80) WinActivate("Deposit file - Mozilla Firefox") sleep(500) Until $x = 2 Send("{CTRLDOWN}w{CTRLUP}") Send("{CTRLDOWN}{SHIFTDOWN}{DEL}{CTRLUP}{SHIFTUP}") Wend HP OpenView ServiceCenter keep alive scriptRemote Desktop Login Script
Kiesa Posted January 9, 2010 Author Posted January 9, 2010 Sorry, am from Lithuania (EUROPE) and hard to tell what exsactly i need... Eayser to understand english than write.. Script should like now, am replying.. And the Firefox title is 'Replying To Some help neened - Autoit Forums - Mozilla Firefox' script should wait untill i done text (In this example untill i write my reply and click 'Add reply'.. When i click add reply the firefox title is 'Some help neened - Autoit Forums - Mozilla Firefox' so script should restart when the title will be 'Some help neened - Autoit Forums - Mozilla Firefox'. It's for example.
gte Posted January 9, 2010 Posted January 9, 2010 Ok, still trying to understand (sorry I don't speak Lithuanian)In this example, the script would look for a window titled "Autoit Forums - Mozilla Firefox, Some help neened" (the window control has (title, text)) and then you want it to know when you are finished typing text into the window so the script can then hit the 'add reply' button for you?Sorry, am from Lithuania (EUROPE) and hard to tell what exsactly i need... Eayser to understand english than write.. Script should like now, am replying.. And the Firefox title is 'Replying To Some help neened - Autoit Forums - Mozilla Firefox' script should wait untill i done text (In this example untill i write my reply and click 'Add reply'.. When i click add reply the firefox title is 'Some help neened - Autoit Forums - Mozilla Firefox' so script should restart when the title will be 'Some help neened - Autoit Forums - Mozilla Firefox'.It's for example. HP OpenView ServiceCenter keep alive scriptRemote Desktop Login Script
Kiesa Posted January 9, 2010 Author Posted January 9, 2010 Ok, still trying to understand (sorry I don't speak Lithuanian)In this example, the script would look for a window titled "Autoit Forums - Mozilla Firefox, Some help neened" (the window control has (title, text)) and then you want it to know when you are finished typing text into the window so the script can then hit the 'add reply' button for you?Dont think abbout add buttom. Am already thinked about it. It should wait untill the title change (it's changing when registration will be done) and then repeat process.
gte Posted January 9, 2010 Posted January 9, 2010 (edited) Ok, I still don't know what you are trying to do, but it sounds like one of the functions is if a window exists You can do While 1 $currentwindow = Winactive("[ACTIVE]", "") If winexists($currentwindow) Then do until $currentwindow <> Winactive("[ACTIVE]", "") [then run the code you want, then it will loop] EndIf Wend Dont think abbout add buttom. Am already thinked about it. It should wait untill the title change (it's changing when registration will be done) and then repeat process. Edited January 9, 2010 by gte HP OpenView ServiceCenter keep alive scriptRemote Desktop Login Script
gte Posted January 11, 2010 Posted January 11, 2010 Post your current script, is the login script still working? HP OpenView ServiceCenter keep alive scriptRemote Desktop Login Script
Kiesa Posted January 11, 2010 Author Posted January 11, 2010 It's current script $i = 0 $x = 0 $r = 0 $t = 0 While $i <= 10 Do Run("Conexion.cmd") sleep(800) Winwait("AOL 9.5 - Connected, Signed-On","",60) If WinExists("AOL 9.5 - Connected, Signed-On") Then $x = 5 WinWaitActive("AOL 9.5 - Connected, Signed-On","",80) WinActivate("Registracija - Mozilla Firefox") sleep(500) until winexists("Prekybos tinklas internete - Mozilla Firefox", "") Send("{CTRLDOWN}{SHIFTDOWN}{DEL}{CTRLUP}{SHIFTUP}") Send("{ENTER}") Wend It should just let aol run untill the firefox title will be 'Prekybos tinklas internete - Mozilla Firefox'
gte Posted January 11, 2010 Posted January 11, 2010 Are you sure this is your whole code? What are the variables set to in the top for? Why do you have while $i <= 10? Or do you set x=5 in the if statement I changed your code a little from the syntax flaws I saw, you were missing the EndIf at line 16 and the $x=5 should at least be on the line after the "Then" $i = 0 $x = 0 $r = 0 $t = 0 While $i <= 10 Do Run("Conexion.cmd") sleep(800) Winwait("AOL 9.5 - Connected, Signed-On","",60) If WinExists("AOL 9.5 - Connected, Signed-On") Then $x = 5 WinWaitActive("AOL 9.5 - Connected, Signed-On","",80) WinActivate("Registracija - Mozilla Firefox") sleep(500) EndIf until winexists("Prekybos tinklas internete - Mozilla Firefox", "") Send("{CTRLDOWN}{SHIFTDOWN}{DEL}{CTRLUP}{SHIFTUP}") Send("{ENTER}") Wend It's current script $i = 0 $x = 0 $r = 0 $t = 0 While $i <= 10 Do Run("Conexion.cmd") sleep(800) Winwait("AOL 9.5 - Connected, Signed-On","",60) If WinExists("AOL 9.5 - Connected, Signed-On") Then $x = 5 WinWaitActive("AOL 9.5 - Connected, Signed-On","",80) WinActivate("Registracija - Mozilla Firefox") sleep(500) until winexists("Prekybos tinklas internete - Mozilla Firefox", "") Send("{CTRLDOWN}{SHIFTDOWN}{DEL}{CTRLUP}{SHIFTUP}") Send("{ENTER}") Wend It should just let aol run untill the firefox title will be 'Prekybos tinklas internete - Mozilla Firefox' HP OpenView ServiceCenter keep alive scriptRemote Desktop Login Script
gte Posted January 11, 2010 Posted January 11, 2010 Also, I think this will be a bit cleaner Send("{LCTRL}+{LSHIFT}+{DEL}") or Send("{LCTRL}"+"{LSHIFT}"+"{DEL}") for line 19 HP OpenView ServiceCenter keep alive scriptRemote Desktop Login Script
Kiesa Posted January 11, 2010 Author Posted January 11, 2010 Also, I think this will be a bit cleanerSend("{LCTRL}+{LSHIFT}+{DEL}") or Send("{LCTRL}"+"{LSHIFT}"+"{DEL}") for line 19:S
gte Posted January 11, 2010 Posted January 11, 2010 (edited) Ok, can you answer my questions? Where did this code come from?Are you sure this is your whole code?What are the variables set to in the top for?Why do you have while $i <= 10? Or do you set x=5 in the if statementI changed your code a little from the syntax flaws I saw, you were missing the EndIf at line 16 and the $x=5 should at least be on the line after the "Then":S Edited January 11, 2010 by gte HP OpenView ServiceCenter keep alive scriptRemote Desktop Login Script
Kiesa Posted January 12, 2010 Author Posted January 12, 2010 Am tried to take from another code some part's.
nfwu Posted January 12, 2010 Posted January 12, 2010 I changed your code a little from the syntax flaws I saw, you were missing the EndIf at line 16 and the $x=5 should at least be on the line after the "Then" Incorrect. That was a one-line If statement, an EndIf is not required. Also, I think this will be a bit cleaner Send("{LCTRL}+{LSHIFT}+{DEL}") or Send("{LCTRL}"+"{LSHIFT}"+"{DEL}") for line 19 That wouldn't work. The addition operator doesn't work on strings. -------------- Okay. While True Run("Conexion.cmd") ;; Here, we wait until a the window exists. WinWait("Prekybos tinklas internete - Mozilla Firefox", "") ;; Then it brings it to front, and waits for it to come to front... WinActivate("Prekybos tinklas internete - Mozilla Firefox", "") WinWaitActive("Prekybos tinklas internete - Mozilla Firefox", "") ;;Once the window exists and is in front, this would run: Send("{CTRLDOWN}w{CTRLUP}") Send("{CTRLDOWN}{SHIFTDOWN}{DEL}{CTRLUP}{SHIFTUP}") Wend Is this what you wanted? TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode()
Kiesa Posted January 12, 2010 Author Posted January 12, 2010 Incorrect. That was a one-line If statement, an EndIf is not required. That wouldn't work. The addition operator doesn't work on strings. -------------- Okay. While True Run("Conexion.cmd") ;; Here, we wait until a the window exists. WinWait("Prekybos tinklas internete - Mozilla Firefox", "") ;; Then it brings it to front, and waits for it to come to front... WinActivate("Prekybos tinklas internete - Mozilla Firefox", "") WinWaitActive("Prekybos tinklas internete - Mozilla Firefox", "") ;;Once the window exists and is in front, this would run: Send("{CTRLDOWN}w{CTRLUP}") Send("{CTRLDOWN}{SHIFTDOWN}{DEL}{CTRLUP}{SHIFTUP}") Wend Is this what you wanted? Omg thank you!!!!!!!!
Kiesa Posted January 13, 2010 Author Posted January 13, 2010 (edited) I got problem... When script trying to do same (fill 2nd time field) fill sucefully, but program wont reload somewhy :Ss example how my script work.. Vided when script had some problem's... But now problem is - script wont restart after 2nd time.. http://www.youtube.com/watch?v=uTzIQ-nm3Bc Edited January 13, 2010 by Kiesa
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