Two Plus Two Newer Archives

Two Plus Two Newer Archives (http://archives1.twoplustwo.com/index.php)
-   Software (http://archives1.twoplustwo.com/forumdisplay.php?f=47)
-   -   iWitness (http://archives1.twoplustwo.com/showthread.php?t=41883)

Roland 02-20-2006 05:20 PM

iWitness
 
Okay, it seems to work (after almost crashing my computer when I got something wrong and it endlessly closed and re-opened all the tables [img]/images/graemlins/smile.gif[/img]). Wouldn't surprise me if there are a ton of bugs though (I told Sam he could optimize it [img]/images/graemlins/tongue.gif[/img]).

#Persistent
SetTitleMatchMode, 2 ;____i forget why I used this, but don't want to break anything [img]/images/graemlins/smile.gif[/img]
WinGet, lobby_id, ID, PartyPoker.com
GroupAdd, tables, Good Luck ahk_class #32770 ;____used to minimize all the tables later

game_type = full ;_____change this to "6max" if you want mine 6max

;_____chnage these to whatever you want:
players_min_6max = 5
players_min_full = 10
players_max_6max = 6
players_max_full = 10

Gosub, OpenTables ;_____open the 10 tables
SetTimer, CheckTables, 30000 ;______I figured it makes more sense to wait if somebody takes an open seat or whatever, thus 30 seconds
return

;_____end of auto-execute section______

OpenTables:
Critical ;______we don't want the CheckTables subroutine messing anything up
table_number := id ;_____this will be blank the first time around; later it contains the number of tables already open
ControlFocus, SysListView321, ahk_id%lobby_id% ;set focus to the ListView
ControlGet, count, List, Count, SysListView321, ahk_id%lobby_id% ;____used below to break if we reach the end of the list before we find 10 tables
ControlGet, focused, List, Count Focused, SysListView321, ahk_id%lobby_id% ;____we want to select the topmost row,
;_____so we just send %focused% amount of UP keystrokes:
Loop, %focused%
ControlSend, SysListView321, {UP}, ahk_id%lobby_id%
Loop
{
ControlGet, players, List, Focused Col3, SysListView321, ahk_id%lobby_id% ;retrieve the contents of the 3rd column in the focused row (looks like 7/10 or whatever)
StringRight, is_6max, players, 1 ;___if this is a 6max table this character will be "6"
StringLeft, players, players, 2 ;____the two character from the left; will be either "10" or something like 9/
IfInString, players, / ;if the table isn't full we have to get rid of the "/"
StringTrimRight, players, players, 1

;_____using the number of players / game_type we just retrieved and the min/max player numbers definded in the auto-execute section,
;_____ we check if we want this table:

If (((game_type = "6max") AND (is_6max = 6 AND players >= players_min_6max AND players <= players_max_6max))
OR ((game_type = "full") AND (is_6max <> 6 AND players >= players_min_full AND players <= players_max_full)))
{
ControlSend, SysListView321, {Enter}, ahk_id%lobby_id% ;_____if yes, send an enter keystroke to open it
If ErrorLevel = 0 ;_____if we could open it, increase table_number by 1 (used below to break)
table_number++
}
ControlSend, SysListView321, {DOWN}, ahk_id%lobby_id% ;_____move to the next table
If (table_number >= 10 OR a_index > count) ;____if we reach 10 tables or the end of the list, break
break
}
WinMinimize, ahk_group tables ;_____minimize all the tables (mine get (censored) up if I leave them all maximised for too long)
return


CheckTables: ;_____check if we still like the tables
id = 0 ;_____not sure about this array here but just in case...
WinGet, id, List, Good Luck ahk_class #32770, , PartyPoker.com ;_____make a list of all the party tables, excluding Lobby
If id < 10 ;_____if we have less then 10, open some (table_number in the OpenTables thread is set to %id%
{
Gosub, OpenTables
return
}
Loop, %id% ;if we have 10 open, check them
{
StringTrimRight, this_id, id%a_index%, 0 ;_____access array
WinGetTitle, title, ahk_id%this_id% ;_____retrieve the name of this table as shown in the lobby
StringGetPos, pos, title, -
StringLeft, title, title, %pos%
StringTrimRight, title, title, 2
ControlGet, list, List, , SysListView321, ahk_id%lobby_id% ;______probably not the most elegant way to do it, but what the hell; just get all the info and parse it
Loop, Parse, List, `n ;____(each row ends in a linefeed)
{
IfInString, a_loopfield, %title%
{
StringGetPos, pos_tab3, a_loopfield, %A_Tab%, L3 ;____if we find the title, retrieve the number of players
StringGetPos, pos_tab2, a_loopfield, %A_Tab%, L2
StringLeft, players, a_loopfield, %pos_tab3%
StringTrimLeft, players, players, % pos_tab2+1
StringLeft, players, players, 2
IfInString, players, /
StringTrimRight, players, players, 1

;______kinda like reversing the expression in the other thread; now we're checking if it DOESN'T suit us
If (((game_type = "6max") AND (players < players_min_6max OR players > players_max_6max))
OR ((game_type = "full") AND (players < players_min_full OR players > players_max_full)))
{
WinClose, ahk_id%this_id% ;_____if we don't like it, close it
{
WinWaitClose, ahk_id%this_id% ;_____wait till it has closed
id = 9 ;____since we got this far, we have to have 9 tables open (after closing number 10); another "just in case" or whatever
Gosub, OpenTables ;____open a new table
}
}
}
}
}
return

edit: Changed title to reflect new (goofy) name.
-Sam

DrewOnTilt 02-20-2006 05:31 PM

Re: Your code, Sam
 
Looks like this is code to keep 10 tables open at a time, correct? What language is that, vbscript?? Can I save that as a .vbs file then fire away?

Roland 02-20-2006 05:47 PM

Re: Your code, Sam
 
No, this is AutoHotkey. Save it as .ahk and fire away... I hope it doesn't backfire [img]/images/graemlins/smile.gif[/img]

SamIAm 02-20-2006 06:23 PM

Re: Your code, Sam
 
Awesome. Thanks. I'll take a look at it tonight.
-Sam

P.S. Remember that the [ code ] tags will keep your perty indentation from getting garbled.

pif 02-20-2006 06:34 PM

roland. you helpd me with the minilobby v2. but maybe u can
 
look at my post
http://forumserver.twoplustwo.com/showth...e=0#Post4809332

(its look that my fonts remain bug. (also when i change it to 96dpi and less (72 dpi) this no effect party font size)

Roland 02-20-2006 06:47 PM

Re: roland. you helpd me with the minilobby v2. but maybe u can
 
Lol, I was just going to respond with a link to MiniLobby, then I saw you're my only taker so far. [img]/images/graemlins/smile.gif[/img]

There's no way I know of to change the font in a ListView with AutoHotkey, to answer your question.
Btw, I would appreciate some feedback on the avg. pot size thing - I really like it, but I play Stud mostly and thus don't have all these other means of table selection. Do you think it is helpfull?

Roland 02-20-2006 06:58 PM

Re: Your code, Sam
 
[ QUOTE ]
P.S. Remember that the [ code ] tags will keep your perty indentation from getting garbled.

[/ QUOTE ]

Yeah, but then you won't be able to simply copy&paste. Because it garbles the linefeeds instead.
Besides, the tabs are way to wide - you'd have to scroll horizontally all the time just to take a look at it.
Can't have everything. [img]/images/graemlins/frown.gif[/img]

SamIAm 02-21-2006 12:34 AM

Update 2/20
 
[ QUOTE ]
[ QUOTE ]
P.S. Remember that the [ code ] tags

[/ QUOTE ]

Yeah, but then you won't be able to simply copy&paste. Because it garbles the linefeeds instead. Can't have everything. [img]/images/graemlins/frown.gif[/img]

[/ QUOTE ]Ah, but what if I link to the code, and THEN post it?! HA! (Wide-lines be damned. I have a big screen.)

Below I added a GUI to enter preferences and added a .ini to save them. My code's in red below. I want to add better support for logged-out mining. I also haven't even gotten into your nitty & gritty details to do the optimizing you actually asked for; I'll get into those maybe tonight.

I started calling it "FreeMine", since we're (clearly) giving-out the source. I expect we'll have some GPL mumbo-jumbo, to make sure nobody sells it, but publishing it here should stop that. [img]/images/graemlins/smile.gif[/img]
-Sam

<font class="small">Code:</font><hr /><pre>
#Persistent
SetTitleMatchMode, 2 ;____i forget why I used this, but don't want to break anything
WinGet, lobby_id, ID, PartyPoker.com
GroupAdd, tables, Good Luck ahk_class #32770 ;____used to minimize all the tables later<font color=" red">
;Read all the stats
string = 6 min
IniRead, players_min_6max, FreeMine.ini, Prefs, %string%, 1
string = Full min
IniRead, players_min_full, FreeMine.ini, Prefs, %string%, 2
string = Game Type
IniRead, game_type, FreeMine.ini, Prefs, %string%, full
string = Number of Tables
IniRead, tables_max, FreeMine.ini, Prefs, %string%, 10
;These are silly.</font>
players_max_6max = 6
players_max_full = 10
<font color=" red">;Gui
Gui, Add, Text, x6 y7 w100 h20, Min Players 6Max
Gui, Add, Text, x6 y37 w100 h20, Max Players 10Max
Gui, Add, DropDownList, x116 y7 w40 h20 vplayers_min_6max gGUISubmit, 1|2|3|4|5|6
Gui, Add, DropDownList, x116 y37 w40 h21 vplayers_min_full gGUISubmit, 1|2|3|4|5|6|7|8|9|10
Gui, Add, Radio, x6 y67 w50 h20 vgui_typebox gGUISubmit, 6Max
;The 2nd radio needs a different variable, just for setting and disabling. Dumb.
Gui, Add, Radio, x96 y67 w60 h20 vgui_typebox2 gGUISubmit, Full
;Note that radio buttons have to be sequential to be in the same group.
Gui, Add, Button, x6 y127 w70 h20 vgui_gobutton gGuiGo, Go
Gui, Add, Button, x86 y127 w70 h20 vgui_stopbutton gGuiStop, Stop
Gui, Add, Radio, x6 y97 w50 h20 vgui_loginbox gGUISubmit, Login
Gui, Add, Radio, x96 y97 w60 h20 vgui_loginbox2 gGUISubmit, Logout
Gui, Show, x953 y392 h156 w164, FreeMine
;Set the controls to the read stats.
GuiControl, Choose, players_min_6max, %players_min_6max%
GuiControl, Choose, players_min_full, %players_min_full%
if game_type = 6max
GuiControl,, gui_typebox, 1
else
GuiControl,, gui_typebox2, 1
if tables_max = 10
GuiControl,, gui_loginbox, 1
else
GuiControl,, gui_loginbox2, 1
;--Disable the stop button.
GuiControl, Disable, gui_stopbutton</font>
return
;_____end of auto-execute section______

OpenTables:
Critical ;______we don't want the CheckTables subroutine messing anything up
table_number := id ;_____this will be blank the first time around; later it contains the number of tables already open
ControlFocus, SysListView321, ahk_id%lobby_id% ;set focus to the ListView
ControlGet, count, List, Count, SysListView321, ahk_id%lobby_id% ;____used below to break if we reach the end of the list before we find 10 tables
ControlGet, focused, List, Count Focused, SysListView321, ahk_id%lobby_id% ;____we want to select the topmost row,
;_____so we just send %focused% amount of UP keystrokes:
Loop, %focused%
ControlSend, SysListView321, {UP}, ahk_id%lobby_id%
Loop
{
ControlGet, players, List, Focused Col3, SysListView321, ahk_id%lobby_id% ;retrieve the contents of the 3rd column in the focused row (looks like 7/10 or whatever)
StringRight, is_6max, players, 1 ;___if this is a 6max table this character will be "6"
StringLeft, players, players, 2 ;____the two character from the left; will be either "10" or something like 9/
IfInString, players, / ;if the table isn't full we have to get rid of the "/"
StringTrimRight, players, players, 1

;_____using the number of players / game_type we just retrieved and the min/max player numbers definded in the auto-execute section,
;_____ we check if we want this table:

If (((game_type = "6max") AND (is_6max = 6 AND players &gt;= players_min_6max AND players &lt;= players_max_6max))
OR ((game_type = "full") AND (is_6max &lt;&gt; 6 AND players &gt;= players_min_full AND players &lt;= players_max_full)))
{
ControlSend, SysListView321, {Enter}, ahk_id%lobby_id% ;_____if yes, send an enter keystroke to open it
If ErrorLevel = 0 ;_____if we could open it, increase table_number by 1 (used below to break)
table_number++
}
ControlSend, SysListView321, {DOWN}, ahk_id%lobby_id% ;_____move to the next table
If (table_number &gt;= <font color=" red">tables_max</font> OR a_index &gt; count) ;____if we reach 10 tables or the end of the list, break
break
}
WinMinimize, ahk_group tables ;_____minimize all the tables (mine get (censored) up if I leave them all maximised for too long)
return


CheckTables: ;_____check if we still like the tables
id = 0 ;_____not sure about this array here but just in case...
WinGet, id, List, Good Luck ahk_class #32770, , PartyPoker.com ;_____make a list of all the party tables, excluding Lobby
If id &lt; <font color=" red">tables_max</font> ;_____if we have <font color="red">fewer</font> then 10, open some (table_number in the OpenTables thread is set to %id%
{
Gosub, OpenTables
return
}
Loop, %id% ;if we have 10 open, check them
{
StringTrimRight, this_id, id%a_index%, 0 ;_____access array
WinGetTitle, title, ahk_id%this_id% ;_____retrieve the name of this table as shown in the lobby
StringGetPos, pos, title, -
StringLeft, title, title, %pos%
StringTrimRight, title, title, 2
ControlGet, list, List, , SysListView321, ahk_id%lobby_id% ;______probably not the most elegant way to do it, but what the hell; just get all the info and parse it
Loop, Parse, List, `n ;____(each row ends in a linefeed)
{
IfInString, a_loopfield, %title%
{
StringGetPos, pos_tab3, a_loopfield, %A_Tab%, L3 ;____if we find the title, retrieve the number of players
StringGetPos, pos_tab2, a_loopfield, %A_Tab%, L2
StringLeft, players, a_loopfield, %pos_tab3%
StringTrimLeft, players, players, % pos_tab2+1
StringLeft, players, players, 2
IfInString, players, /
StringTrimRight, players, players, 1

;______kinda like reversing the expression in the other thread; now we're checking if it DOESN'T suit us
If (((game_type = "6max") AND (players &lt; players_min_6max OR players &gt; players_max_6max))
OR ((game_type = "full") AND (players &lt; players_min_full OR players &gt; players_max_full)))
{
WinClose, ahk_id%this_id% ;_____if we don't like it, close it
{
WinWaitClose, ahk_id%this_id% ;_____wait till it has closed
id = 9 ;____since we got this far, we have to have 9 tables open (after closing number 10); another "just in case" or whatever
Gosub, OpenTables ;____open a new table
}
}
}
}
}
return
<font color=" red">
;--Records all the controls, both to variables and to .ini.
GUISubmit:
Gui, Submit, NoHide
string = 6 Min
IniWrite, %players_min_6max%, FreeMine.ini, Prefs, %string%
string = Full Min
IniWrite, %players_min_full%, FreeMine.ini, Prefs, %string%
string = Game Type
if gui_typebox = 1
game_type = 6max
else
game_type = full
IniWrite, %game_type%, FreeMine.ini, Prefs, %string%
string = Number of Tables
if gui_loginbox = 1
tables_max = 10
else
tables_max = 4
IniWrite, %tables_max%, FreeMine.ini, Prefs, %string%
return

GuiClose:
ExitApp

;The GO button. Disables all buttons, starts the thread.
GuiGo:
;Reconds the variables, just in case.
GoSub GUISubmit
;Disables the buttons.
GuiControl, Disable, players_min_6max
GuiControl, Disable, players_min_full
GuiControl, Disable, gui_typebox
GuiControl, Disable, gui_typebox2
GuiControl, Disable, gui_loginbox
GuiControl, Disable, gui_loginbox2
GuiControl, Disable, gui_gobutton
GuiControl, Enable, gui_stopbutton
;Runs the original "go" code.</font>
Gosub, OpenTables ;_____open the 10 tables
SetTimer, CheckTables, 30000 ;______I figured it makes more sense to wait if somebody takes an open seat or whatever, thus 30 seconds
<font color=" red">return

;The STOP button. Enables all buttons, stops the thread.
GuiStop:
;Stop the timer.
SetTimer, CheckTables, Off
;Re-enable the buttons.
GuiControl, Enable, players_min_6max
GuiControl, Enable, players_min_full
GuiControl, Enable, gui_typebox
GuiControl, Enable, gui_typebox2
GuiControl, Enable, gui_loginbox
GuiControl, Enable, gui_loginbox2
GuiControl, Enable, gui_gobutton
GuiControl, Disable, gui_stopbutton
return</font></pre><hr />

SamIAm 02-21-2006 01:12 AM

AHK networking
 
I was thinking about networking. I know this isn't really AHK's cup 'o tea, but it'd be really cool if we could totally replicate the original features of PartyMine in AHK.

I did a little research, but didn't find much. I thought, instead of real networking, we could just write the table-list to a file on the harddrive and share the folder. That'd require a bit more from the user to setup, but it'd be easy to write.

This would have the added benefit of letting you use multiple Windows accounts, since there'd be no difference between 2 machines accessing the folder and 2 accounts accessing the folder.

Whatcha think?
-Sam

SamIAm 02-21-2006 03:26 AM

Re: Update 2/20
 
Sorry. Realized I made a couple changes after uploading.

I updated so it loads Party at startup (if preferred) as well as let the user specify the location of the client. I couldn't get the auto-login on first try.

Same link as before.
-Sam

starvs 02-21-2006 08:21 AM

Re: Update 2/20
 
Im rushing to school so I don't have to much time to play with this, but it seems it is going to be awesome. I just installed AHK and made an ahk file for the script but when I open party and press "go" it minimizes the lobby, but does nothing else? I may need to change a few things in the script I haven't really looked yet as I have to go now. But thanks alot for your work, especially at no charge.

SamIAm 02-21-2006 11:05 AM

Re: Update 2/20
 
[ QUOTE ]
but when I open party and press "go" it minimizes the lobby, but does nothing else?

[/ QUOTE ]Yeah, I noticed that when I load the app and it autoloads Party, it can't Go. When I have Party running and then load the app, it works for me. I wonder if there's a bug recognizing the lobby or something. It still ran all night.

There's also some bug where it's asking to open more tables. (That's better than not enough, I suppose.) I sure hope I didn't introduce these. [img]/images/graemlins/frown.gif[/img]
-Sam

Roland 02-21-2006 03:36 PM

Re: Update 2/20
 
[ QUOTE ]
[ QUOTE ]
but when I open party and press "go" it minimizes the lobby, but does nothing else?

[/ QUOTE ]Yeah, I noticed that when I load the app and it autoloads Party, it can't Go. When I have Party running and then load the app, it works for me. I wonder if there's a bug recognizing the lobby or something. It still ran all night.

There's also some bug where it's asking to open more tables. (That's better than not enough, I suppose.) I sure hope I didn't introduce these. [img]/images/graemlins/frown.gif[/img]
-Sam

[/ QUOTE ]

Lol - yes, you did. [img]/images/graemlins/grin.gif[/img]
You get the lobby PID in the auto-execute section, but at that point the lobby doesn't exist yet. Therefore, WinGet, id, List, ahk_pid%lobby_pid% does nothing. [img]/images/graemlins/smile.gif[/img]
Add the get pid command to the GuiGo subroutine, and it works.

Edit: Uh, the bug where it wants to open more tables - I can't find it right now but that must be my fault.
Also it opens 6max tables when I have it on full; that clearly sucks. I'll try and find those bugs.

Edit2: Okay, this is really dumb... just saw you can turn on the filter for 6max. What the hell. We can just disable the 6max stuff.

smellmuth 02-21-2006 03:37 PM

Re: Update 2/20
 
ok i think i need this but im totally clueless. if someone wants to take 5 minutes and guide me through this that would be awesome. please PM me.

SamIAm 02-21-2006 04:21 PM

Re: Update 2/20
 
Yeah, I found the bugs I introduced, too. [img]/images/graemlins/frown.gif[/img] I think I fixed them, though.

Here's the newest version. I made it one thread to open and check tables, instead of 2 (1 for checking, 1 for opening). I also made a more concrete list of table-names, so we can implement networking in the future. (And I display that list, for kicks.)

I still have a bug where it doesn't recognize all the tables. Like, it'll find 9 of the 10, and therefore try to open one more. (Getting the error.)

Mogobu talked to me about uploading it to the Wiki. It'd give us version control, which sure would be nice.
-Sam

P.S. Just realized that I never put back your Minimize-tables code. To-do.

Roland 02-21-2006 04:27 PM

Re: AHK networking
 
[ QUOTE ]
I was thinking about networking. I know this isn't really AHK's cup 'o tea, but it'd be really cool if we could totally replicate the original features of PartyMine in AHK.

I did a little research, but didn't find much. I thought, instead of real networking, we could just write the table-list to a file on the harddrive and share the folder. That'd require a bit more from the user to setup, but it'd be easy to write.

This would have the added benefit of letting you use multiple Windows accounts, since there'd be no difference between 2 machines accessing the folder and 2 accounts accessing the folder.

Whatcha think?
-Sam

[/ QUOTE ]

Yeah, my brain just woke up and now I realize what you're talking about. That should be pretty easy (besides, I know exactly nothing about networking [img]/images/graemlins/smile.gif[/img]).

starvs 02-21-2006 04:42 PM

Re: AHK networking
 
okay the new version seems to be working very well (ie. opening the tables). What method does this use to actually get the data/hand history, if this part is even implimented yet? And if it is how do I actually use it?

Pardon my ignorance and confusion, I really don't know what is going on.

Roland 02-21-2006 04:49 PM

Re: AHK networking
 
[ QUOTE ]
What method does this use to actually get the data/hand history

[/ QUOTE ]

Uh, this part is not and will never be implemented, no. This code is simply a means to get and keep 10 tables with a min/max number of players open.

starvs 02-21-2006 05:04 PM

Re: AHK networking
 
[ QUOTE ]
[ QUOTE ]
What method does this use to actually get the data/hand history

[/ QUOTE ]

Uh, this part is not and will never be implemented, no. This code is simply a means to get and keep 10 tables with a min/max number of players open.

[/ QUOTE ]

Thats what I thougth on the first read, then Sam mentioned "replicating party mines features", and the name "freemine". Sorry for the miss interpretation.

Handy program either way, thanks.

Roland 02-21-2006 05:11 PM

Re: AHK networking
 
[ QUOTE ]
Thats what I thougth on the first read, then Sam mentioned "replicating party mines features", and the name "freemine".

[/ QUOTE ]

Correct me if I'm wrong but PartyMine didn't do this either, right? I mean, there was no need to because there were observed HHs.
I think Sam was talking more about networking/using multiple Windows accounts.

Mogobu The Fool 02-21-2006 06:08 PM

Re: AHK networking
 
Uploaded to FreeMine page on overcards.com Wiki

Feel free to post update to it there.

Can I beg for the project to be renamed? This isn't for datamining, it's for observation. (Datamining is what you do to data, not how you get data. Irks me. Yeah, I'm anal.)

Roland 02-21-2006 06:18 PM

Re: AHK networking
 
[ QUOTE ]
Uploaded to FreeMine page on overcards.com Wiki

Feel free to post update to it there.

[/ QUOTE ]

Thanks.

[ QUOTE ]
Can I beg for the project to be renamed? This isn't for datamining, it's for observation. (Datamining is what you do to data, not how you get data. Irks me. Yeah, I'm anal.)

[/ QUOTE ]

Granted on my part. I'm no good at inventing names though - any suggestions?

SamIAm 02-21-2006 06:36 PM

Re: AHK networking
 
[ QUOTE ]
Uploaded to FreeMine page on overcards.com Wiki

Feel free to post update to it there.

[/ QUOTE ]I'm dumb. How do I update while keeping old versions around? Just edit the text there? (I introduce bugs so frequently into Roland's code, he'll want to be able to roll-back once a week or so.)

[ QUOTE ]
Can I beg for the project to be renamed?

[/ QUOTE ]Fine by me. I was mimicking PartyMine, since it's doing the exact same thing. (Did you nit-pick at Prod1gy, too? [img]/images/graemlins/smile.gif[/img] )

We mentioned FreeMine and AHKMine. Here's the (bad) list I came up with.<ul type="square">[*]PartyPerceive[*]FullTables[*]PartyWatcher[*]GameStalker[*]iWitness[*]Spectate[*]Gawker[/list]Let me know if you find any good ones. [img]/images/graemlins/smile.gif[/img]
-Sam

P.S. I fixed a bug where I changed your method of grabbing the title of the table. I rolled it back to your method. (I forgot some titles had 2 words.)

Mogobu The Fool 02-21-2006 06:45 PM

Re: AHK networking
 
[ QUOTE ]
Granted on my part. I'm no good at inventing names though - any suggestions?

[/ QUOTE ]

How about TableSpreader? "Spreading" is casino parlance for opening a table.

Or maybe TableMonitor, or GameWatcher. . .

Or, if you re-size the tables: PartyCrasher!

Roland 02-21-2006 06:47 PM

Re: AHK networking
 
[ QUOTE ]
How do I update while keeping old versions around?

[/ QUOTE ]

I woudn't worry about keeping all the bugs around... just edit it, I'll fix it if needed. [img]/images/graemlins/tongue.gif[/img]

Mogobu The Fool 02-21-2006 06:49 PM

Re: AHK networking
 
[ QUOTE ]
I'm dumb. How do I update while keeping old versions around? Just edit the text there? (I introduce bugs so frequently into Roland's code, he'll want to be able to roll-back once a week or so.)

[/ QUOTE ]
Just edit. You can always hit Info and see all the previous version, or compare between two versions to see the changes.

[ QUOTE ]
[ QUOTE ]
Can I beg for the project to be renamed?

[/ QUOTE ]Fine by me. I was mimicking PartyMine, since it's doing the exact same thing. (Did you nit-pick at Prod1gy, too? [img]/images/graemlins/smile.gif[/img] )

[/ QUOTE ]
You have no idea.

Roland 02-21-2006 06:51 PM

Re: AHK networking
 
[ QUOTE ][*]iWitness

[/ QUOTE ]

I like it. [img]/images/graemlins/smile.gif[/img]

SamIAm 02-21-2006 07:00 PM

Re: AHK networking
 
[ QUOTE ]
Or, if you re-size the tables: PartyCrasher!

[/ QUOTE ]Yeah, I tried running this with PartyPlanner earlier. It was fun, but maybe not the nicest surprise for my machine.
-Sam

DrewOnTilt 02-21-2006 07:24 PM

Re: Your code, Sam
 
Nice work, but can I specify a limit? It seems that the program opens whatever limit is selected in the Party client at the time. This is fine, I'll just have to remember to manually set the table seelection to 5/10 or 10/20 or whatever.

Roland 02-21-2006 07:29 PM

Re: Your code, Sam
 
[ QUOTE ]
Nice work, but can I specify a limit? It seems that the program opens whatever limit is selected in the Party client at the time. This is fine, I'll just have to remember to manually set the table seelection to 5/10 or 10/20 or whatever.

[/ QUOTE ]

This didn't seem like it was worth it at the time (with only 10 tables) but no we're talking multiple windows accounts this makes a lot more sence. I'll look into it.

theRealMacoy 02-21-2006 08:34 PM

Re: Your code, Sam
 
great work here guys.
thanks for sharing the sweet script.

sean

Mogobu The Fool 02-21-2006 09:18 PM

(Off topic)
 
[ QUOTE ]
[ QUOTE ]
Or, if you re-size the tables: PartyCrasher!

[/ QUOTE ]Yeah, I tried running this with PartyPlanner earlier. It was fun, but maybe not the nicest surprise for my machine.
-Sam

[/ QUOTE ]

Gotta say I'm REALLY disappointed with Party on this. I'm still using my full-size table layout for PartyPlanner, even though the new Party is out (too used to my HUD layout.) Party is stable. I can play for hours.

If I set the tables smaller, Party WILL eventually crash. And I know how PartyPlanner works pretty well -- if you're not re-sizing windows, it doesn't do anything to them at all. There's something buggy in Party's BMP-stretch/render code, or something.

For bugs in the new lobby, I can just say they're silly for putting it out without a Beta first. But for the tables? Come on! There WAS a Beta, and everyone reported crashes all over 2+2. How the h*ll do you go to release with it!?!?!?

SamIAm 02-21-2006 09:34 PM

Re: networking
 
[ QUOTE ]
now we're talking multiple windows accounts

[/ QUOTE ]So, how do you want to work this? I had envisioned letting the user specify a "networking file", writable by all clients, and having each client chime in with "These are my tables. Client1 wuz here."

Issues:
a. We'll probably have to record the time of the record, else we won't be able to tell when clients drop-out. No biggie.

b. I worry about file-errors. What happens when both clients try to write at the same time? We could have each client drop-off their own file in the "networking folder". This way one client's writing, the other are reading.

c. What happens to the .ini when the script is being run multiple times on the same machine? You won't be able to have WinUser1 observing $100/$200 and WinUser2 observing $200/$400 without constantly resetting your settings. (This is especially important for the "Login automatically".)

We could change the .ini writing, so instead of putting all the entries in "[Prefs]", it puts them in "[Client1]". That way all the clients could write their prefs in the same file. You'd have to specify what your client's name was, though, and that's a pain.
-Sam

Roland 02-21-2006 11:21 PM

Re: networking
 
Okay, I’ve never tried this kind of stuff, but what the hell here are some thoughts.


[ QUOTE ]
So, how do you want to work this? I had envisioned letting the user specify a "networking file", writable by all clients, and having each client chime in with "These are my tables. Client1 wuz here."

[/ QUOTE ]

Yup. That makes sense.


[ QUOTE ]
Issues:
a. We'll probably have to record the time of the record, else we won't be able to tell when clients drop-out. No biggie.

[/ QUOTE ]

You’ve lost me. It’s 4AM though (couldn’t find any sleep, lol.)


[ QUOTE ]
b. I worry about file-errors. What happens when both clients try to write at the same time? We could have each client drop-off their own file in the "networking folder". This way one client's writing, the other are reading.

[/ QUOTE ]

Yeah, a folder seems like the way to go. We could just have every client write it’s current list of tables to a file; every time another client runs the OpenTables subroutine it reads those files. Does that make sense?


[ QUOTE ]
c. What happens to the .ini when the script is being run multiple times on the same machine? You won't be able to have WinUser1 observing $100/$200 and WinUser2 observing $200/$400 without constantly resetting your settings. (This is especially important for the "Login automatically".)

We could change the .ini writing, so instead of putting all the entries in "[Prefs]", it puts them in "[Client1]". That way all the clients could write their prefs in the same file. You'd have to specify what your client's name was, though, and that's a pain.
-Sam

[/ QUOTE ]

This isn’t a problem - Party doesn’t have $200/$400.

Uh, okay, obviously the first thing we have to do is to get it to switch limits. Not a problem I think.
Then couldn’t we just have the user specifie “I want to have 10 tables of $400/$800, 10 tables of $800/$1600 and 10 tables $3000/$6000”? So, the first client starts with $400/$800 and writes to our folder “I’m at 400/800”. The next client sees that and says, “Ok, I’ll take care of 800/1600”? etc.
Uh, yeah…

SamIAm 02-21-2006 11:47 PM

Re: networking
 
[ QUOTE ]
[ QUOTE ]
We'll probably have to record the time of the record, else we won't be able to tell when clients drop-out. No biggie.

[/ QUOTE ]

You’ve lost me.

[/ QUOTE ]Ok. Here's the problem I envision. Client1 says "I'm watching tables A,B,C,D." Client2 reads that file, and watches E,F,G,H. Then Client1 stops mining. Unfortunately, the file it wrote saying "Client1 claims ABCD" is still there, and Client2 is still avoiding those tables.

On the other hand, if that file also contains the last time it was written, Client2 will eventually notice that C1Tables.txt is old, and ignore it, freeing tables ABCD to be observed. Or spectated. Or whatever.

[ QUOTE ]
[ QUOTE ]
I worry about file-errors. What happens when both clients try to write at the same time? We could have each client drop-off their own file in the "networking folder". This way one client's writing, the other are reading.

[/ QUOTE ]

Yeah, a folder seems like the way to go. We could just have every client write it’s current list of tables to a file; every time another client runs the OpenTables subroutine it reads those files.

[/ QUOTE ]Will it be a problem if Client1 is reading C2tables.txt while Client2 is editing it?

[ QUOTE ]
the first thing we have to do is to get it to switch limits. Not a problem I think.
Then couldn’t we just have the user specifie “I want to have 10 tables of $400/$800, 10 tables of $800/$1600 and 10 tables $3000/$6000”? So, the first client starts with $400/$800 and writes to our folder “I’m at 400/800”. The next client sees that and says, “Ok, I’ll take care of 800/1600”? etc.

[/ QUOTE ]Interesting. I was going to just write the list of tables in the file, and add that to the list of tables not to open. (The script already checks to make sure a new table isn't an old table. Now it'll check to make sure a new table isn't an old table OR a networked table.)

I was going to let individual clients determine their limits; just use the networking to avoid eachothers' tables. So you can start Client1 and Client2 on $4k/$8k, and start Client3 and Client4 on $0.50/$1. My point was that the .ini file would probably contain the limit you want spectated. If all 4 clients are using the same .ini, they won't be able to accurately save.

However, if you setup as described, there'd be no individual settings for individual clients. The user just says "Examine X from limitX, Y from limitY." Or maybe "Examine LimitA as much as possible, and then examine LimitB with the rest of your tables."

I'm not sure how complicated we want this interface to get...
-Sam

P.S. LURKERS! This is where you chime-in and say "Yeah, I want networking to do &lt;this&gt;."

Mogobu The Fool 02-22-2006 01:28 AM

Re: networking
 
[ QUOTE ]
Ok. Here's the problem I envision. Client1 says "I'm watching tables A,B,C,D." Client2 reads that file, and watches E,F,G,H. Then Client1 stops mining. Unfortunately, the file it wrote saying "Client1 claims ABCD" is still there, and Client2 is still avoiding those tables.

On the other hand, if that file also contains the last time it was written, Client2 will eventually notice that C1Tables.txt is old, and ignore it, freeing tables ABCD to be observed. Or spectated. Or whatever.

[/ QUOTE ]

You won't have a race condition if the file has a fixed length; they'll both reach the end of the file, and even if a table is duped, it will resolved next pass.

On reading my preview, I have no idea why I said that. Did I edit out the thing I was trying to reply to? Anyway, my next comment still makes sense. . .

How about a different approach? Specify a folder for sharing info. Have each clinet drop a file into the folder for each table they watch. When they stop watching a table, they can delete their file. File contains the name of the instance opening it (perhaps the machine name). Periodically each client will update the timestamp in their file, and delete any files seen whose timestamp is older than two periods (covers for clients who die or lose network, and catches when two clients both try to start the same file.)

You can't get two clients to open the same table, because they will error when they try to create a filename that already exists -- can't do it until the other client stops and deletes the file, or the file ages and gets deleted by another AHK client.

This approach alos minimizes the need to do a lot of text parsing of file contents within AHK. (Dunno if that's a plus or not; AHK obviously has some good text-handling abilities!)

Mogobu The Fool 02-22-2006 01:30 AM

Another thing about the Wiki. . .
 
Saw your edits on the script. Thought I'd mention that whne you register an account on the Wiki, you can subscribe to the page and get email alerts whenver someone else edits it.

SamIAm 02-22-2006 09:14 AM

Re: networking
 
[ QUOTE ]
How about a different approach? Specify a folder for sharing info. Have each clinet drop a file into the folder for each table they watch. When they stop watching a table, they can delete their file. File contains the name of the instance opening it (perhaps the machine name). Periodically each client will update the timestamp in their file, and delete any files seen whose timestamp is older

[/ QUOTE ]So, you're saying have another app running which puts files in, say, c:\logs (or some user specified folder) and have this script check that folder?

That's ok, I guess. I'd like this script to stand alone without any other apps. I also don't think the individual file idea is any harder; it shouldn't be hard to write a file called $Machine$.$User$.tables.txt containing the list of tables and the current time. Each cycle, check all the files; if they're newish, concatenate their list with the list of taken tables. If they're oldish, delete the file.
-Sam

SamIAm 02-22-2006 09:29 AM

Re: networking
 
For reference: OS Environment Variables, and Time Variables. %A_ComputerName%.%A_UserName%.tables.txt sure sounds like a good filename to me.

Roland, are you ok with me writing the networking stuff tonight? Are you ok with the "1 file per client" model? Note that this isn't anything about limits, just a list of tables to avoid since your neighbor has it covered. We can add varying-limit functionality later.
-Sam

Roland 02-22-2006 10:06 AM

Re: networking
 
[ QUOTE ]
Roland, are you ok with me writing the networking stuff tonight? Are you ok with the "1 file per client" model? Note that this isn't anything about limits, just a list of tables to avoid since your neighbor has it covered. We can add varying-limit functionality later.
-Sam

[/ QUOTE ]

Sure, go ahead. I'm glad I don't have to do it. [img]/images/graemlins/smile.gif[/img]


All times are GMT -4. The time now is 11:33 PM.

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