Open Side Menu Go to the Top
Register
"USD" Killed AHK's on PS's.. Please Help "USD" Killed AHK's on PS's.. Please Help

09-14-2009 , 11:31 AM
In the StarsReads.ahk thread listed below, I would appreciate any talented ahk coders to try and fix what I "think" is a quick fix if I knew what I was doing, or knew AHK coding.

http://forumserver.twoplustwo.com/45...6/index23.html

Ever since the update to table names/HH's that included the "USD" it broke the script. I am sure it's a simple "search and replace" of some kind to recognize the USD in both the title and HH opening line itself. I've had several people who have light knowledge of other coding say if they knew AHK, this should be an easy fix. Any volunteers? This program has worked great for a couple years of updates, until now.

TIA,
Dog
"USD" Killed AHK's on PS's.. Please Help Quote
09-14-2009 , 09:28 PM
Ugh I've been slow to get back in to doing stuff since returning from holidays - I'll get this one sorted tomorrow. Yeah this should be an easy fix
"USD" Killed AHK's on PS's.. Please Help Quote
09-14-2009 , 11:44 PM
Quote:
Originally Posted by _dave_
Ugh I've been slow to get back in to doing stuff since returning from holidays - I'll get this one sorted tomorrow. Yeah this should be an easy fix
thanks.. it's the only thing keeping me from using the latest update. I've got it working, but on a previous PS version right before the USD update. Hope you had a nice holiday...

Dog
"USD" Killed AHK's on PS's.. Please Help Quote
09-17-2009 , 12:33 PM
Quote:
Originally Posted by _dave_
Ugh I've been slow to get back in to doing stuff since returning from holidays - I'll get this one sorted tomorrow. Yeah this should be an easy fix
Any luck fixing this, Dave? I know you are slammed with requests, and I do appreciate you looking at it.

Dog
"USD" Killed AHK's on PS's.. Please Help Quote
09-24-2009 , 02:59 AM
Quote:
Originally Posted by 1meandog4u
Any luck fixing this, Dave? I know you are slammed with requests, and I do appreciate you looking at it.

Dog
bump
"USD" Killed AHK's on PS's.. Please Help Quote
10-01-2009 , 11:36 AM
There has to be someone out there that knows AHK scripts that could take a quick look at this program and see a quick fix. It just needs to be told that "USD" is acceptable. Even the author thought it would be simple. Anyone? Please?

Here's the link to where the program is located...

http://www.overcards.com/wiki/moin.cgi/StarsReads
"USD" Killed AHK's on PS's.. Please Help Quote
10-01-2009 , 11:55 AM
Quote:
Originally Posted by 1meandog4u
There has to be someone out there that knows AHK scripts that could take a quick look at this program and see a quick fix. It just needs to be told that "USD" is acceptable. Even the author thought it would be simple. Anyone? Please?

Here's the link to where the program is located...

http://www.overcards.com/wiki/moin.cgi/StarsReads
Post an old (ie: pre "USD") and new hand history and I'll see if I can work out which line(s) need changing later (about to start playing poker so it might be tomorrow before I get chance though).

Juk
"USD" Killed AHK's on PS's.. Please Help Quote
10-01-2009 , 01:07 PM
Quote:
Originally Posted by jukofyork
Post an old (ie: pre "USD") and new hand history and I'll see if I can work out which line(s) need changing later (about to start playing poker so it might be tomorrow before I get chance though).

Juk
There are many users that will appreciate you looking into this, and not to worry about the time. We've had this broken since that update I spoke of, and that was nearly two months ago now. A few more days seems great to me. If this is not enough, let me know and I'll post the whole hand history. Here's the two header lines from the SAME hand since I have the original and requested the same history from Stars, but it has the updated line. Thanks again and I hope the poker gods smile on you today...

Pre-update:

PokerStars Game #33094616768: Omaha Hi/Lo Pot Limit ($0.05/$0.10) - 2009/09/20 22:15:55 PT [2009/09/21 1:15:55 ET]

Post-update

PokerStars Game #33094616768: Omaha Hi/Lo Pot Limit ($0.05/$0.10 USD) - 2009/09/20 22:15:55 PT [2009/09/21 1:15:55 ET]

