LxP Posted July 31, 2005 Share Posted July 31, 2005 One small potential issue with your code, Ron: $actionField = 461808 What does the number signify here? It looks like a handle to me and if it is, it won't work for Barry. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 31, 2005 Moderators Share Posted July 31, 2005 A few more post on this one LxP and we will both be at 300 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...
Moderators SmOke_N Posted July 31, 2005 Moderators Share Posted July 31, 2005 It's the Control ID of the box, it will work. 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...
drbarry920 Posted July 31, 2005 Author Share Posted July 31, 2005 (edited) Press CTRL-ALT-F to pause the display.>>>>>>>>>>>> Window Details <<<<<<<<<<<<<Title: Watching: Play money 873517 - Hold'em - 5/10. Good Luck @@partyClass: WindowsForms10.window.8.app3Size: X: 46 Y: 568 W: 696 H: 167>>>>>>>>>>> Mouse Details <<<<<<<<<<<Window: X: 130 Y: -201Cursor ID: 5>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<RGB: Hex: 0xECE9D8 Dec: 15526360>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<Size:Control ID:ClassNameNN:Text:>>>>>>>>>>> Status Bar Text <<<<<<<<<<<>>>>>>>>>>> Visible Window Text <<<<<<<<<<<Pot Size to justify call:AQ6K8(Straight:1.7%, Two Pairs:1%, others:.7%)3.4%Chance to Win:1.17%Hand Rank:High Card AcePocket Rank: 112 / 169My Pos: 4/7, MIDBet Cost:Players Left: 6Check <<<----(THIS IS WHAT I WANT IT TO READ)>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<T7on boardCAUTION! Possible STR8FULLFLUSH Edited July 31, 2005 by drbarry920 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 31, 2005 Moderators Share Posted July 31, 2005 (Straight:1.7%, Two Pairs:1%, others:.7%)3.4%Chance to Win:1.17%Hand Rank:High Card AcePocket Rank: 112 / 169My Pos: 4/7, MIDBet Cost:Players Left: 6Check <<<----(THIS IS WHAT I WANT IT TO READ)>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<Size: X: 488  Y: 40  W: 88  H: 48Control ID: 461808ClassNameNN: WindowsForms10.STATIC.app34Text: Fold   <<<< Actually that's what you want to readStyle: 0x5600000DExStyle: 0x00000000 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...
drbarry920 Posted July 31, 2005 Author Share Posted July 31, 2005 At the tim I viewed the window info screen the suggested action was CHECK Link to comment Share on other sites More sharing options...
LxP Posted July 31, 2005 Share Posted July 31, 2005 A few more post on this one LxP and we will both be at 300 You betcha! It's the Control ID of the box, it will work.My mistake; I wasn't aware of control IDs in numeric form.Barry, does Ron's latest script work for you? If not, could you please do what you just did again but this time placing the mouse over the area that serves your suggestion, and posting the 'Control Under Mouse' result? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 31, 2005 Moderators Share Posted July 31, 2005 P.S. --- you need to edit the top of you post... You have you username for Party Poker up there!! 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...
drbarry920 Posted July 31, 2005 Author Share Posted July 31, 2005 Ron's code didn't work. COntrol uner Mouse was: Size: X 464 Y 96 W 80 H 32 Control ID: 2163556 ClassNameNN: WIndowsForms10.STATIC.app327 Text: Bet Link to comment Share on other sites More sharing options...
drbarry920 Posted July 31, 2005 Author Share Posted July 31, 2005 Thanx I edited the message and deleted the screen shot cause it was on there too. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 31, 2005 Moderators Share Posted July 31, 2005 change the control id then: From: 461808 To: 2163556 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...
drbarry920 Posted July 31, 2005 Author Share Posted July 31, 2005 Same response...not pushing buttons and the message is bouncing back and forth between "Fold is visible; attempting to read from Brain in a moment." & "Brain Returns" Link to comment Share on other sites More sharing options...
drbarry920 Posted July 31, 2005 Author Share Posted July 31, 2005 Here's current text: Opt("WinTitleMatchMode", 4) ; Window names $pokerWindow = "Play money 873517" $brainWindow = "classname=WindowsForms10.window.8.app3" ; Poker button control IDs $foldButton = "AfxWnd42s14" $checkButton = "AfxWnd42s15" $callButton = "AfxWnd42s15" $betButton = "AfxWnd42s16" $raiseButton = "AfxWnd42s16" ; No Hands action suggestion field $actionField = 2163556 ; Wait for the two windows to be displayed WinWait($pokerWindow) WinWait($brainWindow) MsgBox(64, "AutoIt", "Both windows now exist; starting loop") while (WinExists($pokerWindow) And WinExists($brainWindow)) Sleep(300) $foldVisible = ControlCommand($pokerWindow, "", $foldButton, "IsVisible", "") $raiseVisible = ControlCommand($pokerWindow, "", $raiseButton, "IsVisible", "") if ($foldVisible = 1) Then MsgBox(64, "AutoIt", "Fold is visible; attempting to read from brain in a moment") Sleep(Random(1500, 2500)) $action = ControlGetText($brainWindow, "", $actionField) MsgBox(64, "AutoIt", "Brain returns:" & @CRLF & $action) If $action = "Fold" Then ControlClick($pokerWindow, "", $foldButton) If $action = "Check" Then ControlClick($pokerWindow, "", $checkButton) If $action = "Bet" Then ControlClick($pokerWindow, "", $betButton) If $action = "Raise" Then ControlClick($pokerWindow, "", $raiseButton) If $action = "Call" Then ControlClick($pokerWindow, "", $callButton) EndIf WEnd Link to comment Share on other sites More sharing options...
LxP Posted July 31, 2005 Share Posted July 31, 2005 Is it possible that the details of this control are changing across runs of the program? In your initial script you addressed it as WindowsForm10.STATIC.app314 but in your last post it was masquerading as WIndowsForms10.STATIC.app327.Are you absolutely positive that you had your mouse over the correct control and not one nearby? Try moving the mouse cursor across all areas of the suggestion control and see if the details in 'Control Under Mouse' change. If they don't then could you please press Ctrl+Alt+F to freeze AutoIt Window Info and then copy that part of the information to e.g. Notepad?Then please try fully shutting down your Poker software, loading the boxes again and repeating the above procedure. Are there differences in the values shown by AutoIt Window Info for that control? Link to comment Share on other sites More sharing options...
drbarry920 Posted July 31, 2005 Author Share Posted July 31, 2005 It Changed. It was the same throughout the box each time though. What do you think that means and what can I do about it? 1st Test: >>>>>>>>>>> Control Under Mouse <<<<<<<<<<< Size: X: 464 Y: 96 W: 80 H: 32 Control ID: 2163556 ClassNameNN: WindowsForms10.STATIC.app327 Text: New Poker window: >>>>>>>>>>> Control Under Mouse <<<<<<<<<<< Size: X: 464 Y: 96 W: 80 H: 32 Control ID: 1770426 ClassNameNN: WindowsForms10.STATIC.app317 Text: Fold Link to comment Share on other sites More sharing options...
LxP Posted July 31, 2005 Share Posted July 31, 2005 I think it means that someone's trying to make it hard for you to read the value! The position and size of the control however is constant across sessions. Maybe we can rely on that to get the information related to it. What we need to do then is adjust this line so that it works: $actionField = _controlGetIDByPos($brainWindow, "", 464, 96, 80, 32) $action = controlGetText($brainWindow, "", $actionField) The problem here of course is that there isn't such a function (or at least it isn't obvious in the help file). This leaves the option of looping through each and every control in the window for the one that matches the required coordinates. I'll take a look at the help file to see if that's easily done. Link to comment Share on other sites More sharing options...
drbarry920 Posted July 31, 2005 Author Share Posted July 31, 2005 When I copied that line in I got an unknown function error Link to comment Share on other sites More sharing options...
LxP Posted July 31, 2005 Share Posted July 31, 2005 (edited) This script will generate a ClassList.txt file on your desktop. Could you please run the script and attach ClassList.txt to a post? --opt("winTitleMatchMode", 4) local $outputFile = @desktopDir & "\ClassList.txt" fileDelete($outputFile) fileWrite($outputFile, stringReplace(winGetClassList("classname=WindowsForms10.window.8.app3"), @LF, @CRLF))Edit: left a stupid test class name in the code. Edited July 31, 2005 by LxP Link to comment Share on other sites More sharing options...
drbarry920 Posted July 31, 2005 Author Share Posted July 31, 2005 Here is the classlist.txtClassList.txt Link to comment Share on other sites More sharing options...
LxP Posted July 31, 2005 Share Posted July 31, 2005 D'oh -- I made a mistake in the code. Could you please repeat those steps with the amended code above? Sorry for the added hassle. Link to comment Share on other sites More sharing options...
Recommended Posts