 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
jason4141 Guest
|
Posted: Tue Oct 27, 2009 11:13 pm Post subject: Requesting help modifying a function |
|
|
Hi. I am trying to modify a function on a poker script..
This functions purpose is to gather information from a window that says how many 'tournaments' the user is registered in.
| Code: |
CountTourneys() {
global
WinMenuSelectItem, PokerStars Lobby,, Requests, Registered In Tournaments
WinWait, Registered In Tournaments ahk_class #32770, , 10
WinGet, ritw, id
ControlGetText, nf, Button1, ahk_id%ritw%
If (nf = "OK")
{
ControlFocus, Button1, ahk_id%ritw%
Sleep, -1
ControlSend, Button1, {Space}, ahk_id%ritw%
{
If (minlob=1)
WinMinimize, PokerStars Lobby
}
Return 0
}
ControlGet, Tlist, List,, ListBox1, ahk_id%ritw%
ControlFocus, Button2, ahk_id%ritw%
Sleep, -1
ControlSend, Button2, {Space}, ahk_id%ritw%
{
If (minlob=1)
WinMinimize, PokerStars Lobby
}
StringSplit, tlist, tlist, `n
If (tlist0 > 4)
trows:=tlist0
GuiControl, , trows, %trows%
Loop %tlist0%
{
t:=tlist%A_index%
If A_index=1
LV_Delete()
LV_Add("", t)
LV_ModifyCol()
LV_DeleteCol(2)
}
Gui, show, NoActivate, %thisahk%
Return tlist0
}
|
I would like to have this function, CountTourneys(), only count 'tournaments' that contain certain text in their names.
What commands to I need? And my real confusion is 'where to stick' those commands. |
|
| Back to top |
|
 |
Rhys
Joined: 17 Apr 2007 Posts: 758 Location: Florida
|
Posted: Tue Oct 27, 2009 11:26 pm Post subject: |
|
|
Totally untested:
| Code: | CountTourneys() {
global
WinMenuSelectItem, PokerStars Lobby,, Requests, Registered In Tournaments
WinWait, Registered In Tournaments ahk_class #32770, , 10
WinGet, ritw, id
ControlGetText, nf, Button1, ahk_id%ritw%
If (nf = "OK")
{
ControlFocus, Button1, ahk_id%ritw%
Sleep, -1
ControlSend, Button1, {Space}, ahk_id%ritw%
{
If (minlob=1)
WinMinimize, PokerStars Lobby
}
Return 0
}
ControlGet, Tlist, List,, ListBox1, ahk_id%ritw%
ControlFocus, Button2, ahk_id%ritw%
Sleep, -1
ControlSend, Button2, {Space}, ahk_id%ritw%
{
If (minlob=1)
WinMinimize, PokerStars Lobby
}
StringSplit, tlist, tlist, `n
If (tlist0 > 4)
{
runninglist:=
key=(running)
trows:=tlist0
loop,tlist0
ifinstring,key,% tlist%A_Index%
{
runninglist.=tlist%A_Index% . "`n"
}
Msgbox,Currently Running:`n`n %runninglist%
}
GuiControl, , trows, %trows%
Loop %tlist0%
{
t:=tlist%A_index%
If A_index=1
LV_Delete()
LV_Add("", t)
LV_ModifyCol()
LV_DeleteCol(2)
}
Gui, show, NoActivate, %thisahk%
Return tlist0
} |
_________________ [Join IRC!]
 |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|