I might note here, since I can't get a copy of it, that the file "should" probably be able to accept "EUR" in the same position as the "USD" as there are European friends that might have their hand histories with that slight difference. But USD is the most important issue for the majority.

AND... here's the actual script I use personally in hopes that you can see it without having to download and unzip the original...

HTML Code:
#NoEnv
SendMode Input
#Persistent
#SingleInstance, Force
SetTitleMatchMode, 2

ignore_hero := 0

pathStars := A_ProgramFiles . "\PokerStars"

hhpath := pathStars . "\HandHistory"



GroupAdd, StarsTables, Logged In as ,,, PokerStars Lobby
SetTimer, UpdateTables, 1000


tables := ""
SysGet, border, 32
SysGet, caption, 4
timezone_difference_EST := "-5"


OnExit, ExitSub

return


;OnMessage(0x0F, "testmsg")


ExitSub:
DetectHiddenWindows, On
SetTitleMatchMode 2
WinGet, alreadyopen, list, _StarsReads_
Loop, %alreadyopen%
{
  id := alreadyopen%A_Index%
  WinKill, ahk_id%id%
}
ExitApp
return

getTables()
{
  global tables
  global screenname
  global hero
  
  tables := ""
  SetTitleMatchMode 2
  WinGet, id, id, PokerStars Lobby
  
  SetTitleMatchMode 2
  WinGet, id, id, PokerStars Lobby
  WinGetTitle, hero, ahk_id%id%
  StringTrimLeft, hero, hero, InStr(hero, "Logged in as ", true, 0)+12
  screenname := hero
  StringReplace, hero, hero, %A_SPACE%,, All
  ;Msgbox, %hero%
  
  WinGet, pid, PID, ahk_id%id%
  WinGet, list, list, Logged In as ahk_pid%pid% 
  Loop %list%
  {
    this_id := list%a_index%
    WinGetTitle, title, ahk_id%this_id%
    If (this_id != id)
    {
      tables = %tables%,%this_id%
    }
  }
  StringTrimLeft, tables, tables, 1
}



