Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Internet Gambling > Software
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-06-2007, 11:52 AM
Sciolist Sciolist is offline
Senior Member
 
Join Date: Jun 2005
Location: London
Posts: 4,135
Default AHK Coding Problem/Opening Tables on Party

As a few of you use AHK a lot, I thought I'd have some luck asking here, as it's a Party-specific problem, rather than one related to AHK. I think.

I have four strings containing the names of tables on Party. For example, the contents of table_name1 might be "Table 126640". I now want to open these four tables. The problem is that it'll open the first, immediately go back to the lobby, open the second, go back, etc. This then quite often leaves it only opening one or two of the tables. If I have no lag and if my PC is doing nothing else, it's fine.

How do I get AHK to not go to the next step in the loop until the table is open? I have close to zero experience with AHK.

<font class="small">Code:</font><hr /><pre> array_count = 0 ; Reset array to zero (it starts at 1)
Loop, 4 ; Do all of this four times
{
array_count++

ControlFocus, SysListView321, ahk_id%lobby_id%
ControlGet, focused, List, Count Focused, SysListView321, ahk_id%lobby_id%
ControlGet, table_count, List, Count, SysListView321, ahk_id%lobby_id%

Loop, %focused% ; Go to top of the table list
ControlSend, SysListView321, {UP}, ahk_id%lobby_id%


Loop, %table_count% ; Go down list, search for table, if you find it, open it
{
ControlGet, name, List, Focused Col1, SysListView321, ahk_id%lobby_id%
test := name = table_name%array_count%

if test = 1
ControlSend, SysListView321, {Enter}, ahk_id%lobby_id%

if test = 0
ControlSend, SysListView321, {DOWN}, ahk_id%lobby_id%
}
}</pre><hr />
Reply With Quote
  #2  
Old 01-06-2007, 11:55 AM
Sciolist Sciolist is offline
Senior Member
 
Join Date: Jun 2005
Location: London
Posts: 4,135
Default Re: AHK Problem/Opening Tables

I tried using Sleep, but it didn't work for some reason and it's not exactly the most elegent of solutions (though as you can tell, I am not a master of elegance anyway)
Reply With Quote
  #3  
Old 01-06-2007, 12:15 PM
Roland Roland is offline
Senior Member
 
Join Date: Mar 2005
Location: Norwich, UK
Posts: 2,703
Default Re: AHK Problem/Opening Tables

Just send the table name instead:

SendRaw %table_name%

or something.
Then check if you got there and open it.
Reply With Quote
  #4  
Old 01-06-2007, 12:58 PM
Sciolist Sciolist is offline
Senior Member
 
Join Date: Jun 2005
Location: London
Posts: 4,135
Default Re: AHK Problem/Opening Tables

[ QUOTE ]
Just send the table name instead:

SendRaw %table_name%

or something.
Then check if you got there and open it.

[/ QUOTE ]
Thanks, I didn't even know that command existed :]
Reply With Quote
  #5  
Old 01-06-2007, 01:02 PM
Sciolist Sciolist is offline
Senior Member
 
Join Date: Jun 2005
Location: London
Posts: 4,135
Default Re: AHK Problem/Opening Tables

[ QUOTE ]
Just send the table name instead:

SendRaw %table_name%

or something.
Then check if you got there and open it.

[/ QUOTE ]
Is there a way to see which table I just opened? I know how to check to see if the table I want open is open yet, but the probelm is that if %table_name1% isn't on the list anymore (which is possible), it'll open the wrong table when I send {Enter}
Reply With Quote
  #6  
Old 01-06-2007, 01:02 PM
Roland Roland is offline
Senior Member
 
Join Date: Mar 2005
Location: Norwich, UK
Posts: 2,703
Default Re: AHK Problem/Opening Tables

ControlGet, var, list, focused (or selected or something)
Reply With Quote
  #7  
Old 01-06-2007, 01:04 PM
Sciolist Sciolist is offline
Senior Member
 
Join Date: Jun 2005
Location: London
Posts: 4,135
Default Re: AHK Problem/Opening Tables

[ QUOTE ]
ControlGet, var, list, focused (or selected or something)

[/ QUOTE ]
Excellent, thanks.
Reply With Quote
  #8  
Old 01-06-2007, 06:48 PM
_dave_ _dave_ is offline
Senior Member
 
Join Date: Feb 2005
Location: UK
Posts: 2,628
Default Re: AHK Problem/Opening Tables

Sciolist,

What is your script aiming to do? Does SafeMine not already do what (I guess) you are attempting?

Prolly worth a look through the code for that anyway - it deos plenty of dealing with the Party lobby / opening + closing tables.

dave.
Reply With Quote
  #9  
Old 01-06-2007, 06:55 PM
Sciolist Sciolist is offline
Senior Member
 
Join Date: Jun 2005
Location: London
Posts: 4,135
Default Re: AHK Problem/Opening Tables

[ QUOTE ]
Sciolist,

What is your script aiming to do? Does SafeMine not already do what (I guess) you are attempting?

Prolly worth a look through the code for that anyway - it deos plenty of dealing with the Party lobby / opening + closing tables.

dave.

[/ QUOTE ]
I've been looking at the old iwitness code a bit, as you can probably tell, I'll go look for SafeMine too.
Reply With Quote
  #10  
Old 01-06-2007, 08:00 PM
Sciolist Sciolist is offline
Senior Member
 
Join Date: Jun 2005
Location: London
Posts: 4,135
Default Re: AHK Problem/Opening Tables

OK, now I am unable to get it to put focus back in the lobby for some reason. The first table opens fine, but then the second SendRaw doesn't do anything (it doesn't send, as far as I can see, or if it does, it sends somewhere else). Am I putting focus on the lobby in the wrong way?

table_name1 to 4 have the data in correctly.

<font class="small">Code:</font><hr /><pre>
array_count = 0
array_count++ ; Just doing it this way for test, will be loop

ControlFocus, SysListView321, ahk_id%lobby_id%
SendRaw, % table_name%array_count%

ControlGet, name, List, Focused Col1, SysListView321, ahk_id%lobby_id%

If (name = table_name%array_count%)
{
ControlSend, SysListView321, {Enter}, ahk_id%lobby_id%

Loop
{
IfWinExist, % table_name%array_count%
{
break
}
}
}



array_count++ ; Back to start of "loop"
ControlFocus, SysListView321, ahk_id%lobby_id%
SendRaw, % table_name%array_count% ; Nothing happens?
</pre><hr />
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:28 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.