Casper2400 Posted January 12, 2007 Share Posted January 12, 2007 Before I download this program and read through hours of help topics I would like to know. I am going on vacation in a few weeks and want to run a script once a week. I will have 3 programs running. I want to close the 3 programs currently running open a new program click launch button...wait click I agree button...wait for update to finish close this program open another program enter password click go button end until next time to run. I will run the script as a scheduled task for once a week to auto run the script. Can autoit do this? Thasnk you in advance I have never killed a man, but I have read many obituaries with a smile.Arguing on the enternet is like running in the special olympics. Even if you win your still retarded.If I like it I will use it, if I dont it keeps me warm when I burn it. Link to comment Share on other sites More sharing options...
herewasplato Posted January 12, 2007 Share Posted January 12, 2007 (edited) Welcome to the forum. AutoIt can* do it, the question is can you script it :-) *Caveat: there are a few apps/games that might resist automation. Edited January 12, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Paulie Posted January 12, 2007 Share Posted January 12, 2007 (edited) I want to close the 3 programs currently runningProcessClose() open a new programRun() click launch button...waitMouseClick() click I agree button...wait for update to finishMouseClick() close this programProcessClose() open another programRun() enter passwordSend() click go buttonMouseClick() end until next time to run.Exit Edited January 12, 2007 by Paulie Link to comment Share on other sites More sharing options...
Casper2400 Posted January 12, 2007 Author Share Posted January 12, 2007 Thank you Paulie that helps a lot and I have downloaded the program and began to play with it. It is quite simple and I cant believe how easy it is. However I am stuck on one of your quotes... I asked to launch a program then wait for an update list to be loaded. It then will ask to agree... how do I know what time to wait here? the update list size and download times will vary from week to week. I opened the active window and it gives the same name so a winwait feature is not reading. Also after each update each week the program version changes so I wont know the window title screen name. any way around this? I have never killed a man, but I have read many obituaries with a smile.Arguing on the enternet is like running in the special olympics. Even if you win your still retarded.If I like it I will use it, if I dont it keeps me warm when I burn it. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 12, 2007 Moderators Share Posted January 12, 2007 Thank you Paulie that helps a lot and I have downloaded the program and began to play with it. It is quite simple and I cant believe how easy it is. However I am stuck on one of your quotes...I asked to launch a program then wait for an update list to be loaded.It then will ask to agree... how do I know what time to wait here? the update list size and download times will vary from week to week.I opened the active window and it gives the same name so a winwait feature is not reading.Also after each update each week the program version changes so I wont know the window title screen name.any way around this?Do they have the same text return? You could use the 2nd parameter to make sure you have the right window, or you could get complex and use ProcessList()+WinList() etc... I've made a _WinGetByExe() (I think, or something like that).Valuater has a nice thread of AutoIt wrappers that may help you as well:http://www.autoitscript.com/forum/index.ph...c=19370&hl= 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...
Casper2400 Posted January 12, 2007 Author Share Posted January 12, 2007 What I am opening is a game called magic the gathering online. every thursday they shut down the servers to do an update (usually down for 1 hour) What I want to do is run this script each week 10am pst. when I open magic.exe first screen appears and waits to depress "launch button (I sucessfully got this to work in autoit) after clicking launch it will download and check a few files to see if they need an update. after this is done it will now ask "I agree" the window name is the same as the first, process name is still the same, etc. I want autoit to know when the new screen appears.. it is same name but the screen is the EULA (end user license agreement, I tried to set it to recognize a key word but that didnt work)the window completly changes adds scrollbar etc... but autoit dont see it, it just presses the button (mouse x,y I set) and does nothing (as the button was not available when it clicked) I have never killed a man, but I have read many obituaries with a smile.Arguing on the enternet is like running in the special olympics. Even if you win your still retarded.If I like it I will use it, if I dont it keeps me warm when I burn it. Link to comment Share on other sites More sharing options...
Casper2400 Posted January 12, 2007 Author Share Posted January 12, 2007 After some working and thinking I just added a time delay as if it needed the whole file (it may wait longer sometimes but its ok) now im stuck on a second part... when I click log on if it logs on no problem but... if server is down a pop up will happen saying server unavailable... I cant set a time for this one, I actually need autoit to respond IF this box opens... any help is welcomed. Thank you I have never killed a man, but I have read many obituaries with a smile.Arguing on the enternet is like running in the special olympics. Even if you win your still retarded.If I like it I will use it, if I dont it keeps me warm when I burn it. Link to comment Share on other sites More sharing options...
Casper2400 Posted January 12, 2007 Author Share Posted January 12, 2007 Here is the code I currently have (very simplified) Anyone wishing to copy this bear in mind the coords are all set to MY screen settings. Run ( "C:\Program Files\Wizards of the Coast\Magic Online\magic.exe" );start mtgo update WinWaitActive("Magic Online Install/Update Agent","", 20 ) MouseClick ( "left", 698, 411, 1, 0 );clicks launch button WinWaitActive("Magic Online Install/Update Agent", "") Sleep ( 18000 ) MouseClick ( "left", 455, 622, 1, 0 );clicks I agree button Sleep ( 1000 ) WinWaitActive("Magic Online V2.", "") Sleep ( 1000 ) WinSetState ( "Magic Online V2.", "", @SW_MAXIMIZE ) MouseClick ( "left", 422, 366, 1, 0 );clicks inputs username Send ("username") Sleep ( 1000 ) MouseClick ( "left", 422, 417, 1, 0 );clicks inputs password Send ("password") Sleep ( 1000 ) MouseClick ( "left", 500, 450, 1, 0 );clicks Log On button Sleep ( 1000 ) The above works fine and great (except I have not yet figured the IF statement for server unavailable (failed log in) Below is the next step from above to below it will not wait till logged on... how can I set autoit to recognize when actually connected? expandcollapse popupMouseClick ( "left", 339, 35, 1, 0 );clicks Collection Tab Sleep ( 1000 ) MouseClick ( "left", 200, 330, 1, 0 );clicks Reset Tab Sleep ( 500 ) MouseClick ( "left", 245, 217, 1, 0 );clicks Rarity Menu Sleep ( 1000 ) MouseClick ( "left", 150, 254, 1, 0 );selects rarity "common" Sleep ( 1000 ) MouseClick ( "left", 245, 236, 1, 0 );clicks Version Menu Sleep ( 1000 ) MouseClick ( "left", 150, 276, 1, 0 );Selects Version "regular" Sleep ( 1000 ) MouseClick ( "right", 500, 80, 1, 0 );Right clicks Top of Collection for trade menu Sleep ( 1000 ) MouseClick ( "left", 550, 115, 1, 0 );Selects All Tradeable Sleep ( 1000 ) MouseClick ( "left", 200, 330, 1, 0 );clicks Reset Tab Sleep ( 500 ) MouseClick ( "left", 245, 130, 1, 0 );clicks Cards to View Menu Sleep ( 1000 ) MouseClick ( "left", 150, 180, 1, 0 );Select View "physical" Sleep ( 500 ) MouseClick ( "right", 500, 80, 1, 0 );Right clicks Top of Collection for trade menu Sleep ( 1000 ) MouseClick ( "left", 550, 130, 1, 0 );Selects All UnTradeable Sleep ( 1000 ) MouseClick ( "left", 200, 330, 1, 0 );clicks Reset Tab Sleep ( 500 ) MouseClick ( "left", 80, 35, 1, 0 );clicks Main Window Tab Sleep ( 1000 ) MouseClick ( "left", 50, 421, 1, 0 );clicks Log Off Button Sleep ( 1000 ) MouseClick ( "left", 500, 420, 1, 0 );clicks "Check" (Yes log off) Button Sleep ( 2000 ) MouseClick ( "left", 1015, 10, 1, 0 );close magic.exe Sleep ( 1000 ) Exit on the above, there will be times of "lag" or slow response, how can I make autoit know the buttons and selections are there and ready to be selected? Thank you all I have never killed a man, but I have read many obituaries with a smile.Arguing on the enternet is like running in the special olympics. Even if you win your still retarded.If I like it I will use it, if I dont it keeps me warm when I burn it. Link to comment Share on other sites More sharing options...
Zedna Posted January 12, 2007 Share Posted January 12, 2007 1) for click on button insteadMouseClick ( "left", 698, 411, 1, 0 );clicks launch buttonoÝ÷ Úëjëh×6ControlClick() ; --> info about ControlID get from AU3Info.exe2) For handle popup windows use AdlibEnable() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Casper2400 Posted January 13, 2007 Author Share Posted January 13, 2007 (edited) ControlClick() ; --> info about ControlID get from AU3Info.exe ??? With this game all of the "Control Under Mouse" items: Size, Control ID, ClassNameNN, Text are blank. NO information there. With AdlibEnable () for pop ups and errors I would need to know winactive... in this game all active windows are the same name. Edited January 13, 2007 by Casper2400 I have never killed a man, but I have read many obituaries with a smile.Arguing on the enternet is like running in the special olympics. Even if you win your still retarded.If I like it I will use it, if I dont it keeps me warm when I burn it. Link to comment Share on other sites More sharing options...
Casper2400 Posted January 13, 2007 Author Share Posted January 13, 2007 Here is what I have so far... I still cannot get any information on each ot the 3 windows that open (all have same name). If anyone here plays MTGO start magic.exe and you will see the 3 screens I am reffering to. If you know how or where to get the information for these windows so I can make wait itmes more accuate. Also all of the mousclicks are based on my screen and x,y coords.. if there is a way to know the buttons so if the server is slow to respond the scripts will wait till it actually does the requested action. I tried the windows info and all information is unchanged between windows and most is blank. Any help is appreciated. CODE Send ( "{PAUSE}" ) ProcessClose("AutoLogin.exe") MouseClick ( "left", 80, 35, 1, 5 ) ;clicks Main Window Tab Sleep ( 1000 ) MouseClick ( "left", 50, 421, 1, 10 ) ;clicks Log Off Button Sleep ( 1000 ) MouseClick ( "left", 500, 420, 1, 10 ) ;clicks "Check" (Yes log off) Button Sleep ( 2000 ) MouseClick ( "left", 1015, 10, 1, 0 ) ;close magic.exe Sleep ( 1000 ) ProcessClose("YatBot.exe") Run ( "C:\Program Files\Wizards of the Coast\Magic Online\magic.exe" ) ;start mtgo update WinWaitActive("Magic Online Install/Update Agent","", 20 ) MouseClick ( "left", 698, 411, 1, 0 ) ;clicks launch button WinWaitActive("Magic Online Install/Update Agent", "") Opt ("ColorMode", 0) ;0=RRGGBB color, 1=BBGGRR color ; Wait until something changes in the region 0,0 to 50,50 ; Get initial checksum $checksum = PixelChecksum (550,292, 550,292) ;left, top, right, bottom ; Wait for the region to change, the region is checked every 100ms to reduce CPU load While $checksum = PixelChecksum (550,292, 550,292) Sleep(100) WEnd If $checksum = ( "5696A1" ) Then Sleep(1000) ElseIf $checksum = ( "C8C8C8" ) Then EndIf MouseClick ( "left", 455, 622, 1, 0 ) ;clicks I agree button Sleep ( 1000 ) WinWaitActive("Magic Online V2.", "") Sleep ( 1000 ) WinSetState ( "Magic Online V2.", "", @SW_MAXIMIZE ) MouseClick ( "left", 422, 366, 1, 0 ) ;clicks inputs username Send ("USERNAME") Sleep ( 1000 ) MouseClick ( "left", 422, 417, 1, 0 ) ;clicks inputs password Send ("PASSWORD") Sleep ( 1000 ) MouseClick ( "left", 500, 450, 1, 0 ) ;clicks Log On button $checksum = PixelChecksum (570,410, 570,410) ;left, top, right, bottom While $checksum = PixelChecksum (570,410, 570,410) Sleep(100) WEnd If $checksum = ( "9593A5" ) Then Sleep(500) ElseIf $checksum = ( "D3D6D9" ) Then EndIf MouseClick ( "left", 339, 35, 1, 5 ) ;clicks Collection Tab Sleep ( 1000 ) MouseClick ( "left", 200, 330, 1, 5 ) ;clicks Reset Tab Sleep ( 1000 ) MouseClick ( "left", 245, 217, 1, 5 ) ;clicks Rarity Menu Sleep ( 1000 ) MouseClick ( "left", 150, 254, 1, 5 ) ;selects rarity "common" Sleep ( 1000 ) MouseClick ( "left", 245, 236, 1, 5 ) ;clicks Version Menu Sleep ( 1000 ) MouseClick ( "left", 150, 276, 1, 5 ) ;Selects Version "regular" Sleep ( 1000 ) MouseClick ( "right", 500, 80, 1, 5 ) ;Right clicks Top of Collection for trade menu Sleep ( 1000 ) MouseClick ( "left", 550, 115, 1, 5 ) ;Selects All Tradeable Sleep ( 1000 ) MouseClick ( "left", 200, 330, 1, 5 ) ;clicks Reset Tab Sleep ( 1000 ) MouseClick ( "left", 245, 130, 1, 5 ) ;clicks Cards to View Menu Sleep ( 1000 ) MouseClick ( "left", 150, 180, 1, 5 ) ;Select View "physical" Sleep ( 1000 ) MouseClick ( "right", 500, 80, 1, 5 ) ;Right clicks Top of Collection for trade menu Sleep ( 1000 ) MouseClick ( "left", 550, 130, 1, 5 ) ;Selects All UnTradeable Sleep ( 1000 ) MouseClick ( "left", 200, 330, 1, 5 ) ;clicks Reset Tab Sleep ( 1000 ) MouseClick ( "left", 80, 35, 1, 5 ) ;clicks Main Window Tab Sleep ( 1000 ) MouseClick ( "left", 50, 421, 1, 10 ) ;clicks Log Off Button Sleep ( 1000 ) MouseClick ( "left", 500, 420, 1, 10 ) ;clicks "Check" (Yes log off) Button Sleep ( 2000 ) MouseClick ( "left", 1015, 10, 1, 0 ) ;close magic.exe Sleep ( 2000 ) Run ( "C:\Program Files\YaTBoT\AutoLogin.exe" ) ;start autologin WinWaitActive("Auto Login Utiliy","", 20 ) MouseClick ( "left", 230, 390, 1, 0 ) ;sets text box position Send ("PASSWORD") MouseClick ( "left", 250, 450, 1, 0 ) ;sets text box position Exit I have never killed a man, but I have read many obituaries with a smile.Arguing on the enternet is like running in the special olympics. Even if you win your still retarded.If I like it I will use it, if I dont it keeps me warm when I burn it. 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