Casper2400 Posted January 14, 2007 Share Posted January 14, 2007 Ok here is my problem situation:I am trying to do a script to run an update on my MGTO game- Magic the gathering Online I can open the program no problem.The first screen opens and control under mouse is all blank, only way I can make it work is using mousclick and setting x,y coords... the problem is IF server is not reachable a popup happens saying "server unreachable try again?again this window has NO information in under mouse controles and window details does NOT change.Is there a way or a script to get the information I need?Please help. I have read 176 pages of sample scripts, 16 pages of au2 pages, over 500 pages of general help... in short I have been reading for over 26 hours now, Im frustrated, tired, and about to say autoit CANT do it as some people have said it can be done but didnt give any assistance to doing it. 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 14, 2007 Share Posted January 14, 2007 Post some screenshots. But generally in games there are possible these approaches: - OCR (Optical char recognition) - read info from memory (inside process of game) - there is Memory UDF - use PixelSearch/PixelCheckSum Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Kickassjoe Posted January 14, 2007 Share Posted January 14, 2007 I bet that not everyone in all of the reading you have done in the past 26 hours has just said "it can be done" and not even pointed the person they were helping in the right direction... (giving them links to ocrs, the memory udf, etc.) but anyways, search the "scripts and scraps" forum for "ocr", that should help you out, don't know much about the memory udf, but if you want to use pixelsearch or pixelchecksum, look in the help file. What goes around comes around... Payback's a bitch. Link to comment Share on other sites More sharing options...
Casper2400 Posted January 14, 2007 Author Share Posted January 14, 2007 (edited) Thanks zedna.here are some SS with info:This is the first screen (when program starts) as you can see under mouse controles is blank.Here I will click "launch" button easy with mouseclick coords BUT if server not avaialable a popup comes.After clicking "Launch" it will load the files needed (I want au3 to wait till this is finished) Notice the window name does not change.This shot is the 3rd screen EULA, here I will click "I Agree" button (after updates are loaded- time will vary week to week)After clicking I agree this screen comes out, this will download and update the game. again notice the name does not change. This can take anywhere from 2 mins to 1 hour depending on how large the update is and my conection speed at the time of update.This is the final screen before logging on. Now the name has changed but still NO information under mouse controles- ALSO here I will enter user name and password to log on... if no server or disconected another box pops up AND The name (top screen) changes each update. so the V2.... is different everytime it is run and updated.Thank you and hope you can help.Kickassjoe- pixel check would work and be nice IF the screen image changed. note the images above, the first 2 screens do not change.Where is "scripts and scrapts" or are you refering to example scripts? Edited January 14, 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...
Zedna Posted January 14, 2007 Share Posted January 14, 2007 You could use PixelCheckSum().Look here here here hereThere I recommended PixelCheckSum technique already Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 14, 2007 Moderators Share Posted January 14, 2007 (edited) I can't remember what version of AutoIt it was, but from that version on, the Developers being tired of seeing people make ludicrous game bots, and seeing the poor code that stemmed from it, had programmed AutoIt to make it harder for botters to script their scripts. Hiding all the Class ID's and ClassNameNN's to make it even harder for them to try and control their bots in an active "gaming" environment. The hope was that it would frustrate the bot "scripter" (can't call themselves programmers if AutoIt is all they (think) know) enough to leave the AutoIt Community. I'm sure if you delve into the world of C* that you will find exactly what you are looking for. Good Luck. Edit: Forgot to finish a sentence. Edited January 14, 2007 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...
Kickassjoe Posted January 14, 2007 Share Posted January 14, 2007 Do you not see the little grey box that pops up and has a % on it? Am I missing something, or is that a change in color? (between the first and second screen) Yea, forgot that the name changed to example scripts, must have been a brainfart. What goes around comes around... Payback's a bitch. Link to comment Share on other sites More sharing options...
xcal Posted January 14, 2007 Share Posted January 14, 2007 Do me a favor and change your avatar image? How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Casper2400 Posted January 14, 2007 Author Share Posted January 14, 2007 Thanks guys I tested it and tried many different approaches.. CODERun ( "C:\Program Files\Wizards of the Coast\Magic Online\magic.exe" ) ;start mtgo update WinWaitActive("Magic Online Install/Update Agent", "") Sleep ( 1000 ) ;had to add this as autoit is not waiting for the window to be active MouseClick ( "left", 698, 411, 1, 0 ) ;clicks launch button WinWaitActive("Magic Online Install/Update Agent", "") Opt ("ColorMode", 0) ;0=RRGGBB color, 1=BBGGRR color $checksum = PixelChecksum (550, 292, 550, 292 ) ;left, top, right, bottom While $checksum = PixelChecksum ( 550, 292, 550, 292 ) Sleep(100) WEnd If $checksum = ( "60656E" ) Then MouseClick ( "left", 547, 441, 1, 0 ) ElseIf $checksum = ( "C8C8C8" ) Then EndIf This runs the prog no problem. I had to add a sleep because its not waiting for the window to be active. It clicks the launch button (I disabled my connection to get the error pop up box) and the mouse just sits there doing nothing. If the box comes up (which IS a color change) I want it to click the "try again" button. If the box DONT come up (meaning it went through, the color will again change and here it will click the "I agree" button as seen above. However it is not seeing the color change from "launch" to "server offline" Is my code wrong? Thanks. 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 14, 2007 Share Posted January 14, 2007 PixelCheckSum don't return color! Use PixelSearch for that purpose. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Casper2400 Posted January 14, 2007 Author Share Posted January 14, 2007 (edited) Chaanged to:Opt ("ColorMode", 0) ;0=RRGGBB color, 1=BBGGRR color$coord = PixelSearch ( 550, 292, 550, 292, 0x5696A1 ) If $coord = ( "5696A1" ) Then sleep (200) ElseIf $coord = ( "60656E" ) Then MouseClick ( "left", 547, 441, 1, 0 ) ElseIf $coord = ( "C8C8C8" ) Then EndIfStill getting same results. mouse just sits there and does nothing. Edited January 14, 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...
59FIFTY Posted January 14, 2007 Share Posted January 14, 2007 I can't remember what version of AutoIt it was, but from that version on, the Developers being tired of seeing people make ludicrous game bots, and seeing the poor code that stemmed from it, had programmed AutoIt to make it harder for botters to script their scripts. Hiding all the Class ID's and ClassNameNN's to make it even harder for them to try and control their bots in an active "gaming" environment. The hope was that it would frustrate the bot "scripter" (can't call themselves programmers if AutoIt is all they (think) know) enough to leave the AutoIt Community. I'm sure if you delve into the world of C* that you will find exactly what you are looking for. Good Luck.Edit:Forgot to finish a sentence.It's still easy as hell to make a bot for a program or game if you have programming experience in any language, to make it work on autoscript.@Casper2400I recommend you use to check some pixels by using PixelGetColor, or search for a group of pixel (I.e. the ok button on the last screenshot) Link to comment Share on other sites More sharing options...
Casper2400 Posted January 14, 2007 Author Share Posted January 14, 2007 I tried the checksome and was told it wont work.I tried the pixelsearch and its not seeing the pixel change.I actually did some messing around and got this:Do PixelSearch ( 550, 292, 550, 292, 0x5696A1 ) If Not @error Then EndIf PixelSearch ( 550, 292, 550, 292, 0x6065E ) MouseClick ( "left", 700, 560, 1, 0 )Until PixelSearch ( 550, 292, 550, 292, 0xC8C8C8 )However NOW the "until" expression dont work.I got it to continue clicking the button BUT when the server does connect, the pixel changes to 0xC8C8C8 and autoit is still clicking the button.So I am getting closer. but NOW the until statement is wrong and I am trying to figure it out. 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 14, 2007 Author Share Posted January 14, 2007 Now I have tested this: $coord = PixelGetColor ( 700, 410 ) If $coord = ( "16777215" ) Then sleep (100) ElseIf $coord = ( "6318446" ) Then Do MouseClick ( "left", 700, 560, 1, 0 ) Until $coord = ( "6055278" ) ElseIf $coord = ( "6055278" ) Then EndIf and it clicks button (when I pause and turn enternet on) it clicks again when screen changes it is still clicking??? I want it to stop the loop if the coord is true. 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...
Valuater Posted January 14, 2007 Share Posted January 14, 2007 Move "Do" to the top of your script 8) Link to comment Share on other sites More sharing options...
Casper2400 Posted January 14, 2007 Author Share Posted January 14, 2007 Here is what I have thus far... thanks to all of you so far for the help. CODEOpt ("ColorMode", 0) ;0=RRGGBB color, 1=BBGGRR color Do $coord = PixelGetColor ( 700, 410 ) If $coord = ( "16777215" ) Then sleep (100) ElseIf $coord = ( "6318446" ) Then MouseClick ( "left", 700, 560, 1, 0 ) ElseIf $coord = ( "5594727" ) Then MouseClick ( "left", 600 , 490, 1, 0 ) EndIf Until $coord = ( "6055278" ) MouseClick ( "left", 460, 420, 1, 0 ) ;clicks I agree button Now... If it loses connection it knows to click a button, if server is down it knows to click a button and repeats this process. when it gets to screen image3 it should mouseclick but its not. just idles. Am I missing something, is the loop still waiting for color change? Thanks 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 14, 2007 Author Share Posted January 14, 2007 Thank you so much guys. Here is what I have now: CODE; Script Start - Add your code below here Global $Paused HotKeySet("{PAUSE}", "TogglePause") ; pauses the program, click again to unpause. Func TogglePause() $Paused = Not $Paused While $Paused Sleep(2000) WEnd EndFunc ;==>TogglePause Run ( "C:\Program Files\Wizards of the Coast\Magic Online\magic.exe" ) ;start mtgo update Sleep ( 1000 ) ;had to add this as autoit is not waiting for the window to be active WinSetState ( "Magic Online Install/Update Agent", "", @SW_MAXIMIZE ) MouseClick ( "left", 550, 290, 1, 0 ) ;clicks launch button Opt ("ColorMode", 0) ;0=RRGGBB color, 1=BBGGRR color Do $coord = PixelGetColor ( 550, 290 ) If $coord = ( "4557205" ) Then ; Launch Button color sleep (100) ElseIf $coord = ( "16777215" ) Then ; could not resolve server error MouseClick ( "left", 540, 440, 1, 0 ) ElseIf $coord = ( "5133148" ) Then MouseClick ( "left", 450 , 370, 1, 0 ) ; lost connection to server error ElseIf $coord = ( "13158600" ) Then EndIf Until $coord = ( "13158600" ) MouseClick ( "left", 300, 500, 1, 0 ) ; I agree button Do $coord = PixelGetColor ( 550, 290 ) If $coord = ( "5133148" ) Then MouseClick ( "left", 450 , 370, 1, 0 ) ;lost connection error EndIf Until WinActive ( "Magic Online V2." ) WinSetState ( "Magic Online V2.", "", @SW_MAXIMIZE ) ;maximize screen Sleep ( 500 ) Send ( "USERNAME" ) ;enter username MouseClick ( "left", 500, 420, 1, 0 ) ; sets mouse to password Sleep ( 500 ) Send ( "PASSWORD" ) ;enter password Sleep ( 500 ) Which works great, if no connection OR lose connection it knows to fgind the buttons and move on. However this next part of the code is not working (and it should basically be the same as above: CODEMouseClick ( "left", 500, 450, 1, 0 ) ;log on button Do $coord = PixelGetColor ( 560, 415 ) If $coord = ( "7240324" ) Then ; Cannot establish a connection MouseClick ( "left", 620, 460, 1, 0 ) Then ;try again MouseClick ( "left", 500, 450, 1, 0 ) ;log on button ElseIf $coord = ( "2632497" ) Then ;lost connection to the server MouseClick ( "left", 600, 420, 1, 0 ) Then ; try again MouseClick ( "left", 500, 450, 1, 0 ) ;log on button EndIf Until $coord = ( "14671840" ) When I disconnect my enternet to force a server connection error, it does nothing... Can you see a problem in the code? 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 14, 2007 Author Share Posted January 14, 2007 ha ha ha, turned out my coords were off. I did a small snipet from the help file to pop up a box to tell the actual dec. code for the point. Thanks a lot all of you for the great help. I have it working (enough to get me by) while I am away. 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