UpdateTables:
  getTables()
  
  Loop, Parse, tables, `,
  {
    DetectHiddenWindows, On
    WinGet, alreadyopen, id, _StarsReads_%A_LoopField%.ahk 
    if (alreadyopen)
    {
      ;WinGetTitle, title, ahk_id%alreadyopen%
      continue
    }
    else
    {
      str := "#NoEnv`n"
      str := "#NoTrayIcon`n"
      str := str . "table_id := """ . A_LoopField . """`n"
      str := str . "ignore_hero := """ . ignore_hero . """`n"
      str := str . "pathStars := """ . pathStars . """`n"
      str := str . "timezone_difference_EST := """ . timezone_difference_EST . """`n"
      str := str . "hero := """ . hero . """`n"
      
      str := str . "SetTimer, updatepos, 1000`n"
      str := str . "SetTimer, killonexit, 1000`n"
      str := str . "SysGet, border, 32`n"
      str := str . "SysGet, caption, 4`n"
      str := str . "OnMessage(0x201, ""WM_LBUTTONDOWN"")`n"
      str := str . "OnMessage(0x204, ""WM_RBUTTONDOWN"")`n"
      str := str . "return`n"
      str := str . "killonexit:`n"
      str := str . "  IfWinNotExist, ahk_id%table_id%`n"
      str := str . "  {`n"
      str := str . "    ExitApp`n"
      str := str . "  }`n"
      str := str . "  WinGetTitle, title, ahk_id%table_id%`n"
      str := str . "  StringTrimRight, title, title, (StrLen(title) - Instr(title, "" - "", true, 0))+1`n"
      str := str . "  est := A_NowUTC`n"
      str := str . "  est += " . timezone_difference_EST . ", hours`n"
      str := str . "  FormatTime, est, %est%, yyyyMMdd`n"
      str := str . "  filename := """ . hhpath . "\" . hero . "\HH"" . est . "" "" . title . "".txt""`n"
      str := str . "  StringReplace, filename, filename, /, -, All`n"
      str := str . "  FileGetSize, fsize, %filename%`n"
      str := str . "  if (fsize)`n"
      str := str . "  {`n"
      str := str . "    FileGetTime, ftime, %filename%`n"
      str := str . "    if (ftime > oldftime)`n"
      str := str . "    {`n"
      str := str . "      Sleep, 40`n"
      str := str . "      oldftime := ftime`n"
      str := str . "      FileRead, hh, %filename%`n"
      str := str . "      StringTrimLeft, hh, hh, Instr(hh, ""PokerStars Game #"", true, 0)-1`n"
      str := str . "      SeatsNamesStars(hh)`n"
      str := str . "      updatehud()`n"
      ;str := str . "      Msgbox, %st%`n"      
      str := str . "    }`n"
      str := str . "  }`n"
      str := str . "  else`n"
      str := str . "  {`n"
      str := str . "    WinGetTitle, title, ahk_id%table_id%`n"
      str := str . "    StringTrimLeft, title, title, Instr(title, "" "")`n"
      str := str . "    StringTrimRight, title, title, (StrLen(title) - Instr(title, "" ""))+1`n"
      str := str . "    hhfpath := """ . hhpath . "\" . hero . """`n"
      str := str . "    Loop, %hhfpath%\HH*T%title%*.TXT`n"
      str := str . "    {`n"
      str := str . "      filelist = %filelist%%A_LoopFileTimeModified%`t%A_LoopFileName%`n"
      str := str . "    }`n"
      str := str . "    Sort, filelist, N R`n"
      ;Msgbox, %filelist%
      str := str . "    Loop, parse, filelist, ``n`n"
      str := str . "    {`n"
      str := str . "      if A_LoopField =`n"
      str := str . "        continue`n"
      str := str . "      StringTrimLeft, filename, A_LoopField, Instr(A_LoopField, ""`t"")`n"
      str := str . "      filename := hhfpath . ""\"" . filename`n"
      str := str . "      FileGetSize, fsize, %filename%`n"
      str := str . "      if (fsize)`n"
      str := str . "      {`n"
      str := str . "        FileGetTime, ftime, %filename%`n"
      str := str . "        break`n"
      str := str . "      }`n"
      str := str . "    }`n"
      str := str . "    if (ftime > oldftime)`n"
      str := str . "    {`n"
      str := str . "      Sleep, 40`n"
      str := str . "      oldftime := ftime`n"
      str := str . "      FileRead, hh, %filename%`n"
      str := str . "      StringTrimLeft, hh, hh, Instr(hh, ""PokerStars Game #"", true, 0)-1`n"
      str := str . "      SeatsNamesStars(hh)`n"
      str := str . "      updatehud()`n"
      str := str . "    }`n"
      str := str . "  }`n"
      ;str := str . "  }`n"
      str := str . "Sleep, 40`n"
      str := str . "return`n"
      
     
      FileRead, fns, %A_ScriptFullPath%
      StringTrimLeft, fns, fns, InStr(fns, ";-------------- CHOP --------------;", true, 0)
      StringTrimLeft, fns, fns, InStr(fns, "`n")
      str := str . "`n`n" . fns
      filename := "_StarsReads_" . A_LoopField . ".ahk"
      FileDelete, %filename%
      FileAppend, %str%, %filename%
      Run "AutoHotkey.exe" "/f" %filename%, , , ahkpid
      WinWait, ahk_pid%ahkpid%
      FileDelete, %filename%
      
    }
    
  }
return

;-------------- CHOP --------------;




updatepos:
;updatehud()

return



SetParent(win, gui) { 
  Gui, %gui%: +LastFound
  return DllCall("SetParent", "uint", WinExist(), "uint", win) 
}

testmsg()
{
msgbox, test
}


updatehud()
{
  global

  seat_desc := SeatCountStars(hh)
  if (seat_desc = "six_max")
  {
    max_players = 6
  }
  else if (seat_desc = "nine_max")
  {
    max_players = 9
  }
  else if (seat_desc = "two_max")
  {
    max_players = 2
  }
  else if (seat_desc = "eight_max")
  {
    max_players = 8
  }
  else if (seat_desc = "ten_max")
  {
    max_players = 10
  }
  else
  {
    ;msgbox, fail
    return
  }

  prefseat%max_players% := prefSeatStars(pathStars, max_players)
  
  ;Msgbox, % prefseat%max_players%

  ;msgbox, %hero_seat%
  
  if (prefseat%max_players%>0)
  {
    Loop, %max_players%
    {
      s := A_Index + (hero_seat - prefseat%max_players%)
      if s > %max_players%
        s := s - max_players
      if s < 1
        s := s + max_players
      
      ;msgbox, %A_Index%, st%s%
      
      draw_rect(st%s%, A_Index, max_players)
    }
  
  }
  else
  {
    Loop, %max_players%
    {
      draw_rect(st%A_Index%, A_Index, max_players)
    }
  }
  
  return
}

