buymeapc Posted November 9, 2005 Share Posted November 9, 2005 (edited) This is what I have so far: I am using keyboard commands instead of mouse commands because if the window is moved to another location, the mouse command won't click on the desired locations. I would prefer to use mouse commands instead, but I don't really know how to make it find specific text/buttons in the Steam window. Opt("TrayIconHide", 1) ; Hide the tray icon Run("C:\Games\Steam\Steam.exe") ; Start Steam Do $title = WinGetTitle("") MsgBox(0, "Active", $title) Until $title = "STEAM " WinWaitActive("STEAM") ; Wait until the main Steam window is active Sleep(3000) If WinActive("Valve Hardware Survey") Then ; Check to see if the hardware survey is open MouseClick("left", 464, 527) MouseClick("left", 713, 678) EndIf Sleep(2000) WinActivate("STEAM") ; Set the main Steam window as active If WinActive("STEAM") Then Send("{TAB} & {RIGHT} & {SPACE}") Sleep(1000) Send("{TAB} & {HOME}") $text = WinGetText("STEAM", "") MsgBox(0, "Text read was:", $text) ; Attempts to display what is active (for testing only-not for desired results) EndIf Sleep(2000) If WinActive("Video Driver Outdated") Then ; Outdated video driver may appear - this will tell it not to check anymore MouseClick("left", 401, 640) ; Check "Don't show this again" MouseClick("left", 680, 635) ; Click Next EndIf This code is not finished, by the way. Is there possibly an easier way than what I am attempting? Edited November 9, 2005 by buymeapc Link to comment Share on other sites More sharing options...
Valuater Posted November 9, 2005 Share Posted November 9, 2005 i noticed your other post regarding moving this window... more importantly if you use this opt("MouseCoordMode", 0) ;1=absolute, 0=relative, 2=client it wont matter where the window is... just as long as it IS the active window 8) Link to comment Share on other sites More sharing options...
hankjrfan Posted November 9, 2005 Share Posted November 9, 2005 Just out of curiousity mind if I ask what Steam is? Link to comment Share on other sites More sharing options...
buymeapc Posted November 9, 2005 Author Share Posted November 9, 2005 @hankjrfan: Steam is an application which enables you to play Half Life games. @Valuater: I'm not sure I understand... Link to comment Share on other sites More sharing options...
fly Posted November 9, 2005 Share Posted November 9, 2005 Totally unrelated to the topic, but can I ask why you have 1,000 Steam clients? Some kind of massive LAN party? Link to comment Share on other sites More sharing options...
ChrisL Posted November 9, 2005 Share Posted November 9, 2005 Totally unrelated to the topic, but can I ask why you have 1,000 Steam clients? Some kind of massive LAN party?lol.. bring a node [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
buymeapc Posted November 9, 2005 Author Share Posted November 9, 2005 No, I am in charge of updating/configuring over 70 cyber cafe's. Link to comment Share on other sites More sharing options...
jackyyll Posted November 9, 2005 Share Posted November 9, 2005 i noticed your other post regarding moving this window...more importantly if you use thisopt("MouseCoordMode", 0) ;1=absolute, 0=relative, 2=clientit wont matter where the window is... just as long as it IS the active window8)@hankjrfan: Steam is an application which enables you to play Half Life games.@Valuater: I'm not sure I understand...What he means is,1= mouse clicks coords relative to the ENTIRE windows screen0= mouse clicks only coords relative to your steam window, meaning if you move your steam around the window, it will still click where its suposed to2= not quite sure what this one does Link to comment Share on other sites More sharing options...
jefhal Posted November 9, 2005 Share Posted November 9, 2005 I am using keyboard commands instead of mouse commands because if the window is moved to another location, the mouse command won't click on the desired locations.You can also use the following code to get the exact location of the button you want even if it is in a different location each time:$realsize = WinGetPos("MyTargetDialogBox") MouseClick("Left",$realsize[0]+63,$realsize[1]+309); click on the buttonWhere: 63 and 309 are the x and y coordinates of the button you want to press on the dialog box in question. You find these values by turning on AutoITInfo and moving the dialog box to the top left corner of your screen and then getting the x/y of the button. This also assumes that the name of your dialog box is "MyTargetDialogBox". ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format Link to comment Share on other sites More sharing options...
buymeapc Posted November 10, 2005 Author Share Posted November 10, 2005 (edited) Wow, thanks for that great tips! So far so good, now. Now, I'm trying to figure out how to click on each game in the list without going past the last game in the list. Edited November 10, 2005 by buymeapc Link to comment Share on other sites More sharing options...
Valuater Posted November 10, 2005 Share Posted November 10, 2005 ? i dont understand 8) Link to comment Share on other sites More sharing options...
buymeapc Posted November 10, 2005 Author Share Posted November 10, 2005 Say the list has three games in it: Counter Strike: Source Half Life 2 Half Life 2: Deathmatch I want to be able to have the mouse click on each listed title (one of the above three), launch it, close it, and move on to the next game listed to do the same thing. But, there is a catch.....Not all of these computers have only three titles. A lot have somewhere around eight titles listed. Basically, I need the mouse to be smart and only click on the games in the list and realize when there are no more games in the list and stop the process. I hope I've clarified it.... Link to comment Share on other sites More sharing options...
Valuater Posted November 10, 2005 Share Posted November 10, 2005 ; that clarified the question... thank you ;ok... this is just an idea because i don't understand everything ; so... how about checking to see if the game exists on the computer if not FileExists(@ProgramFilesDir & "\Halflfe\halflife.exe") then ;mouse click the next position ; run... install.. bla bla EndIf 8) Link to comment Share on other sites More sharing options...
buymeapc Posted November 10, 2005 Author Share Posted November 10, 2005 Unfortunately, it's not that easy (I think). Each PC has its own unique user ID for Steam. So each PC's path to the game files will be different. ex.: PC1: C:\Games\Steam\SteamApps\User1\.... PC2: C:\Games\Steam\SteamApps\User2\.... PC3: C:\Games\Steam\SteamApps\User3\.... and so on... Link to comment Share on other sites More sharing options...
Valuater Posted November 10, 2005 Share Posted November 10, 2005 (edited) ok just a little more complicated but this works $_File = "Halflife.exe" RunWait(@ComSpec & ' /c ' & 'dir "' & "C:\Games\Steam\SteamApps\" & $_File & '" /a :h /b /s' & ' > "' & @TempDir & '\dir.txt"', '', @SW_HIDE) Sleep(2000) $hFile = FileOpen(@TempDir & "\dir.txt", 0) ; Check if file opened for reading OK If $hFile = -1 Then MsgBox(0, "Error", "Unable to open file.") EndIf $sLine = FileReadLine($hFile) If not FileExists($sline) then ;mouse click the next position ; run... install.. bla bla EndIf ; for testing MsgBox(0,"test", $sLine ) 8) Edited November 10, 2005 by Valuater Link to comment Share on other sites More sharing options...
buymeapc Posted November 10, 2005 Author Share Posted November 10, 2005 (edited) Woah, I'm sorry, but that is complicated... Ummm...please clarify. Edited November 10, 2005 by buymeapc Link to comment Share on other sites More sharing options...
Valuater Posted November 10, 2005 Share Posted November 10, 2005 (edited) updated for half life... sorry it should work for YOU now 8) Edited November 10, 2005 by Valuater Link to comment Share on other sites More sharing options...
buymeapc Posted November 10, 2005 Author Share Posted November 10, 2005 (edited) Thanks....how does it know what the next folder is after C:\Games\Steam\SteamApps\ Also can $_File be a directory? Edited November 10, 2005 by buymeapc Link to comment Share on other sites More sharing options...
Valuater Posted November 10, 2005 Share Posted November 10, 2005 Thanks....how does it know what the next folder is after C:\Games\Steam\SteamApps\Also can $_File be a directory?it searches all of the sub-directories of C:\Games\Steam\SteamApps\ for that file ( $_File )i have never used it for a directorydid it work?????(finding the file)8) Link to comment Share on other sites More sharing options...
buymeapc Posted November 10, 2005 Author Share Posted November 10, 2005 (edited) I'm not sure...The message box at the end does not have any output in it.Here's the code I used:$_File = "hl2.exe" RunWait(@ComSpec & ' /c ' & 'dir "' & "C:\Games\Steam\SteamApps\" & $_File & '" /a :h /b /s' & ' > "' & @TempDir & '\dir.txt"', '', @SW_HIDE) Sleep(2000) $hFile = FileOpen(@TempDir & "\dir.txt", 0) ; Check if file opened for reading OK If $hFile = -1 Then MsgBox(0, "Error", "Unable to open file.") EndIf $sLine = FileReadLine($hFile) If not FileExists($sline) then MsgBox(0, "Box", "$sline not found") EndIf ; for testing MsgBox(0,"test", $sLine )EDIT: My mistake, it found the file and output the path to the message box at the end. Awesome code! I will play with this a bit further. Thank you so much for your help, so far! Edited November 10, 2005 by buymeapc 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