Moderators SmOke_N Posted July 31, 2005 Moderators Share Posted July 31, 2005 No he will have to manually put that in every time. You could just do: $pokerWindow = InputBox("Input Room Title", "Poker Room Name", "", "", 100, 80) Because it will change every time. 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 (edited) Oh, I tried it, but I don't know what "Sit Out" is. That's not in the title of anything I have. Just let him enter it in manually each time. The input box should make it simple for him. By the way: Most of your "Local" constants should be "Globals", he'll keep running into errors with out them. Edited July 31, 2005 by ronsrules 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 Ok, got a 500 mile round trip fiasco to do now. Good luck to you barry. Way to stick in there LxP, nice to see someone that takes the challenge by the 'ahem'! 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...
LxP Posted July 31, 2005 Share Posted July 31, 2005 'Sit Out' appears on the Poker window as hidden text.Local variables are fine in this instance because the only variable that the function wants to access is $brainWindow, which is passed as a parameter anyway. Link to comment Share on other sites More sharing options...
drbarry920 Posted July 31, 2005 Author Share Posted July 31, 2005 Funny....I change "Sit Out" to "Hold'em" and now it is detecting the windows (according to msgs) but it is not interacting with the poker site correctly anymore. Strange. Attached is current text file.poker.txt Link to comment Share on other sites More sharing options...
LxP Posted August 1, 2005 Share Posted August 1, 2005 Modified my code once more to detect the windows properly. <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
drbarry920 Posted August 1, 2005 Author Share Posted August 1, 2005 Solution created. Attached is the txt script to automatically play on Party Poker using suggestions from the program No Hands Holdem. Enjoy!poker.txt Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 1, 2005 Moderators Share Posted August 1, 2005 Good Job LxP!!Quick question?func _action($brainWindow) local $counter = 1 while ($counter <= 100) local $id = "WindowsForms10.STATIC.app3" & $counter local $pos = controlGetPos($brainWindow, "", $id) if (isArray($pos) and $pos[0] = 464 and $pos[1] = 96 and $pos[2] = 80 and $pos[3] = 32) then _ return controlGetText($brainWindow, "", $id) $counter = $counter + 1 wEnd return "" endFuncSomething tells me that this "WindowsForms10.STATIC.app3" eventually will be a "WindowsForms10.STATIC.app4 or 5" and so on, should there be an extra variable just incase 100 is reached to step one more? If so..... Should you put at least a Sleep(55) or Sleep(100) in there, just in case? 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...
LxP Posted August 1, 2005 Share Posted August 1, 2005 I'll pray to the Poker gods every night this week that the 3 in that control ID doesn't change -- it should be safe though because the 3 is part of the controls' class name as verified by WinGetClassList().I set the loop to stop on 100 because there are no more than 100 controls on the window and if for some reason the counter does actually reach it, something has gone wrong and it won't find the control anyway.As a result of this thread I'm working on a UDF that will find any control (regardless of class name) according to size and/or position in the window -- this will then be a non-issue. Link to comment Share on other sites More sharing options...
Administrators Jon Posted August 1, 2005 Administrators Share Posted August 1, 2005 OP requested close. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
Recommended Posts