draw_rect(player="", seat=1, max_players=6, linewidth=8)
{
  global
  ;msgbox %player%
  ;msgbox, %player%, %seat%
  
  if (seat = 10)
  {
    ;Msgbox, sdsa
    seat=
  }
  
  if (player)
  {
    if (ignore_hero && (player = hero))
    {
      Gui %seat%1: Hide
      Gui %seat%2: Hide
      Gui %seat%3: Hide
      Gui %seat%4: Hide
      return
    }
    FileGetSize, fsize, %A_ScriptDir%\players\%player%.ini
    if (fsize)
    {
      IniRead, color, %A_ScriptDir%\players\%player%.ini, color, 1
      ;FileReadLine, color, %A_ScriptDir%\players\%player%.txt, 1
      ;Msgbox, %color%
    }
    else
    {
      FileAppend, [color]`n1=0xFFFFFF, %A_ScriptDir%\players\%player%.ini
      color := 0xFFFFFF
    }
  }
  else
  {
    Gui %seat%1: Hide
    Gui %seat%2: Hide
    Gui %seat%3: Hide
    Gui %seat%4: Hide
    return
  }
      
  6s1x1 = 728
  6s1y1 = 122
  6s1x2 = 731
  6s1y2 = 125
  
  6s2x1 = 769
  6s2y1 = 252
  6s2x2 = 772
  6s2y2 = 255
  
  6s3x1 = 650
  6s3y1 = 364
  6s3x2 = 653
  6s3y2 = 367
  
  6s4x1 = 204
  6s4y1 = 361
  6s4x2 = 207
  6s4y2 = 364
  
  6s5x1 = 81
  6s5y1 = 251
  6s5x2 = 84
  6s5y2 = 254
  
  6s6x1 = 127
  6s6y1 = 122
  6s6x2 = 130
  6s6y2 = 125
  
  
  10s1x1 = 563
  10s1x2 = 566
  10s1y1 = 51
  10s1y2 = 54
  
  10s2x1 = 707
  10s2x2 = 710
  10s2y1 = 106
  10s2y2 = 109
  
  10s3x1 = 777
  10s3x2 = 780
  10s3y1 = 219
  10s3y2 = 222
  
  10s4x1 = 694
  10s4x2 = 697
  10s4y1 = 338
  10s4y2 = 341
  
  10s5x1 = 524
  10s5x2 = 527
  10s5y1 = 390
  10s5y2 = 393
  
  10s6x1 = 346
  10s6x2 = 349
  10s6y1 = 390
  10s6y2 = 393
  
  10s7x1 = 175
  10s7x2 = 178
  10s7y1 = 338
  10s7y2 = 341
  
  10s8x1 = 90
  10s8x2 = 93
  10s8y1 = 219
  10s8y2 = 222
  
  10s9x1 = 160
  10s9x2 = 163
  10s9y1 = 105
  10s9y2 = 108
  
  10s10x1 = 312
  10s10x2 = 315
  10s10y1 = 51
  10s10y2 = 54
  
  9s1x1 = 574
  9s1y1 = 63
  9s1x2 = 577
  9s1y2 = 66
  
  9s2x1 = 750
  9s2y1 = 125
  9s2x2 = 775
  9s2y2 = 130
  
  9s3x1 = 777
  9s3y1 = 244
  9s3x2 = 780
  9s3y2 = 247
  
  9s4x1 = 653
  9s4y1 = 366
  9s4x2 = 656
  9s4y2 = 369
  
  9s5x1 = 433
  9s5y1 = 400
  9s5x2 = 436
  9s5y2 = 403
  
  9s6x1 = 208
  9s6y1 = 359
  9s6x2 = 211
  9s6y2 = 362
  
  9s7x1 = 90
  9s7y1 = 244
  9s7x2 = 93
  9s7y2 = 247
  
  9s8x1 = 134
  9s8y1 = 120
  9s8x2 = 137
  9s8y2 = 123
  
  9s9x1 = 293
  9s9y1 = 63
  9s9x2 = 296
  9s9y2 = 66
  
  8s1x1 = 599
  8s1y1 = 70
  8s1x2 = 602
  8s1y2 = 73
  
  8s2x1 = 770
  8s2y1 = 188
  8s2x2 = 773
  8s2y2 = 191
  
  8s3x1 = 708
  8s3y1 = 327
  8s3x2 = 711
  8s3y2 = 330
  
  8s4x1 = 534
  8s4y1 = 387
  8s4x2 = 537
  8s4y2 = 390
  
  8s5x1 = 314
  8s5y1 = 387
  8s5x2 = 317
  8s5y2 = 390
  
  8s6x1 = 152
  8s6y1 = 325
  8s6x2 = 155
  8s6y2 = 328
  
  8s7x1 = 88
  8s7y1 = 188
  8s7x2 = 91
  8s7y2 = 191
  
  8s8x1 = 265
  8s8y1 = 70
  8s8x2 = 268
  8s8y2 = 73
  
  2s1x1 = 668
  2s1y1 = 255
  2s1x2 = 763
  2s1y2 = 289
  
  2s2x1 = 35
  2s2y1 = 255
  2s2x2 = 128
  2s2y2 = 290
  

  if (seat)
  {
    relStarsClientPoint(table_id, %max_players%s%seat%x1, %max_players%s%seat%y1, rx1, ry1)
    relStarsClientPoint(table_id, %max_players%s%seat%x2, %max_players%s%seat%y2, rx2, ry2)
  }
  else
  {
    relStarsClientPoint(table_id, %max_players%s10x1, %max_players%s10y1, rx1, ry1)
    relStarsClientPoint(table_id, %max_players%s10x2, %max_players%s10y2, rx2, ry2)
  }
  

  ;relStarsClientPoint(table_id, 6s%seat%x1, 6s%seat%y1, rx1, ry1)
  ;relStarsClientPoint(table_id, 6s%seat%x2, 6s%seat%y2, rx2, ry2)
  
  rw := 792
  WinGetPos, , , w, h, ahk_id%table_id%
  linewidth := Round(linewidth * (w/rw))
  
  offset := Round(linewidth /3) 
  
  w := (rx2 - rx1)+linewidth
  h := (ry2 - ry1)+linewidth
  
  rx1 -= offset
  rx2 -= offset
  ry1 -= offset
  ry2 -= offset
  
  ;top
  Gui %seat%1: -Resize -Caption +ToolWindow ;+AlwaysOnTop
  Gui %seat%1: Color, %color%
  Gui %seat%1: Show, x%rx1% y%ry1% w%w% h%linewidth% NoActivate, MinihudStars || %seat% || hwnd:%hud%
  g = %seat%1
  SetParent(table_id, g)
  
  ;bottom
  Gui %seat%2: -Resize -Caption +ToolWindow ;+AlwaysOnTop
  Gui %seat%2: Color, %color%
  Gui %seat%2: Show, x%rx1% y%ry2% w%w% h%linewidth% NoActivate, MinihudStars || %seat% || hwnd:%hud%
  g = %seat%2
  SetParent(table_id, g)

  ;left
  Gui %seat%3: -Resize -Caption +ToolWindow ;+AlwaysOnTop
  Gui %seat%3: Color, %color%
  Gui %seat%3: Show, x%rx1% y%ry1% w%linewidth% h%h% NoActivate, MinihudStars || %seat% || hwnd:%hud%
  g = %seat%3
  SetParent(table_id, g)
  
  ;right
  Gui %seat%4: -Resize -Caption +ToolWindow ;+AlwaysOnTop
  Gui %seat%4: Color, %color%
  Gui %seat%4: Show, x%rx2% y%ry1% w%linewidth% h%h% NoActivate, MinihudStars || %seat% || hwnd:%hud%
  g = %seat%4
  SetParent(table_id, g)
  
}

SeatsNamesStars(hh) {
local i,sn,a
Loop, 10
{
	st%A_Index% = 
}
Loop, Parse, hh, `n
{
  if (A_Index <=2)
  {
    continue
  }
  if ! InStr(a_loopfield, "Seat ", 1)
  {
		break
	}
	s := StrMid(a_loopfield, a_space, ":")
	sn := StrMid(a_loopfield, ": ", " (")
	;Msgbox, %s%, %sn%
	st%s% = %sn%
	if (sn = hero)
	{
    hero_seat := s
    ;msgbox, fgfghfgh`n%hero_seat%
  }
} 
}


relStarsClientPoint(id, x, y, ByRef rx, ByRef ry)
{
  global border
  global caption
  rw := 792
  rh := 546
  WinGetPos, , , w, h, ahk_id%id%
  w := w - (2*border)
  h := h - (2*border) - caption
  
  rx := Floor( ((x) / rw ) * w )
  ry := Floor( ((y) / rh) * h  ) 
  
}

; extracts a substring from between str1 and str2
; I find this function to be convenient and quite powerful
; take a close look at it to see how it works
StrMid(str, str1, str2, sP1=1, sP2=1, cS=0) {
sP1 := ( sP1="" ) ? 1 : sP1
sP2 := ( sP2="" ) ? 1 : sP2
StringTrimLeft, s, str, InStr(str, str1, cS, sP1) + StrLen(str1)-1
StringLeft, s, s, InStr(s, str2, cS, sP2)-1
return s
}

; see http://www.autohotkey.com/forum/viewtopic.php?t=10358&highlight=varize
varize(var, autofix = true) { ; by Titan
   Loop, Parse, var 
   { c = %A_LoopField% 
      x := Asc(c) 
      If (x > 47 and x < 58) or (x > 64 and x < 91) or (x > 96 and x < 123) 
         or c = "#" or c = "_" or c = "@" or c = "$" or c = "?" or c = "[" or c = "]" 
         IfEqual, autofix, 1, SetEnv, nv, %nv%%c% 
         Else er++ 
   } If StrLen(var) > 254 
      IfEqual, autofix, 1, StringLeft, var, var, 254 
      Else er++ 
   IfEqual, autofix, 1, Return, nv 
   Else Return, er 
}

IsStudHHStars(hh) {
If ( InStr(hh, "7 Card Stud Limit")
    || InStr(hh, "7 Card Stud Hi/Lo Limit")
    || InStr(hh, "Badugi Limit")
    || InStr(hh, "Razz Limit") )
  return 1
}

Is6maxHHStars(hh) {
If ( InStr(hh, " 6-max Seat #") )
  return 1
}

IsHeadsUpHHStars(hh) {
If ( InStr(hh, " 2-max Seat #") )
  return 1
}


Is9maxHHStars(hh) {
If ( InStr(hh, " 9-max Seat #") )
  return 1
}

Is10maxHHStars(hh) {
If ( InStr(hh, " 10-max Seat #") )
  return 1
}


SeatCountStars(hh)
{
  seat_desc := ""
  if (Is6maxHHStars(hh))
  {
    seat_desc := "six_max"
  }
  else if (Is9maxHHStars(hh))
  {
    seat_desc := "nine_max"
  }
  else if (Is10maxHHStars(hh))
  {
    seat_desc := "ten_max"
  }
  else if (IsHeadsUpHHStars(hh))
  {
    seat_desc := "two_max"
  }
  else if (IsStudHHStars(hh))
  {
    seat_desc := "eight_max"
  }
  return seat_desc
  
}


WM_RBUTTONDOWN(wParam, lParam)
{
  global
  
  if (StrLen(A_Gui) = 1)
  {
    seat_number = 10
  }
  else
  {
    StringTrimRight, seat_number, A_Gui, 1
  }
  
  if (prefseat%max_players%>0)
  {
    s := seat_number + (hero_seat - prefseat%max_players%)
    if s > %max_players%
      s := s - max_players
    if s < 1
      s := s + max_players
  }
  else
  {
    s := seat_number
  }
  sn := st%s%
  if (sn)
  {
    popup_gui(s, sn)
  }
  
  ;Msgbox %sn%
}

WM_LBUTTONDOWN(wParam, lParam)
{
  ;Msgbox %A_Gui%
}

popup_gui(seat, sn)
{
  if (seat = 10)
  {
    seat=
  }
  
  CoordMode, Mouse, Screen
  MouseGetPos, mx, my
  FileRead, default_colours, %A_ScriptDir%\default_colours.txt
  Gui %seat%5: -Resize +ToolWindow +AlwaysOnTop
  Gui %seat%5: Color, 0x222222
  Gui %seat%5: Font, Bold Underline
  Loop, parse, default_colours, `n
  {
    StringTrimLeft, col_hex, A_Loopfield, InStr(A_LoopField, ",")
    StringTrimRight, col_name, A_LoopField, StrLen(A_loopField) - (InStr(A_LoopField, ",")-1)
    Gui %seat%5: Add, Text, c%col_hex% gSetCol, %col_name% 
  
  }
  Gui %seat%5: Show, x%mx% y%my% w100 NoActivate, %sn%
}

SetCol:
new_col := A_GuiControl
FileRead, default_colours, %A_ScriptDir%\default_colours.txt
Loop, parse, default_colours, `n
{
  StringTrimLeft, col_hex, A_Loopfield, InStr(A_LoopField, ",")
  StringTrimRight, col_name, A_LoopField, StrLen(A_loopField) - (InStr(A_LoopField, ",")-1)
  if (new_col = col_name)
  {
    ;msgbox, %col_hex%
    if (col_hex)
    {
      MouseGetPos, , , id
      WinGetTitle, this_sn, ahk_id%id%
      ;MsgBox, %this_sn%,%col_hex%
      Gui %A_Gui%: Destroy
    }
    col_hex := varize(col_hex)
    IniWrite, %col_hex%, %A_ScriptDir%\players\%this_sn%.ini, color, 1
    break
  }
  
}
updatehud()
return

prefSeatStars(pathStars, max) {
max := max=2 ? 1 : max=6 ? 2 : max=8 ? 3 : max=9 ? 2 : 5
IniRead, seats, % pathStars "\user.ini", Options, SeatPref
StringSplit, seat, seats, % a_space
return seat%max%+1
}


fileSearch(file, dir="", ex="*") {
dir:=dir!="" ? dir : a_workingDir 
Loop %dir%\*.%ex%
  { if InStr(a_loopFileName, file)
      return dir "\" a_loopFileName
  }
}
If you need anything else, just buzz and I'll be glad to post it. I've made a few changes to the "boxes" sizes, but that is not important since I've used it for well over a year with no changes... that stupid update messed a lot of AHK scripts. Have a good one...

Dog
&quot;USD&quot; Killed AHK's on PS's.. Please Help Quote
10-01-2009 , 06:43 PM
I've had a quick look at this and it seems to be a common problem when trying to tie the table's window title to the handhistory file. As a quick workaround you could try adding this line:

Code:
str := str . "  title := RegExReplace(title, ""USD -"", ""- USD"")`n"
BETWEEN these 2 lines:

Code:
str := str . "  FormatTime, est, %est%, yyyyMMdd`n"
str := str . "  filename := """ . hhpath . "\" . hero . "\HH"" . est . "" "" . title . "".txt""`n"
so it looks like this:

Code:
str := str . "  FormatTime, est, %est%, yyyyMMdd`n"
str := str . "  title := RegExReplace(title, ""USD -"", ""- USD"")`n"
str := str . "  filename := """ . hhpath . "\" . hero . "\HH"" . est . "" "" . title . "".txt""`n"
This works for me but it might break if Pokerstars changes the title of the table.
&quot;USD&quot; Killed AHK's on PS's.. Please Help Quote
10-02-2009 , 12:14 AM
Quote:
Originally Posted by Krikket
I've had a quick look at this and it seems to be a common problem when trying to tie the table's window title to the handhistory file. As a quick workaround you could try adding this line:

Code:
str := str . "  title := RegExReplace(title, ""USD -"", ""- USD"")`n"
BETWEEN these 2 lines:

Code:
str := str . "  FormatTime, est, %est%, yyyyMMdd`n"
str := str . "  filename := """ . hhpath . "\" . hero . "\HH"" . est . "" "" . title . "".txt""`n"
so it looks like this:

Code:
str := str . "  FormatTime, est, %est%, yyyyMMdd`n"
str := str . "  title := RegExReplace(title, ""USD -"", ""- USD"")`n"
str := str . "  filename := """ . hhpath . "\" . hero . "\HH"" . est . "" "" . title . "".txt""`n"
This works for me but it might break if Pokerstars changes the title of the table.
I did that as instructed and it didn't work for me... sigh. Thanks for the try. I even did a cut n paste of the above so I couldn't mistype it.

This is taken directly from the file I just edited.

HTML Code:
      str := str . "  est += " . timezone_difference_EST . ", hours`n"
      str := str . "  FormatTime, est, %est%, yyyyMMdd`n"
      str := str . "  title := RegExReplace(title, ""USD -"", ""- USD"")`n"
      str := str . "  filename := """ . hhpath . "\" . hero . "\HH"" . est . "" "" . title . "".txt""`n"
      str := str . "  StringReplace, filename, filename, /, -, All`n"
&quot;USD&quot; Killed AHK's on PS's.. Please Help Quote
10-02-2009 , 01:20 AM
Nevermind, suddenly it works. I've had that "problem" before. I was gone all day. My computer sat idle, but in a ready state, not sleep mode or anything similar. For some reason this AHK doesn't like to be running when nothing is on the computer... at least for a while. So, on a chance, I rebooted, and it worked perfect. Thanks again, it's much appreciate to have it back.

One happy "Dog"

Last edited by 1meandog4u; 10-02-2009 at 01:34 AM. Reason: cuz I can't spell
&quot;USD&quot; Killed AHK's on PS's.. Please Help Quote
10-24-2009 , 12:30 PM
This is in reference to the AHK "StarsReads", but I'm sure other ahk's have been affected...

PS went and did it again. The latest update "broke" this ahk. I'm sure it has to do with the table title, but have no clue as to how to fix it. In a previous post above, Krikket, posted a fix to the last problem changing the title. Anyone else have a fix for this recent change?

Is there anyone out there? I've posted this in the StarsReads as well, as that is the specific AHK we are talking about. If we get a fix, I'll be sure and post it over there too.

Dog
&quot;USD&quot; Killed AHK's on PS's.. Please Help Quote
08-19-2010 , 07:44 AM
Quote:
Originally Posted by 1meandog4u
This is in reference to the AHK "StarsReads", but I'm sure other ahk's have been affected...

PS went and did it again. The latest update "broke" this ahk. I'm sure it has to do with the table title, but have no clue as to how to fix it. In a previous post above, Krikket, posted a fix to the last problem changing the title. Anyone else have a fix for this recent change?

Is there anyone out there? I've posted this in the StarsReads as well, as that is the specific AHK we are talking about. If we get a fix, I'll be sure and post it over there too.

Dog
They change window title and syntax of handhistory filenames a lot. That's why the script is confused. Another thing is, that script reads favourite seat position from Poker Stars INI file and they changed this aswell (they added more types of tables).

I managed to correct the script, but the fix is raw and dirty and it works only for my setup (9table, fixed seat). I'm also trying to enhance the script to display notes/numbers next to coloured boxes.
&quot;USD&quot; Killed AHK's on PS's.. Please Help Quote
08-19-2010 , 03:35 PM
good luck - feel free to ask if you're wondering any specifics of how part of the script works etc.

to me the script is pretty much dead now that Stars has added it's own coloured notes / display in the same fashion as "pioneered" in this script (imitation is the best flattery imo )
&quot;USD&quot; Killed AHK's on PS's.. Please Help Quote
10-13-2010 , 03:04 PM
Hi _dave_ !

Quote:
Originally Posted by _dave_
good luck - feel free to ask if you're wondering any specifics of how part of the script works etc.

to me the script is pretty much dead now that Stars has added it's own coloured notes / display in the same fashion as "pioneered" in this script (imitation is the best flattery imo )
First of all, I have to say, you are pretty good coder. I took me a while to understand the script. It actually creates multiple instances (1 for each table open), great concept!

I know Pokerstars have colored notes now, but I use your script to HUD display my stats I collect.

Funny thing is, that now pokerstars table window shows different things according to its size. For example, when minimized, Tournament number is 2nd value in title bar, when it has normal size it's 8th value.
&quot;USD&quot; Killed AHK's on PS's.. Please Help Quote

      
m