Tag Archive


c# poker HUD free poker HUD free pokerstars HUD free play chip HUD free pokerstars tools free poker tools make your own poker HUD online poker laws play poker online in the states poker poker cheat poker developers poker edge poker news poker positions pokerstars cheat poker tools programming poker track your wins and losses in poker U.S online poker laws vb.net vb.net custom poker controls vb.net poker heads up display source vb.net poker HUD vb.net poker source code vb vs c# view latest online poker bill

Sending text programmatically to Pokerstars table

this took me awhile to figure out and I’ve had to change it on occasion after some pokerstars updates, besides the PS updates, it’s never failed.

I included the GetText declarations because It’s simple to first grab any text you may be typing in the pokerstars chat enter area at the moment the sub fires, save it as a string somewhere, and then replace it after the sub has sent the programmed chat. This will keep any text you’re typing to the table from being wiped out by the Sub.

use the sub like this:  SendChatToPokerstarsTable(“nice hand”)

Martin Carter – psxpoker.com
PrivateConst WM_SETTEXT = &HC 
PrivateConst WM_GETTEXT = &HD 
PublicConst WM_CHAR = &H102

PublicDeclareFunction GetWindowTextLength Lib“user32.dll”Alias“GetWindowTextLengthA” (ByVal hWnd AsLong) AsLong

PublicDeclareFunction GetWindowText Lib“user32.dll”Alias“GetWindowTextA” (ByVal hWnd AsLong, ByVal prmstrString AsString, ByVal nMaxCount AsLong) AsLong

PublicDeclareFunction FindWindow Lib“user32”Alias“FindWindowA” (ByVal lpClassName AsString, ByVal lpWindowName AsString) AsInteger

PublicDeclareFunction FindWindowEx Lib“user32”Alias“FindWindowExA” (ByVal hWnd1 AsInteger, ByVal hWnd2 AsInteger, ByVal lpsz1 AsString, ByVal lpsz2 AsString) AsInteger

PublicDeclareFunction SendMessageSTRING Lib“user32”Alias“SendMessageA” (ByVal hwnd AsInteger, ByVal wMsg AsInteger, ByVal wParam AsInteger, ByVal lParam AsString) AsInteger

DeclareFunction sendmessagebynum& Lib“user32”Alias“SendMessageA” (ByVal hWnd AsInteger, ByVal wMsg AsInteger, ByVal wParam AsInteger, ByVal lParam AsInteger)

PublicSub SendChatToPokerstarsTable(ByVal Chat)

Dim pokerstarstableframeclass AsLong = FindWindow(“pokerstarstableframeclass”, vbNullString)

Dim pokerstarschateditorclass AsLong = FindWindowEx(pokerstarstableframeclass, 0&, “pokerstarschateditorclass”, vbNullString)

If pokerstarschateditorclass = 0 Then

Exit Sub

Else

Call SendMessageSTRING(pokerstarschateditorclass, WM_SETTEXT, 0&, Chat)

Call sendmessagebynum(pokerstarschateditorclass, WM_CHAR, 13, 0)

EndIf

EndSub

 

You can also loop thru a textbox and instantly send multilines of text to the table.

Dim ChatLines() AsString = Split(TextBox1.Text, vbNewLine)

ForEach line In ChatLines

If line = “” Then line = “.”

 SendChatToPokerstarsTable(line)

Next

PLEASE DONT SPAM THE TABLES WITH THESE CODES! THIS IS FOR “NICE HAND” or “PAYOUTS AS FOLLOWS…” ETC!

   TOP

multi color and multi value status bars in vb.net



bluebar

   Displaying large amounts of data in small areas with the visual benefit of status bars or “bar graphs” is great. Doing this within a poker app requires the graphs to have two, three, four, or even five data values to display for each player’s action. I searched for a control that would handle the problem but had no results. here is my solution.

In each example above, I made three labels…

  • set each back color to the desired color
  • set the text alignment to left-center
  • set the heights to the desired height of the entire control
  • set the widths to the desired width of the entire control
  • set the locations the same

You can make a fourth label, 2 pixels larger, that is bordered for the background and make these three borderless for a nice affect.
You can use picture boxes and stretch images to create an even better effect. Whatever you have time for. ( I have made some very nice controls with this method)

 

 

Private Sub DisplayIt(lbl1 As Label, lbl2 As Label, lbl3 As Label, val1 As Integer, val2 As Integer, val3 As Integer)

Martin Carter – psxpoker.com

 ‘the percentage of graph used by each label, times 200 pixels (the width of the control)

lbl1.Width = val1 / (val1 + val2 + val3) * 200

lbl2.Width = val2 / (val1 + val2 + val3) * 200

