|
#1
|
|||
|
|||
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 /> |
#2
|
|||
|
|||
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)
|
#3
|
|||
|
|||
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. |
#4
|
|||
|
|||
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 :] |
#5
|
|||
|
|||
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} |
#6
|
|||
|
|||
Re: AHK Problem/Opening Tables
ControlGet, var, list, focused (or selected or something)
|
#7
|
|||
|
|||
Re: AHK Problem/Opening Tables
[ QUOTE ]
ControlGet, var, list, focused (or selected or something) [/ QUOTE ] Excellent, thanks. |
|
|