【真】パチスロタウン renewal【黒】

このエントリーをはてなブックマークに追加
442名も無き冒険者
どうぞ使ってください。エクセルマクロ用ですけど。
Function 所持枚数() As Long
  Dim num As Long, X As Long, baseX As Long, baseY As Long, incX As Long
  Dim vv As Long, i As Long, j As Long, AA As Variant
  Dim hdc As Long, BCo As Long
  AA = Array(16, 6, 3, 8, 28, 5, 29, 1, 24, 2)
  baseX = 722
  baseY = 468
  incX = 7
  num = 0
  hdc = GetWindowDC(MOW)
  BCo = GetPixel(hdc, baseX, baseY) '所持枚数欄の背景色
  For i = 0 To 6
    If (i <> 3) Then
      vv = 0
      num = num * 10
      X = baseX + i * incX
      If GetPixel(hdc, X + 1, baseY + 7) <> BCo Then vv = vv Or 16
      If GetPixel(hdc, X + 2, baseY + 5) <> BCo Then vv = vv Or 8
      If GetPixel(hdc, X + 3, baseY + 4) <> BCo Then vv = vv Or 4
      If GetPixel(hdc, X + 3, baseY + 6) <> BCo Then vv = vv Or 2
      If GetPixel(hdc, X + 4, baseY + 4) <> BCo Then vv = vv Or 1
      For j = 0 To 9
        If vv = AA(j) Then Exit For
      Next j
      If (j < 10) Then num = num + j
    End If
  Next i

  所持枚数 = num
  ReleaseDC MOW, hdc
End Function