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)
-   -   Stars Buddy Search (new AHK script) (http://archives1.twoplustwo.com/showthread.php?t=286713)

rubbishaka80 12-19-2006 12:21 AM

Stars Buddy Search (new AHK script)
 
Hi all,

I wrote a AHK script that searches for buddies on Pokerstars tells you how many tables they play and lets you open these tables.

You have to have a file with the buddies, one on each line:

<font class="small">Code:</font><hr /><pre>
Player1
Player2
Player3
</pre><hr />

The location and name of this file can be customized, the default is "buddies.txt" in the same directory as the script.

After pressing the hotkey "F9" (can be changed, also) the script performs the search and shows the results:

http://img111.imageshack.us/img111/6361/buddiestg5.jpg

You can then decide how many of the found tables you want to open.

I took ideas from wildzer0, handsome and Adde to create this.

Comments are welcome.

This script has ScriptPad support. ScriptPad is a tool where you can connect any number of scripts to a toolpad, a small pop-up window with buttons for all available commands in these scripts. You access the toolpad by a hotkey, for instance the middle mouse button. (see scriptpad )

<font class="small">Code:</font><hr /><pre>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Code begins here ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;------------------------------------------------------------------------------------------------
; Stars Buddy Search v0.1
;------------------------------------------------------------------------------------------------
; Date: 2006-12-19
; AHK version: 1.0.44.14
;------------------------------------------------------------------------------------------------
; Author(s): rubbishaka @ 2+2 forums
; Contact: poker at postsack dot cjb dot net
;------------------------------------------------------------------------------------------------
;
;
;
;
; credits: wildzer0, handsome, Adde
;------------------------------------------------------------------------------------------------


; Set what hotkeys should start buddy search.
; Leave empty (=) if you don't want to use a hotkey.
; List of available hotkeys: http://www.autohotkey.com/docs/KeyList.htm
sb_hotkey = F9

sb_buddyFile = buddies.txt



;clear search list in pokerstars prior to searching (1) or not (0)
sb_clearSearchList = 0

;_________________________________________________ _______________________________________________
;
; DO NOT EDIT BELOW HERE
;_________________________________________________ _______________________________________________

;;;;;;;;;;;;;;;;;;;;auto-execute;;;;;;;;;;;;;;;;;
#NoEnv
#SingleInstance Ignore
#Persistent

names=
sb_scriptpad_command_header = Buddies
sb_scriptpad_command_name = Find Online Buddies
sb_scriptpad_command_label = sb_OnlineBuddy_Label
sb_scriptpad_command_enabled = 1

ahk_version = 1.0.44.14
if A_AhkVersion &lt; %ahk_version%
{
msgbox, 4,
, This script needs AutoHotkey version %ahk_version% or newer (you are using version %A_AhkVersion%)
. Script will exit`n`nGo to web page and download new version now?
IfMsgBox, Yes
Run, http://www.autohotkey.com
ExitApp
}
Hotkey, %sb_hotkey%, sb_OnlineBuddy_Label, UseErrorLevel
goto sb_Scriptpad_End

;;;;;;;;;;;;;;;labels;;;;;;;;;;;;;;
sb_FindBuddy_Label:
sb_FindBuddy()
return

sb_Delete_Label:
sb_ClearSearchList()
return

sb_OnlineBuddy_Label:
if (sb_clearSearchList=1)
sb_ClearSearchList()
sb_OnlineBuddy()

return

Open:
ControlGet, tableNumber, choice,,combobox%A_GuiControl%

sb_openTablesForBuddy(names%A_GuiControl%,tableNum ber)
return

CloseGui:
gui, destroy

return
;;;;;;;;;;;;;;;functions;;;;;;;;;;;;;
sb_ClearSearchList()
{
SetTitleMatchMode 1
WinActivate, PokerStars Lobby

Send !r
Send f {Enter}
WinWait, %A_SPACE%Find Player, , 3
WinActivate, %A_SPACE%Find Player
ControlGet, List, List,, ComboBox1
Loop, Parse, List, `n
{
Control, choose, 1, Combobox1
ControlClick, Button3
}

Send, {Esc}
}
sb_FindBuddy()
{

SetTitleMatchMode 1
IfWinNotExist PokerStars Lobby - Logged in
return

InputBox, UserInput, Stars Buddy Search, Enter username to search for.
if ErrorLevel
return
else

InputBox, Index, Stars Buddy Search, How many tables do you want to open?
if ErrorLevel
return
else


sb_openTablesForBuddy(UserInput, Index)

}


sb_openTablesForBuddy(UserInput, Index)
{

Tables := 0
sleep, 100
Loop %Index%
{
SetTitleMatchMode 1
WinActivate, PokerStars Lobby
WinwaitActive, PokerStars Lobby


Send !r
Send f {Enter}
Send, %UserInput% {Enter}

WinWait, %A_SPACE%Find Player, , 3
WinActivate, %A_SPACE%Find Player
Send {Tab}{Tab}

Loop %Tables%
{
Send {Down}
Sleep 100
}
Tables++
Send {Enter}
Sleep 500

}
}


sb_onlineBuddy()
{
global sb_buddyFile
global tablelist
global namelist


ifnotexist, %sb_buddyFile%
{
msgBox, Buddy File "%sb_buddyFile%" not found
return
}
Loop, Read, %sb_buddyFile%
{

SetTitleMatchMode, 2
IfWinExist PokerStars Lobby
{
WinActivate
winwaitactive, PokerStars Lobby
}
else
return

Send, !r
Sleep, 10
Send, f {Enter}

Send, %A_LoopReadLine% {Enter}

Loop
{
Sleep, 100
IfWinExist, PokerStars, Not Found
{
Send, {Enter}
break
}

ifWinExist, Find Player


{

namelist=%namelist%%A_LoopReadLine%|


number:=countTables()
tableList=%tablelist%%number%|

Send, {Esc}


break
}
}

}
sb_buildGui()
}

countTables()
{
WinActivate, Find Player
send {down}
send {down}
number:=1

loop
{
send {down}
y:=(number*13)+44

PixelGetColor, color, 200, %y%

if color=0xffffff
{
number++
}
else
{
break
}
}
return number
}
sb_buildGUI()
{


global

StringSplit, names, namelist, |
StringSplit, tables, tablelist, |
arraycount=% names0-1

if (arraycount &lt;1)
{
msgbox, No one online :-(
return
}



loop,%ArrayCount%
Gui, Add, Text,, % names%A_Index%

gui, add, button,gCloseGui,close

loop,%ArrayCount%
{

strNumber:=""
loop, % tables%A_Index%
strNumber=%strNumber%%A_Index%|
strNumber=%strNumber%|

if (A_Index=1)
Gui, Add, DropDownList, ym w40, %strNumber%
else
Gui, Add, DropDownList,w40, %strNumber%

}

loop,%ArrayCount%
{

if (A_Index=1)
Gui, Add, Button,v%A_Index% ym gOpen, Open Tables
else
Gui, Add, Button,v%A_Index% gOpen, Open Tables
}
Gui, Show,,Buddy Search
return
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; scriptpad ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

sb_Scriptpad_End:
; Do nothing. This is needed to work with Scriptpad.

</pre><hr />

Gregg777 12-19-2006 12:24 AM

Re: Stars Buddy Search (new AHK script)
 
Very nice.

Is there a way to make your script automatically open the tables your buddies are at?

Bowlboy 12-19-2006 01:14 AM

Re: Stars Buddy Search (new AHK script)
 
hey this looks really great. I'm totally new to AHK just downloaded it now because I really want to try your script out. Cant get it to open though. I copy and pasted the script into notepad and saved it as starsbuddy.ahk
It saved to my desktop with an ahk file icon. When i double click it however, I get the hourglass thing for a second then nothing. FYI, I copied the entire part of the script including the ;;;;;;;;;;;;;;;;;;code starts here;;;;;;;;;;;; part. Maybe I'm supposed to exclude this?

rubbishaka80 12-19-2006 01:23 AM

Re: Stars Buddy Search (new AHK script)
 
[ QUOTE ]
Is there a way to make your script automatically open the tables your buddies are at?

[/ QUOTE ]

Could be done. I will post something later.

NoahSD 12-19-2006 01:24 AM

Re: Stars Buddy Search (new AHK script)
 
[ QUOTE ]

Is there a way to make your script automatically open the tables your buddies are at?

[/ QUOTE ]

Yeah.. this would make this even more awesome.

rubbishaka80 12-19-2006 01:28 AM

Re: Stars Buddy Search (new AHK script)
 
[ QUOTE ]
hey this looks really great. I'm totally new to AHK just downloaded it now because I really want to try your script out. Cant get it to open though. I copy and pasted the script into notepad and saved it as starsbuddy.ahk
It saved to my desktop with an ahk file icon. When i double click it however, I get the hourglass thing for a second then nothing. FYI, I copied the entire part of the script including the ;;;;;;;;;;;;;;;;;;code starts here;;;;;;;;;;;; part. Maybe I'm supposed to exclude this?

[/ QUOTE ]

You did everything right (I suppose PokerStars is running and you're logged in). Now press F9.

Bowlboy 12-19-2006 01:36 AM

Re: Stars Buddy Search (new AHK script)
 
I am logged in to pokerstars. Shouldnt the graphical interface of the script come up? I pressed F9 and nothing happened. Nothing indicates that the script is actually running. I think it's something to do with when I am copying it and pasting into notepad. It's not retaining the same format though I dont know how to stop it from doing this. The line breaks arent where they should be. Sorry i'm dumb but how do I prevent the format of the text from changing when i paste into notepad?

NoahSD 12-19-2006 01:36 AM

Re: Stars Buddy Search (new AHK script)
 
Ooh.. one other thing that would be really awesome is if you said what stakes the tables are.

rubbishaka80 12-19-2006 01:54 AM

Re: Stars Buddy Search (new AHK script)
 
[ QUOTE ]
Nothing indicates that the script is actually running.

[/ QUOTE ]
You should at least see the AHK symbol in the tray bar?

Also, there should be error messages, when the line breaks are wrong, so I suppose that part went well.

rubbishaka80 12-19-2006 02:00 AM

Re: Stars Buddy Search (new AHK script)
 
[ QUOTE ]
Is there a way to make your script automatically open the tables your buddies are at?

[/ QUOTE ]

Ok, I added a option to do that.


<font class="small">Code:</font><hr /><pre>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Code begins here ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;------------------------------------------------------------------------------------------------
; Stars Buddy Search v0.2
;------------------------------------------------------------------------------------------------
; Date: 2006-12-19
; AHK version: 1.0.44.14
;------------------------------------------------------------------------------------------------
; Author(s): rubbishaka @ 2+2 forums
; Contact: poker at postsack dot cjb dot net
;------------------------------------------------------------------------------------------------
; changes: add option to open all buddies tables immediately
;
;
;
; credits: wildzer0, handsome, Adde
;------------------------------------------------------------------------------------------------


; Set what hotkeys should start buddy search.
; Leave empty (=) if you don't want to use a hotkey.
; List of available hotkeys: http://www.autohotkey.com/docs/KeyList.htm
sb_hotkey = F9

; Set location of your buddy file here. Relative to the path of the script.
sb_buddyFile = buddies.txt

; opens all tables your buddies are playing on immediately(1) or not (0)
sb_openAllTables=0

;clear search list in pokerstars prior to searching (1) or not (0)
sb_clearSearchList = 0

;_________________________________________________ _______________________________________________
;
; DO NOT EDIT BELOW HERE
;_________________________________________________ _______________________________________________

;;;;;;;;;;;;;;;;;;;;auto-execute;;;;;;;;;;;;;;;;;
#NoEnv
#SingleInstance Ignore
#Persistent

sb_scriptpad_command_header = Buddies
sb_scriptpad_command_name = Find Online Buddies
sb_scriptpad_command_label = sb_OnlineBuddy_Label
sb_scriptpad_command_enabled = 1

ahk_version = 1.0.44.14
if A_AhkVersion &lt; %ahk_version%
{
msgbox, 4,
, This script needs AutoHotkey version %ahk_version% or newer (you are using version %A_AhkVersion%)
. Script will exit`n`nGo to web page and download new version now?
IfMsgBox, Yes
Run, http://www.autohotkey.com
ExitApp
}
Hotkey, %sb_hotkey%, sb_OnlineBuddy_Label, UseErrorLevel
goto sb_Scriptpad_End

;;;;;;;;;;;;;;;labels;;;;;;;;;;;;;;
sb_FindBuddy_Label:
sb_FindBuddy()
return

sb_Delete_Label:
sb_ClearSearchList()
return

sb_OnlineBuddy_Label:
if (sb_clearSearchList=1)
sb_ClearSearchList()
sb_OnlineBuddy()

return

Open:
ControlGet, tableNumber, choice,,combobox%A_GuiControl%

sb_openTablesForBuddy(names%A_GuiControl%,tableNum ber)
return

CloseGui:
gui, destroy

return
;;;;;;;;;;;;;;;functions;;;;;;;;;;;;;
sb_checkPokerstarsIsRunning()
{
Process, Exist, Pokerstars.exe
if (ErrorLevel &lt;&gt; 0)
return (true)

return (false)
}
sb_ClearSearchList()
{
if (not sb_checkPokerstarsIsRunning())
{
msgBox, Pokerstars is not running
return
}
SetTitleMatchMode 1
WinActivate, PokerStars Lobby

Send !r
Send f {Enter}
WinWait, %A_SPACE%Find Player, , 3
WinActivate, %A_SPACE%Find Player
ControlGet, List, List,, ComboBox1
Loop, Parse, List, `n
{
Control, choose, 1, Combobox1
ControlClick, Button3
}

Send, {Esc}
}
sb_FindBuddy()
{

SetTitleMatchMode 1
IfWinNotExist PokerStars Lobby - Logged in
return

InputBox, UserInput, Stars Buddy Search, Enter username to search for.
if ErrorLevel
return
else

InputBox, Index, Stars Buddy Search, How many tables do you want to open?
if ErrorLevel
return
else


sb_openTablesForBuddy(UserInput, Index)

}


sb_openTablesForBuddy(UserInput, Index)
{

Tables := 0
sleep, 100
Loop %Index%
{
SetTitleMatchMode 1
WinActivate, PokerStars Lobby
WinwaitActive, PokerStars Lobby


Send !r
Send f {Enter}
Send, %UserInput% {Enter}

WinWait, %A_SPACE%Find Player, , 3
WinActivate, %A_SPACE%Find Player
Send {Tab}{Tab}

Loop %Tables%
{
Send {Down}
Sleep 100
}
Tables++
Send {Enter}
Sleep 500

}
}


sb_onlineBuddy()
{
global sb_buddyFile
global tablelist
global namelist
global sb_openalltables



if (not sb_checkPokerstarsIsRunning())
{
msgBox, Pokerstars is not running
return
}


ifnotexist, %sb_buddyFile%
{
msgBox, Buddy File "%sb_buddyFile%" not found
return
}
Loop, Read, %sb_buddyFile%
{

SetTitleMatchMode, 2
IfWinExist PokerStars Lobby
{
WinActivate
winwaitactive, PokerStars Lobby
}
else
return

Send, !r
Sleep, 10
Send, f {Enter}

Send, %A_LoopReadLine% {Enter}

Loop
{
Sleep, 100
IfWinExist, PokerStars, Not Found
{
Send, {Enter}
break
}

ifWinExist, Find Player


{
number:=countTables()
Send, {Esc}

if (sb_openAllTables=1)
{

sb_openTablesForBuddy(A_LoopReadLine,number)

}
else
{

namelist=%namelist%%A_LoopReadLine%|
tableList=%tablelist%%number%|
}

break
}
}

}
if (sb_openAllTables=0)
{

sb_buildGui()
}
}

countTables()
{
WinActivate, Find Player
send {down}
send {down}
number:=1

loop
{
send {down}
y:=(number*13)+44

PixelGetColor, color, 200, %y%

if color=0xffffff
{
number++
}
else
{
break
}
}
return number
}
sb_buildGUI()
{


global

StringSplit, names, namelist, |
StringSplit, tables, tablelist, |
arraycount=% names0-1

if (arraycount &lt;1)
{
msgbox, No one online :-(
return
}



loop,%ArrayCount%
Gui, Add, Text,, % names%A_Index%

gui, add, button,gCloseGui,close

loop,%ArrayCount%
{

strNumber:=""
loop, % tables%A_Index%
strNumber=%strNumber%%A_Index%|
strNumber=%strNumber%|

if (A_Index=1)
Gui, Add, DropDownList, ym w40, %strNumber%
else
Gui, Add, DropDownList,w40, %strNumber%

}

loop,%ArrayCount%
{

if (A_Index=1)
Gui, Add, Button,v%A_Index% ym gOpen, Open Tables
else
Gui, Add, Button,v%A_Index% gOpen, Open Tables
}
Gui, Show,,Stars Buddy Search v0.2
return
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; scriptpad ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

sb_Scriptpad_End:
; Do nothing. This is needed to work with Scriptpad.

</pre><hr />

rubbishaka80 12-19-2006 02:03 AM

Re: Stars Buddy Search (new AHK script)
 
[ QUOTE ]
Ooh.. one other thing that would be really awesome is if you said what stakes the tables are.

[/ QUOTE ]

That's nearly impossible, unfortunately.

NoahSD 12-19-2006 03:59 AM

Re: Stars Buddy Search (new AHK script)
 
I tried running it while playing, and if a table pops up while it's searching, it types a few screen names in the chat box and then it freezes.

Dunno how you'd fix this tho.

sheetsworld 12-19-2006 12:51 PM

Re: Stars Buddy Search (new AHK script)
 
I have the same problem in that I cant get it to even run...no icon on bottom right...nothing:(


sheets

Gregg777 12-19-2006 02:19 PM

Re: Stars Buddy Search (new AHK script)
 
Thanks for the open function.

Is there a way to set it to just run automatically and open the tables automatically?

For everyone having trouble, I got everything to work just fine.

People may be having trouble copying the code directly into a text file.

I tried this and it was not formatted properly.

I saved it to WordPad, then copied to a text file and it worked.

wildzer0 12-19-2006 10:02 PM

Re: Stars Buddy Search (new AHK script)
 
very nice!

Addiction 12-19-2006 10:10 PM

Re: Stars Buddy Search (new AHK script)
 
block em.

Bowlboy 12-20-2006 12:33 AM

Re: Stars Buddy Search (new AHK script)
 
[ QUOTE ]

People may be having trouble copying the code directly into a text file.

I tried this and it was not formatted properly.

I saved it to WordPad, then copied to a text file and it worked.

[/ QUOTE ]

Thank you very much for this help. I felt so stupid and started getting the impression that maybe the author thought I was just too dumb to get this script to work but I did as you suggested with Microsoft Word instead of notepad and it worked out fine for me.

Nice script. Thanks a bunch.

rubbishaka80 12-20-2006 05:11 AM

Re: Stars Buddy Search (new AHK script)
 
Hopefully, everyone got it to run with the tip from greg777.

[ QUOTE ]
Is there a way to set it to just run automatically and open the tables automatically?


[/ QUOTE ]
Sorry, I don't understand what you want. Could you explain?

[ QUOTE ]
I tried running it while playing, and if a table pops up while it's searching, it types a few screen names in the chat box and then it freezes.


[/ QUOTE ]
Don't try this while playing [img]/images/graemlins/wink.gif[/img] Or you could turn off the auto popup option.

ItzMrFish2U 12-20-2006 01:22 PM

Re: Stars Buddy Search (new AHK script)
 
This rocks! I just got it to work. Thanks much for sharing!

davidwilcock 12-20-2006 01:31 PM

Re: Stars Buddy Search (new AHK script)
 
What does this mean?

Error: The same variable cannot be used for more than one control per window. The current thread will exit.

Specifically: v1

Line#
---&gt; 323: Gui,Add,Button,v%a_index% ym gOpen,Open Tables

Bowlboy 12-20-2006 11:44 PM

Re: Stars Buddy Search (new AHK script)
 
[ QUOTE ]
What does this mean?

Error: The same variable cannot be used for more than one control per window. The current thread will exit.

Specifically: v1

Line#
---&gt; 323: Gui,Add,Button,v%a_index% ym gOpen,Open Tables

[/ QUOTE ]
I have no idea. I got the same thing two twice but each time I closed AHK and reopened it and it worked fine again.

rubbishaka80 12-20-2006 11:50 PM

Re: Stars Buddy Search (new AHK script)
 
[ QUOTE ]
What does this mean?

Error: The same variable cannot be used for more than one control per window. The current thread will exit.

Specifically: v1

Line#
---&gt; 323: Gui,Add,Button,v%a_index% ym gOpen,Open Tables

[/ QUOTE ]
Can somebody describe when exactly this error occurred? Is it reproduceable?

jsnipes28 12-21-2006 02:09 AM

Re: Stars Buddy Search (new AHK script)
 
I appreciate you doing this however:
[ QUOTE ]
Don't try this while playing Or you could turn off the auto popup option.

[/ QUOTE ]

The script is not going to be very useful if it does not work while you are playing.

NoahSD 12-21-2006 03:21 AM

Re: Stars Buddy Search (new AHK script)
 
Oh.. why don't you make the script turn of auto popup at first and then turn it back on when it's finished?

rubbishaka80 12-21-2006 10:50 AM

Re: Stars Buddy Search (new AHK script)
 
[ QUOTE ]
What does this mean?

Error: The same variable cannot be used for more than one control per window. The current thread will exit.

Specifically: v1

Line#
---&gt; 323: Gui,Add,Button,v%a_index% ym gOpen,Open Tables

[/ QUOTE ]
Apparently, this comes up, when you search twice and don't close the GUI in between. Should be easy to fix.

rubbishaka80 12-21-2006 10:54 AM

Re: Stars Buddy Search (new AHK script)
 
[ QUOTE ]
Oh.. why don't you make the script turn of auto popup at first and then turn it back on when it's finished?

[/ QUOTE ]
Yeah, I thought about this, it would be doable.

You still could not play i.e. click on tables, while the search runs...

davidwilcock 12-21-2006 02:09 PM

Re: Stars Buddy Search (new AHK script)
 
[ QUOTE ]
[ QUOTE ]
What does this mean?

Error: The same variable cannot be used for more than one control per window. The current thread will exit.

Specifically: v1

Line#
---&gt; 323: Gui,Add,Button,v%a_index% ym gOpen,Open Tables

[/ QUOTE ]
Apparently, this comes up, when you search twice and don't close the GUI in between. Should be easy to fix.

[/ QUOTE ]

Cool, cheers and many thanks for this

rubbishaka80 12-23-2006 11:47 PM

Re: Stars Buddy Search (new AHK script)
 
[ QUOTE ]
Oh.. why don't you make the script turn of auto popup at first and then turn it back on when it's finished?

[/ QUOTE ]
I added an option to do exactly this plus some bug fixes.

<font class="small">Code:</font><hr /><pre> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Code begins here ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;------------------------------------------------------------------------------------------------
; Stars Buddy Search v0.3
;------------------------------------------------------------------------------------------------
; Date: 2006-12-19
; AHK version: 1.0.44.14
;------------------------------------------------------------------------------------------------
; Author(s): rubbishaka80 @ 2+2 forums
; Contact: poker at postsack dot cjb dot net
;------------------------------------------------------------------------------------------------
; changes: add option to open all buddies tables immediately
; add temporarily turn-off of auto popup
;
;
; credits: wildzer0, handsome, Adde
;------------------------------------------------------------------------------------------------


; Set what hotkeys should start buddy search.
; Leave empty (=) if you don't want to use a hotkey.
; List of available hotkeys: http://www.autohotkey.com/docs/KeyList.htm
sb_hotkey = F9

; If you use the auto popup tables option in the PokerStars software, it greatly interferes
; with this script. Therefore this script deactivates the option. If you want to re-activate
; it afterwards, set this value to 1. If you don't use the option at all, set this value to 0.
sb_useAutoPopup = 1

; Set location of your buddy file here. Relative to the path of the script.
sb_buddyFile = buddies.txt

; opens all tables your buddies are playing on immediately(1) or not (0)
sb_openAllTables=0

;clear search list in pokerstars prior to searching (1) or not (0)
sb_clearSearchList = 0

;_________________________________________________ _______________________________________________
;
; DO NOT EDIT BELOW HERE
;_________________________________________________ _______________________________________________

;;;;;;;;;;;;;;;;;;;;auto-execute;;;;;;;;;;;;;;;;;
#NoEnv
#SingleInstance Ignore
#Persistent

sb_scriptpad_command_header = Buddies
sb_scriptpad_command_name = Find Online Buddies
sb_scriptpad_command_label = sb_OnlineBuddy_Label
sb_scriptpad_command_enabled = 1

ahk_version = 1.0.44.14
if A_AhkVersion &lt; %ahk_version%
{
msgbox, 4,
, This script needs AutoHotkey version %ahk_version% or newer (you are using version %A_AhkVersion%)
. Script will exit`n`nGo to web page and download new version now?
IfMsgBox, Yes
Run, http://www.autohotkey.com
ExitApp
}
Hotkey, %sb_hotkey%, sb_OnlineBuddy_Label, UseErrorLevel

goto sb_Scriptpad_End

;;;;;;;;;;;;;;;labels;;;;;;;;;;;;;;




sb_FindBuddy_Label:
sb_FindBuddy()
return

sb_Delete_Label:
sb_ClearSearchList()
return

sb_OnlineBuddy_Label:
if (sb_clearSearchList=1)
sb_ClearSearchList()
sb_OnlineBuddy()

return

sb_Open:
ControlGet, tableNumber, choice,,combobox%A_GuiControl%

sb_openTablesForBuddy(names%A_GuiControl%,tableNum ber)
return

sb_CloseGui:
sb_CloseGui()
return
;;;;;;;;;;;;;;;functions;;;;;;;;;;;;;
sb_EnablePopups(enable)
{
if (not sb_checkPokerstarsIsRunning())
{
msgBox, Pokerstars is not running
return
}
SetTitleMatchMode 1
WinActivate, PokerStars Lobby
WinwaitActive, PokerStars Lobby

WinMenuSelectItem, PokerStars Lobby ,, Options, Advanced Multi

WinActivate, Advanced
WinwaitActive, Advanced

ControlGet, vH, checked, , Button3
if (vH=1)
{
if (enable=false)
{
ControlClick, Button3
}

}
else
{
if (enable=true)
{
ControlClick, Button3
}
}
ControlClick, Button1

}
sb_CloseGui()
{
gui, destroy

return
}
sb_checkPokerstarsIsRunning()
{
Process, Exist, Pokerstars.exe
if (ErrorLevel &lt;&gt; 0)
return (true)

return (false)
}
sb_ClearSearchList()
{
if (not sb_checkPokerstarsIsRunning())
{
msgBox, Pokerstars is not running
return
}
SetTitleMatchMode 1
WinActivate, PokerStars Lobby
WinwaitActive, PokerStars Lobby

WinMenuSelectItem, PokerStars Lobby ,, Requests, Find a Player


WinWait, %A_SPACE%Find Player, , 3
WinActivate, %A_SPACE%Find Player
WinWaitActive, %A_SPACE%Find Player

ControlGet, List, List,, ComboBox1
Loop, Parse, List, `n
{
Control, choose, 1, Combobox1
ControlClick, Button3
}

Send, {Esc}
}
sb_FindBuddy()
{

SetTitleMatchMode 1
IfWinNotExist PokerStars Lobby - Logged in
return

InputBox, UserInput, Stars Buddy Search, Enter username to search for.
if ErrorLevel
return
else

InputBox, Index, Stars Buddy Search, How many tables do you want to open?
if ErrorLevel
return
else


sb_openTablesForBuddy(UserInput, Index)

}


sb_openTablesForBuddy(UserInput, Index)
{

Tables := 0
sleep, 100
Loop %Index%
{
SetTitleMatchMode 1
WinActivate, PokerStars Lobby
WinwaitActive, PokerStars Lobby

WinMenuSelectItem, PokerStars Lobby ,, Requests, Find a Player
Send, %UserInput% {Enter}

WinWait, %A_SPACE%Find Player, , 3
WinActivate, %A_SPACE%Find Player
WinWaitActive,%A_SPACE%Find Player
Send {Tab}{Tab}

Loop %Tables%
{
Send {Down}
Sleep 100
}
Tables++
Send {Enter}
Sleep 500

}
}


sb_onlineBuddy()
{
global sb_buddyFile
global tablelist
global namelist
global sb_openalltables
global sb_useAutoPopup
tablelist=
namelist=

sb_CloseGui()
sb_enablePopups(false)

if (not sb_checkPokerstarsIsRunning())
{
msgBox, Pokerstars is not running
return
}


ifnotexist, %sb_buddyFile%
{
msgBox, Buddy File "%sb_buddyFile%" not found
return
}
Loop, Read, %sb_buddyFile%
{

SetTitleMatchMode 1
WinActivate, PokerStars Lobby
WinwaitActive, PokerStars Lobby

WinMenuSelectItem, PokerStars Lobby ,, Requests, Find a Player
WinWait, %A_SPACE%Find Player, , 3
WinActivate, %A_SPACE%Find Player
Send, %A_LoopReadLine% {Enter}

Loop
{
Sleep, 100
IfWinExist, PokerStars, Not Found
{
Send, {Enter}
break
}

ifWinExist, %A_SPACE%Find Player


{
number:=countTables()
Send, {Esc}

if (sb_openAllTables=1)
{

sb_openTablesForBuddy(A_LoopReadLine,number)

}
else
{

namelist=%namelist%%A_LoopReadLine%|
tableList=%tablelist%%number%|
}

break
}
}

}
if (sb_useAutoPopup=1)
{
sb_enablePopups(true)
}

if (sb_openAllTables=0)
{

sb_buildGui()
}



}

countTables()
{
WinActivate, Find Player
send {down}
send {down}
number:=1

loop
{
send {down}
y:=(number*13)+44

PixelGetColor, color, 200, %y%

if color=0xffffff
{
number++
}
else
{
break
}
}
return number
}
sb_buildGUI()
{


global

StringSplit, names, namelist, |
StringSplit, tables, tablelist, |
arraycount=% names0-1

if (arraycount &lt;1)
{
msgbox, No one online :-(
return
}



loop,%ArrayCount%
Gui, Add, Text,, % names%A_Index%

gui, add, button,gsb_CloseGui,close

loop,%ArrayCount%
{

strNumber:=""
loop, % tables%A_Index%
strNumber=%strNumber%%A_Index%|
strNumber=%strNumber%|

if (A_Index=1)
Gui, Add, DropDownList, ym w40, %strNumber%
else
Gui, Add, DropDownList,w40, %strNumber%

}

loop,%ArrayCount%
{

if (A_Index=1)
Gui, Add, Button,v%A_Index% ym gsb_Open, Open Tables
else
Gui, Add, Button,v%A_Index% gsb_Open, Open Tables
}
Gui, Show,,Stars Buddy Search v0.3
return
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; scriptpad ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

sb_Scriptpad_End:
; Do nothing. This is needed to work with Scriptpad.

</pre><hr />

semipro50 12-25-2006 04:40 PM

Re: Stars Buddy Search (new AHK script)
 
This look like a very useful tool. I have tried to set this up but I seem to be doing something wrong. Would some one please provided me step by step instructions so I can use this script.

Thank you in advance

rubbishaka80 12-26-2006 09:38 PM

Re: Stars Buddy Search (new AHK script)
 
Step-by-step:

1. download &amp; install ahk from autohotkey.com
2. on your desktop: right click -&gt; new -&gt; ahk script; give some name i.e buddysearch.ahk
3. right click on buddysearch.ahk -&gt; edit script
4. copy from message to editor (make sure you get everything in the code environment)
5. save &amp; exit
6. start pokerstars &amp; login
7. double click script
7b press F9

At least you should be told now, that the file buddies.txt is missing [img]/images/graemlins/wink.gif[/img]

8. create a textfile, name it buddies.txt, enter all your buddies - one line for each
9. save &amp; exit
10. press F9

Hope this helps.

Paul B. 12-26-2006 11:05 PM

Re: Stars Buddy Search (new AHK script)
 
Oh yea I got credits [img]/images/graemlins/grin.gif[/img] Nice script [img]/images/graemlins/wink.gif[/img]

PIMP1111 12-28-2006 01:38 PM

Re: Stars Buddy Search (new AHK script)
 
This is great! There is one problem though. When my buddies are sitting at more then one table, I can't get the script to open to tables. "1" is selected for every column. Even for the buddies that re multitabling. Any way to fix this?

scans 12-28-2006 04:43 PM

Re: Stars Buddy Search (new AHK script)
 
Nice automation! For those people looking to open the tables of those playing in TOURNAMENTS, as opposed to regular tables, I have written a script (easily integrated with this one) that uses screen based OCR to find your buddy's table in the tourney lobby and load it. I have tested it on tournaments with 10,000 people and it finds the buddy very quickly. I will try to post this soon...

rubbishaka80 12-28-2006 05:45 PM

Re: Stars Buddy Search (new AHK script)
 
[ QUOTE ]
This is great! There is one problem though. When my buddies are sitting at more then one table, I can't get the script to open to tables. "1" is selected for every column. Even for the buddies that re multitabling. Any way to fix this?

[/ QUOTE ]

Usually, the script should find out, how many tables your buddies are at. It does so by checking the color of a pixel beside the name in the find window. This pixel should be white after the selection bar is moved down.

http://img294.imageshack.us/img294/5...dplayersc7.jpg

So when your search window looks differently, there's not much that can be done.

semipro50 12-28-2006 05:55 PM

Re: Stars Buddy Search (new AHK script)
 
Still not making much progess. Tried to follow your step by step instructions but still no luck.

Maybe my problem is with step 4. Not sure what a code environment is. Any further help would be greatly appreaciated. If you get this to work I will give you my list of buddies [img]/images/graemlins/laugh.gif[/img]

rubbishaka80 12-28-2006 05:59 PM

Re: Stars Buddy Search (new AHK script)
 
With code environment I meant everything between those horizontal lines.

<font class="small">Code:</font><hr /><pre>This is all in a code environment</pre><hr />

semipro50 12-28-2006 06:44 PM

Re: Stars Buddy Search (new AHK script)
 
Finally got it work. Problem seemed to be the comment ; were missing on several lines. I added these and all is good. Thanks for help and the program

Pete

PIMP1111 12-28-2006 11:10 PM

Re: Stars Buddy Search (new AHK script)
 
Hmm ... my search window looks just like that. :/

steel108 12-30-2006 07:48 PM

Re: Stars Buddy Search (new AHK script)
 
Can someone add this to overcards? Copying for 2+2 to wordpad and transfering over is not working. I just spent 45 minutes manually changing the script, but it' not working.

rubbishaka80 12-30-2006 08:00 PM

Re: Stars Buddy Search (new AHK script)
 
[ QUOTE ]
Can someone add this to overcards? Copying for 2+2 to wordpad and transfering over is not working. I just spent 45 minutes manually changing the script, but it' not working.

[/ QUOTE ]

Here you go.
http://overcards.com/wiki/moin.cgi/StarsBuddyFinder


All times are GMT -4. The time now is 05:35 PM.

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