lbl3.Width = val3 / (val1 + val2 + val3) * 200

 ‘the position of the 2nd and 3rd labels

lbl2.Left = (lbl1.Left + lbl1.Width)

lbl3.Left = (lbl2.Left + lbl2.Width)

 
‘print the values on the labels

lbl1.Text = Math.Round(val1 / (val1 + val2 + val3) * 100) & “%”

lbl2.Text = Math.Round(val2 / (val1 + val2 + val3) * 100) & “%”

lbl3.Text =Math.Round(val3 / (val1 + val2 + val3) * 100) & “%”

End Sub

 

‘use the sub like this…

 

PrivateSub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

Call DisplayIt(Label1, Label2, Label3, 11, 17, 5)

‘remember to handle the “isnumeric” exeption when passing the values

‘if 1 value is 0 then the other 2 labels will fill the control with the correct %

 EndSub

 

I use these controls to display “wins-uncalled wins-losses”, “bets preflop-flop-turn-river”, “in hand UTG-UTG+1-mid-mid+1-hijack-cutoff-button”. etc.

   TOP

Trigger an event from a pokerstars hand completion in vb.net

 This will search the Pokerstars hand history folders on your comp and trigger an event when the size of one of those hand history files changes.

I set the timer to 3 seconds and get NO processor spike at all and it catches every append to pokerstars HH files in as many tables you are on. If you plan on parsing hands just split the string in the streamreader with (vbnewline & vbnewline & vbnewline) .  Add it to an array. You will have an array of every hand played in that HH file to parse any info you need after each hand completes. You could also use lastindexof for the latest completed hand.

 

 


Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick 'Martin Carter – psxpoker.com Dim dir As String dir = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) 'this is the pokerstars default directory Dim MyHHpath As String = dir & "\PokerStars\HandHistory\" 'create the array to put all the directories in to search for HH files.
Dim DirList As New ArrayList 'get the subdirectories If (System.IO.Directory.Exists(dir & "\PokerStars\HandHistory")) Then GetDirectories(MyHHpath, DirList) 'this is a folder i also save HH files in DirList.Add(System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments).ToString & "\HH") lstDirFile.Items.Clear() For Each x In DirList Dim files() As System.IO.FileInfo Dim dirinfo As New System.IO.DirectoryInfo(x.ToString) files = dirinfo.GetFiles("HH*Hold'em*.txt", IO.SearchOption.AllDirectories) For Each file In files 'skip the holdem omaha mixed games If file.ToString.Contains("Omaha") = True Then GoTo skipOmahaFile 'path and filename Dim FileN As String = dirinfo.ToString & "\" & file.ToString Dim filex As New FileInfo(FileN) sizeInBytes2 = filex.Length 'i use this to only add files modified today (ext.letfof is a function... ext.leftof("blah","ah") returns "bl" Dim Lastwrite As Date = eXt.LeftOf(filex.LastWriteTime, " ") 'add the size in bytes and filename to list a If Lastwrite = eXt.LeftOf(Now, " ") Then lstDirFile.Items.Add(sizeInBytes2.ToString & ", " & FileN) End If SkipOmahaFile: Next Next If lstDirFile.Items.Count = 0 Then Exit Sub Else ' populate list b from list a if its empty If lstDirFile2.Items.Count = 0 Then For i = 0 To lstDirFile.Items.Count - 1 lstDirFile2.Items.Add(lstDirFile.Items.Item(i)) Next Else 'start compare and refresh list here 'loop thru list a For i = 0 To lstDirFile.Items.Count - 1 'loop thru list b For x = 0 To lstDirFile2.Items.Count - 1 'If the 2 filenames are the same If eXt.RightOf(lstDirFile.Items.Item(i), ", ") = eXt.RightOf(lstDirFile2.Items.Item(x), ", ") Then 'if the sizes dont match then a hand has just completed If eXt.LeftOf(lstDirFile.Items.Item(i), ", ") <> eXt.LeftOf(lstDirFile2.Items.Item(x), ", ") Then 'here is the file that changed and it is read into memory Dim sr As New IO.StreamReader(eXt.RightOf(lstDirFile.Items(i), ", ").ToString) Dim Sr2 As String = sr.ReadToEnd 'your event would go here
End If End If Next Next 'now move the items from list a to list b for the next timer trigger to compare again lstDirFile2.Items.Clear() For i = 0 To lstDirFile.Items.Count - 1 lstDirFile2.Items.Add(lstDirFile.Items.Item(i)) Next End If End If End Sub

 

I collect 77 different data values from 9 players per hand and store that data on a list of 7000+ players. I parse about 2300 hands per minute on a laptop with this code. Don’t forget to handle exceptions.

   TOP

Hit Counter provided by shuttle service from lax