Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
'our Buffer's DC
Public myBackBuffer As Long
Public myBufferBMP As Long
'The DC of our sprite/graphic
Public mySprite As Long
Dim AvoidLobby As Integer
Dim stoptimer As Integer
Dim idleornot As Long
Dim xscan As Integer
Dim yscan As Integer
Dim Card(1 To 7) As Integer
Dim cardsuit(1 To 8)
Dim whichcard As Integer
Dim colorcount As Integer
Dim colorcounttwo As Integer
Dim colorcountone As Integer
Dim colorcountfour As Integer
Dim colorcountfive As Integer
Dim seat(1 To 10) As Integer
Dim playercount As Integer
Dim scanloop As Integer
Dim player(1 To 11) As Integer
Dim dealerbutton(1 To 10) As Integer
Dim fiftycentchips(1 To 11) As Integer
Dim onedollarchips(1 To 11) As Integer
Dim fivedollarchips(1 To 11) As Integer
Dim twentyfivedollarchips(1 To 11) As Integer
Dim playerchips(1 To 11) As Double
Dim stackheight As Integer
Dim bottomy(1 To 11) As Integer
Dim bottomx(1 To 11) As Integer
Dim bottomx2(1 To 2) As Integer
Dim bottomx3(1 To 2) As Integer
Dim bottomx4(1 To 2) As Integer
Dim CurrentPot As Double
Dim colorcountplease As Integer
Dim colorcountthree As Integer
Dim memorycleaner As Integer
Private Sub SaveScreen(sPicFile As String)
'This will capture the Entire Screen
Clipboard.Clear
Sleep 1000
keybd_event vbKeySnapshot, 0, 0, 0
DoEvents
SavePicture Clipboard.GetData, "c:\screen.bmp"
DoEvents
Sleep 1000
End Sub
Public Function LoadGraphicDC(sFileName As String) As Long
'cheap error handling
On Error Resume Next
'temp variable to hold our DC address
Dim LoadGraphicDCTEMP As Long
'create the DC address compatible with
'the DC of the screen
LoadGraphicDCTEMP = CreateCompatibleDC(GetDC(0))
'load the graphic file into the DC...
SelectObject LoadGraphicDCTEMP, LoadPicture(sFileName)
'return the address of the file
LoadGraphicDC = LoadGraphicDCTEMP
End Function
Private Sub SnapAndSave()
DeleteObject myBufferBMP
DeleteDC myBackBuffer 'clears the backbuffer
DeleteDC mySprite 'this must be done after snap
'is done and rgbval is retreived
DoEvents
'create a compatable DC for the back buffer..
myBackBuffer = CreateCompatibleDC(GetDC(0))
'create a compatible bitmap surface for the DC
'that is the size of our form.. (320 X 256)
'NOTE - the bitmap will act as the actua ' l graphics surface inside the DC
'because without a bitmap in the DC, the ' DC cannot hold graphical data..
myBufferBMP = CreateCompatibleBitmap(GetDC(0), 800, 600)
'final step of making the back buffer...
'load our created blank bitmap surface into our buffer
'(this will be used as our canvas to draw-on off screen)
SelectObject myBackBuffer, myBufferBMP
'before we can blit to the buffer, we should fill it with black
BitBlt myBackBuffer, 0, 0, 800, 600, 0, 0, 0, vbWhiteness
'load our sprite (using the function we made)
SaveScreen "c:\" & Format(Now, "yyyymmddhhnnss") & ".bmp"
DoEvents
mySprite = LoadGraphicDC("c:\pokerscreen.bmp")
'MsgBox Dir$(App.Path & "\sprite1.bmp")
'ok now all the graphics are loaded so
'lets start our main loop..
'Disable cmdTest, because if the graphics are
'reloaded there will be memory leaks...
'Picture1.Enabled = False
'blit sprites to the back-buffer ***
'You could blit multiple sprites to the ' backbuffer,
'but in our example we only blit on...
BitBlt myBackBuffer, Spritex, SpriteY, 800, 600, _
mySprite, 0, 0, vbSrcPaint
'now blit the backbuffer to the form...
'BitBlt Me.hdc, 0, 0, 800, 600, myBackBuffer, _
'0, 0, vbSrcCopy
'rgbval = GetPixel(myBackBuffer, 526, 515)
'Label1.Caption = rgbval
'move our sprite down on a diagonal...
'Me.Caption = SpriteX & ", " & SpriteY
Spritex = 0
SpriteY = 0
End Sub
Private Sub Timer1_Timer()
Sleep 500
SnapAndSave 'mybackbuffer is now full
DoEvents
examinetable
End Sub
Private Sub examinetable()
Sleep 200
End Sub
Sub chipscan()
bottomx(1) = 181
bottomy(1) = 366
bottomx(2) = 152
bottomy(2) = 307
bottomx(3) = 157
bottomy(3) = 236
bottomx(4) = 239
bottomy(4) = 211
bottomx(5) = 469
bottomy(5) = 210
bottomx(6) = 622
bottomy(6) = 249
bottomx(7) = 653
bottomy(7) = 302
bottomx(8) = 634
bottomy(8) = 363
bottomx(9) = 446
bottomy(9) = 385
bottomx(10) = 300
bottomy(10) = 396
bottomx(11) = 364
bottomy(11) = 348
stackheight = 0
Do
stackheight = stackheight + 1
DoEvents
playerchips(stackheight) = Round((fiftycentchips(stackheight) * 0.25) + (onedollarchips(stackheight)) + (fivedollarchips(stackheight) * 5) + (twentyfivedollarchips(stackheight) * 25), 2)
Loop Until stackheight = 11
End Sub