Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Array.au3>
- #include <ButtonConstants.au3>
- #include <ComboConstants.au3>
- #include <EditConstants.au3>
- #include <FileConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <GuiStatusBar.au3>
- #include <GUIEdit.au3>
- #include <GUIComboBox.au3>
- #include <StaticConstants.au3>
- #include <TabConstants.au3>
- #include <WindowsConstants.au3>
- #include <WinAPIProc.au3>
- #include <ScreenCapture.au3>
- #include <Date.au3>
- #include <Misc.au3>
- #include <File.au3>
- #include <TrayConstants.au3>
- #include <GUIMenu.au3>
- #include <ColorConstants.au3>
- #include <GDIPlus.au3>
- #include <InetConstants.au3>
- Global $hBitmap
- Global $hHBitmap
- Global $user32 = DllOpen("user32.dll")
- Global $HWnD = WinGetHandle(WinGetTitle("BlueStacks App Player"))
- _GDIPlus_Startup()
- $DonatePixel = _PixelSearch(202, 119, 203, 670, Hex(0x262926, 6), 1)
- If IsArray($DonatePixel) Then
- Local $x = 35, $y = $DonatePixel[1] - 17
- Local $String = ""
- _CaptureRegion(0, 0, $x + 400, $y + 30)
- For $i = 0 To 3
- Local $x_Temp = 35
- If getChar($x_Temp, $y) = " " Or getChar($x_Temp, $y) = "¦" Then
- $y += 1
- Else
- ExitLoop
- EndIf
- Next
- Do
- $String &= getChar($x, $y)
- Until (StringMid($String, StringLen($String) - 1, 2) = " " Or StringMid($String, StringLen($String), 1) = "¦")
- $String = StringReplace($String, " ", Null)
- $String = StringReplace($String, "¦", Null)
- MsgBox(0, "", $String)
- EndIf
- Func boolPixelSearchChar($pixel1, $pixel2, $pixel3)
- If _ColorCheckVariation(_PixelGetColor_GetPixel($pixel1[0], $pixel1[1]), $pixel1[2], 1) And _ColorCheckVariation(_PixelGetColor_GetPixel($pixel2[0], $pixel2[1]), $pixel2[2], 1) And _ColorCheckVariation(_PixelGetColor_GetPixel($pixel3[0], $pixel3[1]), $pixel3[2], 1) Then Return True
- Return False
- EndFunc ;==>boolPixelSearchChar
- ;==============================================================================================================
- ;===Get Char=============================================================================================
- ;--------------------------------------------------------------------------------------------------------------
- ;Finds pixel color pattern of specific X and Y values, returns char if pixel color pattern found.
- ;--------------------------------------------------------------------------------------------------------------
- Func getChar(ByRef $x, $y)
- Local $width = 0
- ;search for '{space}'
- $width = 2
- Local $c1 = Hex(0x404440, 6), $c2 = Hex(0x404440, 6), $c3 = Hex(0x404440, 6)
- Local $pixel1[3] = [$x + 1, $y + 3, $c1], $pixel2[3] = [$x + 1, $y + 7, $c2], $pixel3[3] = [$x + 2, $y + 5, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return " "
- EndIf
- ;search for 'A'
- $width = 7
- Local $c1 = Hex(0xE7E7E7, 6), $c2 = Hex(0xDBDCDB, 6), $c3 = Hex(0xD5D6D5, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 1, $y + 8, $c1], $pixel2[3] = [$x + 5, $y + 7, $c2], $pixel3[3] = [$x + 6, $y + 8, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "A"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'a'
- $width = 5
- Local $c1 = Hex(0xACAEAC, 6), $c2 = Hex(0xC2C3C2, 6), $c3 = Hex(0xDADBDA, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 1, $y + 4, $c2], $pixel3[3] = [$x + 4, $y + 7, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "a"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'B'
- $width = 7
- Local $c1 = Hex(0xE2E3E2, 6), $c2 = Hex(0xFBFBFB, 6), $c3 = Hex(0xE8E9E8, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 6, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 1, $c2], $pixel3[3] = [$x + 3, $y + 4, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "B"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'b'
- $width = 6
- Local $c1 = Hex(0x8D8F8D, 6), $c2 = Hex(0xCACBCA, 6), $c3 = Hex(0xFBFBFB, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 3, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 1, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "b"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'C'
- $width = 6
- Local $c1 = Hex(0xE8E8E8, 6), $c2 = Hex(0xC9CAC9, 6), $c3 = Hex(0xDBDBDB, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 2, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "C"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'c'
- $width = 5
- Local $c1 = Hex(0x818481, 6), $c2 = Hex(0x949694, 6), $c3 = Hex(0xECEDEC, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 3, $y + 2, $c1], $pixel2[3] = [$x + 5, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 4, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "c"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'D'
- $width = 6
- Local $c1 = Hex(0xACAEAC, 6), $c2 = Hex(0xA0A2A0, 6), $c3 = Hex(0xB6B8B6, 6)
- For $i = 1 To 5
- Local $pixel1[3] = [$x + 3, $y + 7, $c1], $pixel2[3] = [$x + 6, $y + 1, $c2], $pixel3[3] = [$x + 2, $y + 3, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "D"
- Else
- $x += 1
- EndIf
- Next
- $x -= 5
- ;search for 'd'
- $width = 6
- Local $c1 = Hex(0x8D8F8D, 6), $c2 = Hex(0xE4E5E4, 6), $c3 = Hex(0xABADAB, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 3, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 3, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "d"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'E'
- $width = 6
- Local $c1 = Hex(0xA5A7A5, 6), $c2 = Hex(0xC3C5C3, 6), $c3 = Hex(0x767976, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 2, $y + 6, $c1], $pixel2[3] = [$x + 2, $y + 2, $c2], $pixel3[3] = [$x + 3, $y + 0, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "E"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'e'
- $width = 6
- Local $c1 = Hex(0x404440, 6), $c2 = Hex(0xF5F5F5, 6), $c3 = Hex(0x7B7D7B, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 1, $y + 2, $c1], $pixel2[3] = [$x + 2, $y + 3, $c2], $pixel3[3] = [$x + 4, $y + 6, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "e"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'F'
- $width = 5
- Local $c1 = Hex(0x515451, 6), $c2 = Hex(0xE1E1E1, 6), $c3 = Hex(0xC6C7C6, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 3, $y + 2, $c1], $pixel2[3] = [$x + 1, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 1, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "F"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'f'
- $width = 5
- Local $c1 = Hex(0xC4C5C4, 6), $c2 = Hex(0xBFC0BF, 6), $c3 = Hex(0x535653, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 5, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 4, $c2], $pixel3[3] = [$x + 2, $y + 8, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "f"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'G'
- $width = 6
- Local $c1 = Hex(0x707370, 6), $c2 = Hex(0xC4C5C4, 6), $c3 = Hex(0xD1D2D1, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 4, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 0, $c2], $pixel3[3] = [$x + 4, $y + 5, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "G"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'g'
- $width = 5
- Local $c1 = Hex(0xD7D8D7, 6), $c2 = Hex(0xF2F2F2, 6), $c3 = Hex(0xE6E7E6, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 1, $y + 9, $c1], $pixel2[3] = [$x + 4, $y + 9, $c2], $pixel3[3] = [$x + 4, $y + 4, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "g"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'H'
- $width = 8
- Local $c1 = Hex(0x5F635F, 6), $c2 = Hex(0x464A46, 6), $c3 = Hex(0xFAFAFA, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 5, $y + 8, $c1], $pixel2[3] = [$x + 3, $y + 3, $c2], $pixel3[3] = [$x + 1, $y + 1, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "H"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'h'
- $width = 6
- Local $c1 = Hex(0x818481, 6), $c2 = Hex(0xD3D4D3, 6), $c3 = Hex(0x646764, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 2, $y + 5, $c1], $pixel2[3] = [$x + 3, $y + 4, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "h"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'I'
- $width = 2
- Local $c1 = Hex(0xFEFEFE, 6), $c2 = Hex(0xA3A5A3, 6), $c3 = Hex(0xE1E1E1, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 1, $y + 2, $c1], $pixel2[3] = [$x + 2, $y + 5, $c2], $pixel3[3] = [$x + 1, $y + 8, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "I"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'i'
- $width = 2
- Local $c1 = Hex(0xF0F1F0, 6), $c2 = Hex(0x454945, 6), $c3 = Hex(0xE1E1E1, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 2, $c2], $pixel3[3] = [$x + 1, $y + 8, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "i"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'J'
- $width = 6
- Local $c1 = Hex(0x8E908E, 6), $c2 = Hex(0xC4C5C4, 6), $c3 = Hex(0xFBFBFB, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 1, $y + 5, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 6, $y + 1, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "J"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'j'
- $width = 3
- Local $c1 = Hex(0xA0A2A0, 6), $c2 = Hex(0xCFD0CF, 6), $c3 = Hex(0xFEFEFE, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 1, $y + 0, $c1], $pixel2[3] = [$x + 1, $y + 3, $c2], $pixel3[3] = [$x + 1, $y + 9, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "j"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'K'
- $width = 7
- Local $c1 = Hex(0xC7C8C7, 6), $c2 = Hex(0x828482, 6), $c3 = Hex(0x7C7E7C, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 3, $y + 6, $c2], $pixel3[3] = [$x + 6, $y + 0, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "K"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'k'
- $width = 5
- Local $c1 = Hex(0xFBFBFB, 6), $c2 = Hex(0x646764, 6), $c3 = Hex(0xDBDCDB, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 1, $c2], $pixel3[3] = [$x + 4, $y + 8, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "k"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'L'
- $width = 3
- Local $c1 = Hex(0xFDFDFD, 6), $c2 = Hex(0x828482, 6), $c3 = Hex(0x646764, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 2, $y + 7, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 0, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "L"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'l'
- $width = 2
- Local $c1 = Hex(0xFEFEFE, 6), $c2 = Hex(0x909290, 6), $c3 = Hex(0xFEFEFE, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 1, $y + 2, $c1], $pixel2[3] = [$x + 0, $y + 2, $c2], $pixel3[3] = [$x + 1, $y + 7, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "l"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'M'
- $width = 10
- Local $c1 = Hex(0x8C8E8C, 6), $c2 = Hex(0x6A6D6A, 6), $c3 = Hex(0xA9ABA9, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 4, $y + 8, $c1], $pixel2[3] = [$x + 6, $y + 1, $c2], $pixel3[3] = [$x + 8, $y + 8, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "M"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'm'
- $width = 10
- Local $c1 = Hex(0xD5D6D5, 6), $c2 = Hex(0x585C58, 6), $c3 = Hex(0xFFFFFF, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 1, $y + 8, $c1], $pixel2[3] = [$x + 7, $y + 2, $c2], $pixel3[3] = [$x + 5, $y + 4, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "m"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'N'
- $width = 7
- Local $c1 = Hex(0x949694, 6), $c2 = Hex(0x707370, 6), $c3 = Hex(0xBFC0BF, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 3, $y + 1, $c1], $pixel2[3] = [$x + 5, $y + 4, $c2], $pixel3[3] = [$x + 6, $y + 1, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "N"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'n'
- $width = 6
- Local $c1 = Hex(0xBEC0BE, 6), $c2 = Hex(0x8A8D8A, 6), $c3 = Hex(0x7A7D7A, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 4, $y + 8, $c2], $pixel3[3] = [$x + 2, $y + 5, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "n"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'O'
- $width = 6
- Local $c1 = Hex(0xBBBDBB, 6), $c2 = Hex(0x888A88, 6), $c3 = Hex(0xD9DAD9, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 2, $y + 6, $c1], $pixel2[3] = [$x + 2, $y + 0, $c2], $pixel3[3] = [$x + 5, $y + 6, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "O"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'o'
- $width = 6
- Local $c1 = Hex(0x888A88, 6), $c2 = Hex(0xA9ABA9, 6), $c3 = Hex(0x585C58, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 2, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 5, $c2], $pixel3[3] = [$x + 3, $y + 2, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "o"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'P'
- $width = 6
- Local $c1 = Hex(0x636663, 6), $c2 = Hex(0x858785, 6), $c3 = Hex(0xE6E7E6, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 4, $y + 2, $c1], $pixel2[3] = [$x + 2, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "P"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'p'
- $width = 5
- Local $c1 = Hex(0x8D908D, 6), $c2 = Hex(0xFFFFFF, 6), $c3 = Hex(0x898B89, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 2, $y + 4, $c1], $pixel2[3] = [$x + 1, $y + 10, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "p"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'Q'
- $width = 7
- Local $c1 = Hex(0xE6E7E6, 6), $c2 = Hex(0xABADAB, 6), $c3 = Hex(0xFFFFFF, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 4, $y + 9, $c1], $pixel2[3] = [$x + 2, $y + 2, $c2], $pixel3[3] = [$x + 6, $y + 4, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "Q"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'q'
- $width = 6
- Local $c1 = Hex(0x696C69, 6), $c2 = Hex(0xFFFFFF, 6), $c3 = Hex(0xC1C2C1, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 3, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 10, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "q"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'R'
- $width = 7
- Local $c1 = Hex(0x575A57, 6), $c2 = Hex(0x939593, 6), $c3 = Hex(0xB8BAB8, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 4, $y + 2, $c1], $pixel2[3] = [$x + 3, $y + 6, $c2], $pixel3[3] = [$x + 6, $y + 1, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "R"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'r'
- $width = 5
- Local $c1 = Hex(0x747774, 6), $c2 = Hex(0x5F635F, 6), $c3 = Hex(0x464A46, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 4, $y + 5, $c1], $pixel2[3] = [$x + 2, $y + 6, $c2], $pixel3[3] = [$x + 2, $y + 2, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "r"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'S'
- $width = 7
- Local $c1 = Hex(0x8E908E, 6), $c2 = Hex(0x9C9E9C, 6), $c3 = Hex(0x7C7F7C, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 2, $y + 0, $c1], $pixel2[3] = [$x + 5, $y + 4, $c2], $pixel3[3] = [$x + 3, $y + 7, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "S"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 's'
- $width = 6
- Local $c1 = Hex(0x707370, 6), $c2 = Hex(0xC3C4C3, 6), $c3 = Hex(0x909290, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 2, $y + 2, $c1], $pixel2[3] = [$x + 4, $y + 4, $c2], $pixel3[3] = [$x + 2, $y + 7, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "s"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'T'
- $width = 6
- Local $c1 = Hex(0x707370, 6), $c2 = Hex(0xB7B8B7, 6), $c3 = Hex(0x969896, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 1, $y + 0, $c1], $pixel2[3] = [$x + 4, $y + 2, $c2], $pixel3[3] = [$x + 2, $y + 8, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "T"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 't'
- $width = 6
- Local $c1 = Hex(0x767976, 6), $c2 = Hex(0xB6B8B6, 6), $c3 = Hex(0xA6A8A6, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 2, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 6, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "t"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'U'
- $width = 7
- Local $c1 = Hex(0xFBFBFB, 6), $c2 = Hex(0x626562, 6), $c3 = Hex(0xBFC0BF, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 1, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "U"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'u'
- $width = 6
- Local $c1 = Hex(0x525652, 6), $c2 = Hex(0xCBCCCB, 6), $c3 = Hex(0x888A88, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 2, $y + 7, $c2], $pixel3[3] = [$x + 4, $y + 3, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "u"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'V'
- $width = 7
- Local $c1 = Hex(0x898C89, 6), $c2 = Hex(0x707370, 6), $c3 = Hex(0xE1E2E1, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 2, $y + 2, $c1], $pixel2[3] = [$x + 3, $y + 5, $c2], $pixel3[3] = [$x + 5, $y + 7, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "V"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'v'
- $width = 6
- Local $c1 = Hex(0x595C59, 6), $c2 = Hex(0x525652, 6), $c3 = Hex(0xEEEEEE, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 3, $y + 6, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "v"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'W'
- $width = 11
- Local $c1 = Hex(0xAEB0AE, 6), $c2 = Hex(0xC5C6C5, 6), $c3 = Hex(0x989A98, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 6, $y + 1, $c2], $pixel3[3] = [$x + 9, $y + 8, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "W"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'w'
- $width = 9
- Local $c1 = Hex(0x8E918E, 6), $c2 = Hex(0x747674, 6), $c3 = Hex(0x797C79, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 3, $y + 5, $c1], $pixel2[3] = [$x + 5, $y + 7, $c2], $pixel3[3] = [$x + 8, $y + 8, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "w"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'X'
- $width = 7
- Local $c1 = Hex(0x989B98, 6), $c2 = Hex(0x939593, 6), $c3 = Hex(0xB6B8B6, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 1, $y + 2, $c1], $pixel2[3] = [$x + 3, $y + 7, $c2], $pixel3[3] = [$x + 5, $y + 4, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "X"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'x'
- $width = 6
- Local $c1 = Hex(0x8C8E8C, 6), $c2 = Hex(0x9EA09E, 6), $c3 = Hex(0x4C4F4C, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 1, $y + 4, $c1], $pixel2[3] = [$x + 2, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 6, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "x"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'Y'
- $width = 7
- Local $c1 = Hex(0xA1A3A1, 6), $c2 = Hex(0x8C8E8C, 6), $c3 = Hex(0xD5D6D5, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 2, $y + 1, $c1], $pixel2[3] = [$x + 5, $y + 5, $c2], $pixel3[3] = [$x + 3, $y + 8, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "Y"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'y'
- $width = 6
- Local $c1 = Hex(0x5D615D, 6), $c2 = Hex(0xEEEEEE, 6), $c3 = Hex(0xE8E9E8, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 1, $y + 8, $c1], $pixel2[3] = [$x + 3, $y + 7, $c2], $pixel3[3] = [$x + 3, $y + 10, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "y"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'Z'
- $width = 7
- Local $c1 = Hex(0x505450, 6), $c2 = Hex(0x707370, 6), $c3 = Hex(0x888B88, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 2, $y + 2, $c1], $pixel2[3] = [$x + 1, $y + 7, $c2], $pixel3[3] = [$x + 5, $y + 7, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "Z"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- ;search for 'z'
- $width = 4
- Local $c1 = Hex(0x757775, 6), $c2 = Hex(0x757875, 6), $c3 = Hex(0xDADBDA, 6)
- For $i = 1 To 4
- Local $pixel1[3] = [$x + 1, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 5, $c2], $pixel3[3] = [$x + 2, $y + 8, $c3]
- If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
- $x += $width
- Return "z"
- Else
- $x += 1
- EndIf
- Next
- $x -= 4
- Return "¦"
- EndFunc ;==>getChar
- #Region ##### PIXEL PROCESSING #####
- Func _CaptureRegion($iLeft = 0, $iTop = 0, $iRight = 860, $iBottom = 720, $ReturnBMP = False)
- _GDIPlus_BitmapDispose($hBitmap)
- _WinAPI_DeleteObject($hHBitmap)
- Local $iW = Number($iRight) - Number($iLeft), $iH = Number($iBottom) - Number($iTop)
- Local $hDC_Capture = _WinAPI_GetWindowDC(ControlGetHandle("BlueStacks App Player", "", "[CLASS:BlueStacksApp; INSTANCE:1]"))
- Local $hMemDC = _WinAPI_CreateCompatibleDC($hDC_Capture)
- $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC_Capture, $iW, $iH)
- Local $hObjectOld = _WinAPI_SelectObject($hMemDC, $hHBitmap)
- DllCall($user32, "int", "PrintWindow", "hwnd", $HWnD, "handle", $hMemDC, "int", 0)
- _WinAPI_SelectObject($hMemDC, $hHBitmap)
- _WinAPI_BitBlt($hMemDC, 0, 0, $iW, $iH, $hDC_Capture, $iLeft, $iTop, 0x00CC0020)
- $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap)
- _WinAPI_DeleteDC($hMemDC)
- _WinAPI_SelectObject($hMemDC, $hObjectOld)
- _WinAPI_ReleaseDC($HWnD, $hDC_Capture)
- EndFunc ;==>_CaptureRegion
- Func _PixelGetColor_GetPixel($iX, $iY)
- Local $aPixelColor = _GDIPlus_BitmapGetPixel($hBitmap, $iX, $iY)
- Return Hex($aPixelColor, 6)
- EndFunc ;==>_PixelGetColor_GetPixel
- Func _PixelSearch($iLeft, $iTop, $iRight, $iBottom, $iColor, $ColorVariation)
- _CaptureRegion($iLeft, $iTop, $iRight, $iBottom)
- For $x = $iRight - $iLeft To 0 Step -1
- For $y = 0 To $iBottom - $iTop
- Local $nColor1 = $iColor
- Local $nColor2 = _PixelGetColor_GetPixel($x, $y)
- If _ColorCheckVariation($nColor1, $nColor2, $ColorVariation) Then
- Local $Pos[2] = [$iLeft + $x, $iTop + $y]
- Return $Pos
- EndIf
- Next
- Next
- Return 0
- EndFunc ;==>_PixelSearch
- Func _ColorCheckVariation($nColor1, $nColor2, $sVari = 5)
- Local $Red1, $Red2, $Blue1, $Blue2, $Green1, $Green2
- $Red1 = Dec(StringMid(String($nColor1), 1, 2))
- $Blue1 = Dec(StringMid(String($nColor1), 3, 2))
- $Green1 = Dec(StringMid(String($nColor1), 5, 2))
- $Red2 = Dec(StringMid(String($nColor2), 1, 2))
- $Blue2 = Dec(StringMid(String($nColor2), 3, 2))
- $Green2 = Dec(StringMid(String($nColor2), 5, 2))
- If Abs($Blue1 - $Blue2) > $sVari Then Return False
- If Abs($Green1 - $Green2) > $sVari Then Return False
- If Abs($Red1 - $Red2) > $sVari Then Return False
- Return True
- EndFunc ;==>_ColorCheckVariation
- Func CheckColorVariPos($x, $y, $c, $vp = 0, $vc = 10)
- For $a = $x - $vp To $x + $vp
- For $b = $y - $vp To $y + $vp
- If _ColorCheckVariation(_PixelGetColor_GetPixel($a, $b), Hex($c, 6), $vc) Then
- Return True
- EndIf
- Next
- Next
- Return False
- EndFunc ;==>CheckColorVariPos
- #EndRegion ##### PIXEL PROCESSING #####
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement