AutoHotkey Community

It is currently May 26th, 2012, 10:24 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: October 28th, 2009, 12:13 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2009, 12:26 am 
Offline

Joined: April 17th, 2007, 1:37 pm
Posts: 761
Location: Florida
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!]
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: AndyJenk, Google [Bot], JSLover, Leef_me, Miguel, patgenn123, rbrtryn, Yahoo [Bot] and 72 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group