Advertisement
GkevinOD

asd

Jan 19th, 2015
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.70 KB | None | 0 0
  1. #include <Array.au3>
  2. #include <ButtonConstants.au3>
  3. #include <ComboConstants.au3>
  4. #include <EditConstants.au3>
  5. #include <FileConstants.au3>
  6. #include <GUIConstantsEx.au3>
  7. #include <GuiStatusBar.au3>
  8. #include <GUIEdit.au3>
  9. #include <GUIComboBox.au3>
  10. #include <StaticConstants.au3>
  11. #include <TabConstants.au3>
  12. #include <WindowsConstants.au3>
  13. #include <WinAPIProc.au3>
  14. #include <ScreenCapture.au3>
  15. #include <Date.au3>
  16. #include <Misc.au3>
  17. #include <File.au3>
  18. #include <TrayConstants.au3>
  19. #include <GUIMenu.au3>
  20. #include <ColorConstants.au3>
  21. #include <GDIPlus.au3>
  22. #include <InetConstants.au3>
  23.  
  24.  
  25. Global $hBitmap
  26. Global $hHBitmap
  27. Global $user32 = DllOpen("user32.dll")
  28. Global $HWnD = WinGetHandle(WinGetTitle("BlueStacks App Player"))
  29. _GDIPlus_Startup()
  30. $DonatePixel = _PixelSearch(202, 119, 203, 670, Hex(0x262926, 6), 1)
  31. If IsArray($DonatePixel) Then
  32. Local $x = 35, $y = $DonatePixel[1] - 17
  33. Local $String = ""
  34. _CaptureRegion(0, 0, $x + 400, $y + 30)
  35.  
  36. For $i = 0 To 3
  37. Local $x_Temp = 35
  38. If getChar($x_Temp, $y) = " " Or getChar($x_Temp, $y) = "¦" Then
  39. $y += 1
  40. Else
  41. ExitLoop
  42. EndIf
  43. Next
  44.  
  45. Do
  46. $String &= getChar($x, $y)
  47. Until (StringMid($String, StringLen($String) - 1, 2) = " " Or StringMid($String, StringLen($String), 1) = "¦")
  48. $String = StringReplace($String, " ", Null)
  49. $String = StringReplace($String, "¦", Null)
  50. MsgBox(0, "", $String)
  51. EndIf
  52.  
  53.  
  54.  
  55.  
  56. Func boolPixelSearchChar($pixel1, $pixel2, $pixel3)
  57. 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
  58. Return False
  59. EndFunc ;==>boolPixelSearchChar
  60.  
  61. ;==============================================================================================================
  62. ;===Get Char=============================================================================================
  63. ;--------------------------------------------------------------------------------------------------------------
  64. ;Finds pixel color pattern of specific X and Y values, returns char if pixel color pattern found.
  65. ;--------------------------------------------------------------------------------------------------------------
  66.  
  67. Func getChar(ByRef $x, $y)
  68. Local $width = 0
  69. ;search for '{space}'
  70. $width = 2
  71. Local $c1 = Hex(0x404440, 6), $c2 = Hex(0x404440, 6), $c3 = Hex(0x404440, 6)
  72. Local $pixel1[3] = [$x + 1, $y + 3, $c1], $pixel2[3] = [$x + 1, $y + 7, $c2], $pixel3[3] = [$x + 2, $y + 5, $c3]
  73. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  74. $x += $width
  75. Return " "
  76. EndIf
  77.  
  78. ;search for 'A'
  79. $width = 7
  80. Local $c1 = Hex(0xE7E7E7, 6), $c2 = Hex(0xDBDCDB, 6), $c3 = Hex(0xD5D6D5, 6)
  81. For $i = 1 To 4
  82. Local $pixel1[3] = [$x + 1, $y + 8, $c1], $pixel2[3] = [$x + 5, $y + 7, $c2], $pixel3[3] = [$x + 6, $y + 8, $c3]
  83. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  84. $x += $width
  85. Return "A"
  86. Else
  87. $x += 1
  88. EndIf
  89. Next
  90. $x -= 4
  91.  
  92. ;search for 'a'
  93. $width = 5
  94. Local $c1 = Hex(0xACAEAC, 6), $c2 = Hex(0xC2C3C2, 6), $c3 = Hex(0xDADBDA, 6)
  95. For $i = 1 To 4
  96. Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 1, $y + 4, $c2], $pixel3[3] = [$x + 4, $y + 7, $c3]
  97. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  98. $x += $width
  99. Return "a"
  100. Else
  101. $x += 1
  102. EndIf
  103. Next
  104. $x -= 4
  105.  
  106. ;search for 'B'
  107. $width = 7
  108. Local $c1 = Hex(0xE2E3E2, 6), $c2 = Hex(0xFBFBFB, 6), $c3 = Hex(0xE8E9E8, 6)
  109. For $i = 1 To 4
  110. Local $pixel1[3] = [$x + 6, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 1, $c2], $pixel3[3] = [$x + 3, $y + 4, $c3]
  111. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  112. $x += $width
  113. Return "B"
  114. Else
  115. $x += 1
  116. EndIf
  117. Next
  118. $x -= 4
  119.  
  120. ;search for 'b'
  121. $width = 6
  122. Local $c1 = Hex(0x8D8F8D, 6), $c2 = Hex(0xCACBCA, 6), $c3 = Hex(0xFBFBFB, 6)
  123. For $i = 1 To 4
  124. Local $pixel1[3] = [$x + 3, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 1, $c3]
  125. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  126. $x += $width
  127. Return "b"
  128. Else
  129. $x += 1
  130. EndIf
  131. Next
  132. $x -= 4
  133.  
  134. ;search for 'C'
  135. $width = 6
  136. Local $c1 = Hex(0xE8E8E8, 6), $c2 = Hex(0xC9CAC9, 6), $c3 = Hex(0xDBDBDB, 6)
  137. For $i = 1 To 4
  138. Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 2, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3]
  139. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  140. $x += $width
  141. Return "C"
  142. Else
  143. $x += 1
  144. EndIf
  145. Next
  146. $x -= 4
  147.  
  148. ;search for 'c'
  149. $width = 5
  150. Local $c1 = Hex(0x818481, 6), $c2 = Hex(0x949694, 6), $c3 = Hex(0xECEDEC, 6)
  151. For $i = 1 To 4
  152. Local $pixel1[3] = [$x + 3, $y + 2, $c1], $pixel2[3] = [$x + 5, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 4, $c3]
  153. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  154. $x += $width
  155. Return "c"
  156. Else
  157. $x += 1
  158. EndIf
  159. Next
  160. $x -= 4
  161.  
  162. ;search for 'D'
  163. $width = 6
  164. Local $c1 = Hex(0xACAEAC, 6), $c2 = Hex(0xA0A2A0, 6), $c3 = Hex(0xB6B8B6, 6)
  165. For $i = 1 To 5
  166. Local $pixel1[3] = [$x + 3, $y + 7, $c1], $pixel2[3] = [$x + 6, $y + 1, $c2], $pixel3[3] = [$x + 2, $y + 3, $c3]
  167. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  168. $x += $width
  169. Return "D"
  170. Else
  171. $x += 1
  172. EndIf
  173. Next
  174. $x -= 5
  175.  
  176. ;search for 'd'
  177. $width = 6
  178. Local $c1 = Hex(0x8D8F8D, 6), $c2 = Hex(0xE4E5E4, 6), $c3 = Hex(0xABADAB, 6)
  179. For $i = 1 To 4
  180. Local $pixel1[3] = [$x + 3, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 3, $c3]
  181. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  182. $x += $width
  183. Return "d"
  184. Else
  185. $x += 1
  186. EndIf
  187. Next
  188. $x -= 4
  189.  
  190. ;search for 'E'
  191. $width = 6
  192. Local $c1 = Hex(0xA5A7A5, 6), $c2 = Hex(0xC3C5C3, 6), $c3 = Hex(0x767976, 6)
  193. For $i = 1 To 4
  194. Local $pixel1[3] = [$x + 2, $y + 6, $c1], $pixel2[3] = [$x + 2, $y + 2, $c2], $pixel3[3] = [$x + 3, $y + 0, $c3]
  195. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  196. $x += $width
  197. Return "E"
  198. Else
  199. $x += 1
  200. EndIf
  201. Next
  202. $x -= 4
  203.  
  204. ;search for 'e'
  205. $width = 6
  206. Local $c1 = Hex(0x404440, 6), $c2 = Hex(0xF5F5F5, 6), $c3 = Hex(0x7B7D7B, 6)
  207. For $i = 1 To 4
  208. Local $pixel1[3] = [$x + 1, $y + 2, $c1], $pixel2[3] = [$x + 2, $y + 3, $c2], $pixel3[3] = [$x + 4, $y + 6, $c3]
  209. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  210. $x += $width
  211. Return "e"
  212. Else
  213. $x += 1
  214. EndIf
  215. Next
  216. $x -= 4
  217.  
  218. ;search for 'F'
  219. $width = 5
  220. Local $c1 = Hex(0x515451, 6), $c2 = Hex(0xE1E1E1, 6), $c3 = Hex(0xC6C7C6, 6)
  221. For $i = 1 To 4
  222. Local $pixel1[3] = [$x + 3, $y + 2, $c1], $pixel2[3] = [$x + 1, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 1, $c3]
  223. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  224. $x += $width
  225. Return "F"
  226. Else
  227. $x += 1
  228. EndIf
  229. Next
  230. $x -= 4
  231.  
  232. ;search for 'f'
  233. $width = 5
  234. Local $c1 = Hex(0xC4C5C4, 6), $c2 = Hex(0xBFC0BF, 6), $c3 = Hex(0x535653, 6)
  235. For $i = 1 To 4
  236. Local $pixel1[3] = [$x + 5, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 4, $c2], $pixel3[3] = [$x + 2, $y + 8, $c3]
  237. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  238. $x += $width
  239. Return "f"
  240. Else
  241. $x += 1
  242. EndIf
  243. Next
  244. $x -= 4
  245.  
  246. ;search for 'G'
  247. $width = 6
  248. Local $c1 = Hex(0x707370, 6), $c2 = Hex(0xC4C5C4, 6), $c3 = Hex(0xD1D2D1, 6)
  249. For $i = 1 To 4
  250. Local $pixel1[3] = [$x + 4, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 0, $c2], $pixel3[3] = [$x + 4, $y + 5, $c3]
  251. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  252. $x += $width
  253. Return "G"
  254. Else
  255. $x += 1
  256. EndIf
  257. Next
  258. $x -= 4
  259.  
  260. ;search for 'g'
  261. $width = 5
  262. Local $c1 = Hex(0xD7D8D7, 6), $c2 = Hex(0xF2F2F2, 6), $c3 = Hex(0xE6E7E6, 6)
  263. For $i = 1 To 4
  264. Local $pixel1[3] = [$x + 1, $y + 9, $c1], $pixel2[3] = [$x + 4, $y + 9, $c2], $pixel3[3] = [$x + 4, $y + 4, $c3]
  265. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  266. $x += $width
  267. Return "g"
  268. Else
  269. $x += 1
  270. EndIf
  271. Next
  272. $x -= 4
  273.  
  274. ;search for 'H'
  275. $width = 8
  276. Local $c1 = Hex(0x5F635F, 6), $c2 = Hex(0x464A46, 6), $c3 = Hex(0xFAFAFA, 6)
  277. For $i = 1 To 4
  278. Local $pixel1[3] = [$x + 5, $y + 8, $c1], $pixel2[3] = [$x + 3, $y + 3, $c2], $pixel3[3] = [$x + 1, $y + 1, $c3]
  279. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  280. $x += $width
  281. Return "H"
  282. Else
  283. $x += 1
  284. EndIf
  285. Next
  286. $x -= 4
  287.  
  288. ;search for 'h'
  289. $width = 6
  290. Local $c1 = Hex(0x818481, 6), $c2 = Hex(0xD3D4D3, 6), $c3 = Hex(0x646764, 6)
  291. For $i = 1 To 4
  292. Local $pixel1[3] = [$x + 2, $y + 5, $c1], $pixel2[3] = [$x + 3, $y + 4, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3]
  293. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  294. $x += $width
  295. Return "h"
  296. Else
  297. $x += 1
  298. EndIf
  299. Next
  300. $x -= 4
  301.  
  302. ;search for 'I'
  303. $width = 2
  304. Local $c1 = Hex(0xFEFEFE, 6), $c2 = Hex(0xA3A5A3, 6), $c3 = Hex(0xE1E1E1, 6)
  305. For $i = 1 To 4
  306. Local $pixel1[3] = [$x + 1, $y + 2, $c1], $pixel2[3] = [$x + 2, $y + 5, $c2], $pixel3[3] = [$x + 1, $y + 8, $c3]
  307. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  308. $x += $width
  309. Return "I"
  310. Else
  311. $x += 1
  312. EndIf
  313. Next
  314. $x -= 4
  315.  
  316. ;search for 'i'
  317. $width = 2
  318. Local $c1 = Hex(0xF0F1F0, 6), $c2 = Hex(0x454945, 6), $c3 = Hex(0xE1E1E1, 6)
  319. For $i = 1 To 4
  320. Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 2, $c2], $pixel3[3] = [$x + 1, $y + 8, $c3]
  321. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  322. $x += $width
  323. Return "i"
  324. Else
  325. $x += 1
  326. EndIf
  327. Next
  328. $x -= 4
  329.  
  330. ;search for 'J'
  331. $width = 6
  332. Local $c1 = Hex(0x8E908E, 6), $c2 = Hex(0xC4C5C4, 6), $c3 = Hex(0xFBFBFB, 6)
  333. For $i = 1 To 4
  334. Local $pixel1[3] = [$x + 1, $y + 5, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 6, $y + 1, $c3]
  335. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  336. $x += $width
  337. Return "J"
  338. Else
  339. $x += 1
  340. EndIf
  341. Next
  342. $x -= 4
  343.  
  344. ;search for 'j'
  345. $width = 3
  346. Local $c1 = Hex(0xA0A2A0, 6), $c2 = Hex(0xCFD0CF, 6), $c3 = Hex(0xFEFEFE, 6)
  347. For $i = 1 To 4
  348. Local $pixel1[3] = [$x + 1, $y + 0, $c1], $pixel2[3] = [$x + 1, $y + 3, $c2], $pixel3[3] = [$x + 1, $y + 9, $c3]
  349. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  350. $x += $width
  351. Return "j"
  352. Else
  353. $x += 1
  354. EndIf
  355. Next
  356. $x -= 4
  357.  
  358. ;search for 'K'
  359. $width = 7
  360. Local $c1 = Hex(0xC7C8C7, 6), $c2 = Hex(0x828482, 6), $c3 = Hex(0x7C7E7C, 6)
  361. For $i = 1 To 4
  362. Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 3, $y + 6, $c2], $pixel3[3] = [$x + 6, $y + 0, $c3]
  363. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  364. $x += $width
  365. Return "K"
  366. Else
  367. $x += 1
  368. EndIf
  369. Next
  370. $x -= 4
  371.  
  372. ;search for 'k'
  373. $width = 5
  374. Local $c1 = Hex(0xFBFBFB, 6), $c2 = Hex(0x646764, 6), $c3 = Hex(0xDBDCDB, 6)
  375. For $i = 1 To 4
  376. Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 2, $y + 1, $c2], $pixel3[3] = [$x + 4, $y + 8, $c3]
  377. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  378. $x += $width
  379. Return "k"
  380. Else
  381. $x += 1
  382. EndIf
  383. Next
  384. $x -= 4
  385.  
  386. ;search for 'L'
  387. $width = 3
  388. Local $c1 = Hex(0xFDFDFD, 6), $c2 = Hex(0x828482, 6), $c3 = Hex(0x646764, 6)
  389. For $i = 1 To 4
  390. Local $pixel1[3] = [$x + 2, $y + 7, $c1], $pixel2[3] = [$x + 4, $y + 7, $c2], $pixel3[3] = [$x + 1, $y + 0, $c3]
  391. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  392. $x += $width
  393. Return "L"
  394. Else
  395. $x += 1
  396. EndIf
  397. Next
  398. $x -= 4
  399.  
  400. ;search for 'l'
  401. $width = 2
  402. Local $c1 = Hex(0xFEFEFE, 6), $c2 = Hex(0x909290, 6), $c3 = Hex(0xFEFEFE, 6)
  403. For $i = 1 To 4
  404. Local $pixel1[3] = [$x + 1, $y + 2, $c1], $pixel2[3] = [$x + 0, $y + 2, $c2], $pixel3[3] = [$x + 1, $y + 7, $c3]
  405. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  406. $x += $width
  407. Return "l"
  408. Else
  409. $x += 1
  410. EndIf
  411. Next
  412. $x -= 4
  413.  
  414. ;search for 'M'
  415. $width = 10
  416. Local $c1 = Hex(0x8C8E8C, 6), $c2 = Hex(0x6A6D6A, 6), $c3 = Hex(0xA9ABA9, 6)
  417. For $i = 1 To 4
  418. Local $pixel1[3] = [$x + 4, $y + 8, $c1], $pixel2[3] = [$x + 6, $y + 1, $c2], $pixel3[3] = [$x + 8, $y + 8, $c3]
  419. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  420. $x += $width
  421. Return "M"
  422. Else
  423. $x += 1
  424. EndIf
  425. Next
  426. $x -= 4
  427.  
  428. ;search for 'm'
  429. $width = 10
  430. Local $c1 = Hex(0xD5D6D5, 6), $c2 = Hex(0x585C58, 6), $c3 = Hex(0xFFFFFF, 6)
  431. For $i = 1 To 4
  432. Local $pixel1[3] = [$x + 1, $y + 8, $c1], $pixel2[3] = [$x + 7, $y + 2, $c2], $pixel3[3] = [$x + 5, $y + 4, $c3]
  433. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  434. $x += $width
  435. Return "m"
  436. Else
  437. $x += 1
  438. EndIf
  439. Next
  440. $x -= 4
  441.  
  442. ;search for 'N'
  443. $width = 7
  444. Local $c1 = Hex(0x949694, 6), $c2 = Hex(0x707370, 6), $c3 = Hex(0xBFC0BF, 6)
  445. For $i = 1 To 4
  446. Local $pixel1[3] = [$x + 3, $y + 1, $c1], $pixel2[3] = [$x + 5, $y + 4, $c2], $pixel3[3] = [$x + 6, $y + 1, $c3]
  447. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  448. $x += $width
  449. Return "N"
  450. Else
  451. $x += 1
  452. EndIf
  453. Next
  454. $x -= 4
  455.  
  456. ;search for 'n'
  457. $width = 6
  458. Local $c1 = Hex(0xBEC0BE, 6), $c2 = Hex(0x8A8D8A, 6), $c3 = Hex(0x7A7D7A, 6)
  459. For $i = 1 To 4
  460. Local $pixel1[3] = [$x + 5, $y + 3, $c1], $pixel2[3] = [$x + 4, $y + 8, $c2], $pixel3[3] = [$x + 2, $y + 5, $c3]
  461. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  462. $x += $width
  463. Return "n"
  464. Else
  465. $x += 1
  466. EndIf
  467. Next
  468. $x -= 4
  469.  
  470. ;search for 'O'
  471. $width = 6
  472. Local $c1 = Hex(0xBBBDBB, 6), $c2 = Hex(0x888A88, 6), $c3 = Hex(0xD9DAD9, 6)
  473. For $i = 1 To 4
  474. Local $pixel1[3] = [$x + 2, $y + 6, $c1], $pixel2[3] = [$x + 2, $y + 0, $c2], $pixel3[3] = [$x + 5, $y + 6, $c3]
  475. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  476. $x += $width
  477. Return "O"
  478. Else
  479. $x += 1
  480. EndIf
  481. Next
  482. $x -= 4
  483.  
  484. ;search for 'o'
  485. $width = 6
  486. Local $c1 = Hex(0x888A88, 6), $c2 = Hex(0xA9ABA9, 6), $c3 = Hex(0x585C58, 6)
  487. For $i = 1 To 4
  488. Local $pixel1[3] = [$x + 2, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 5, $c2], $pixel3[3] = [$x + 3, $y + 2, $c3]
  489. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  490. $x += $width
  491. Return "o"
  492. Else
  493. $x += 1
  494. EndIf
  495. Next
  496. $x -= 4
  497.  
  498. ;search for 'P'
  499. $width = 6
  500. Local $c1 = Hex(0x636663, 6), $c2 = Hex(0x858785, 6), $c3 = Hex(0xE6E7E6, 6)
  501. For $i = 1 To 4
  502. Local $pixel1[3] = [$x + 4, $y + 2, $c1], $pixel2[3] = [$x + 2, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3]
  503. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  504. $x += $width
  505. Return "P"
  506. Else
  507. $x += 1
  508. EndIf
  509. Next
  510. $x -= 4
  511.  
  512. ;search for 'p'
  513. $width = 5
  514. Local $c1 = Hex(0x8D908D, 6), $c2 = Hex(0xFFFFFF, 6), $c3 = Hex(0x898B89, 6)
  515. For $i = 1 To 4
  516. Local $pixel1[3] = [$x + 2, $y + 4, $c1], $pixel2[3] = [$x + 1, $y + 10, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3]
  517. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  518. $x += $width
  519. Return "p"
  520. Else
  521. $x += 1
  522. EndIf
  523. Next
  524. $x -= 4
  525.  
  526. ;search for 'Q'
  527. $width = 7
  528. Local $c1 = Hex(0xE6E7E6, 6), $c2 = Hex(0xABADAB, 6), $c3 = Hex(0xFFFFFF, 6)
  529. For $i = 1 To 4
  530. Local $pixel1[3] = [$x + 4, $y + 9, $c1], $pixel2[3] = [$x + 2, $y + 2, $c2], $pixel3[3] = [$x + 6, $y + 4, $c3]
  531. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  532. $x += $width
  533. Return "Q"
  534. Else
  535. $x += 1
  536. EndIf
  537. Next
  538. $x -= 4
  539.  
  540. ;search for 'q'
  541. $width = 6
  542. Local $c1 = Hex(0x696C69, 6), $c2 = Hex(0xFFFFFF, 6), $c3 = Hex(0xC1C2C1, 6)
  543. For $i = 1 To 4
  544. Local $pixel1[3] = [$x + 3, $y + 4, $c1], $pixel2[3] = [$x + 4, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 10, $c3]
  545. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  546. $x += $width
  547. Return "q"
  548. Else
  549. $x += 1
  550. EndIf
  551. Next
  552. $x -= 4
  553.  
  554. ;search for 'R'
  555. $width = 7
  556. Local $c1 = Hex(0x575A57, 6), $c2 = Hex(0x939593, 6), $c3 = Hex(0xB8BAB8, 6)
  557. For $i = 1 To 4
  558. Local $pixel1[3] = [$x + 4, $y + 2, $c1], $pixel2[3] = [$x + 3, $y + 6, $c2], $pixel3[3] = [$x + 6, $y + 1, $c3]
  559. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  560. $x += $width
  561. Return "R"
  562. Else
  563. $x += 1
  564. EndIf
  565. Next
  566. $x -= 4
  567.  
  568. ;search for 'r'
  569. $width = 5
  570. Local $c1 = Hex(0x747774, 6), $c2 = Hex(0x5F635F, 6), $c3 = Hex(0x464A46, 6)
  571. For $i = 1 To 4
  572. Local $pixel1[3] = [$x + 4, $y + 5, $c1], $pixel2[3] = [$x + 2, $y + 6, $c2], $pixel3[3] = [$x + 2, $y + 2, $c3]
  573. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  574. $x += $width
  575. Return "r"
  576. Else
  577. $x += 1
  578. EndIf
  579. Next
  580. $x -= 4
  581.  
  582. ;search for 'S'
  583. $width = 7
  584. Local $c1 = Hex(0x8E908E, 6), $c2 = Hex(0x9C9E9C, 6), $c3 = Hex(0x7C7F7C, 6)
  585. For $i = 1 To 4
  586. Local $pixel1[3] = [$x + 2, $y + 0, $c1], $pixel2[3] = [$x + 5, $y + 4, $c2], $pixel3[3] = [$x + 3, $y + 7, $c3]
  587. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  588. $x += $width
  589. Return "S"
  590. Else
  591. $x += 1
  592. EndIf
  593. Next
  594. $x -= 4
  595.  
  596. ;search for 's'
  597. $width = 6
  598. Local $c1 = Hex(0x707370, 6), $c2 = Hex(0xC3C4C3, 6), $c3 = Hex(0x909290, 6)
  599. For $i = 1 To 4
  600. Local $pixel1[3] = [$x + 2, $y + 2, $c1], $pixel2[3] = [$x + 4, $y + 4, $c2], $pixel3[3] = [$x + 2, $y + 7, $c3]
  601. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  602. $x += $width
  603. Return "s"
  604. Else
  605. $x += 1
  606. EndIf
  607. Next
  608. $x -= 4
  609.  
  610. ;search for 'T'
  611. $width = 6
  612. Local $c1 = Hex(0x707370, 6), $c2 = Hex(0xB7B8B7, 6), $c3 = Hex(0x969896, 6)
  613. For $i = 1 To 4
  614. Local $pixel1[3] = [$x + 1, $y + 0, $c1], $pixel2[3] = [$x + 4, $y + 2, $c2], $pixel3[3] = [$x + 2, $y + 8, $c3]
  615. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  616. $x += $width
  617. Return "T"
  618. Else
  619. $x += 1
  620. EndIf
  621. Next
  622. $x -= 4
  623.  
  624. ;search for 't'
  625. $width = 6
  626. Local $c1 = Hex(0x767976, 6), $c2 = Hex(0xB6B8B6, 6), $c3 = Hex(0xA6A8A6, 6)
  627. For $i = 1 To 4
  628. Local $pixel1[3] = [$x + 2, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 8, $c2], $pixel3[3] = [$x + 4, $y + 6, $c3]
  629. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  630. $x += $width
  631. Return "t"
  632. Else
  633. $x += 1
  634. EndIf
  635. Next
  636. $x -= 4
  637.  
  638. ;search for 'U'
  639. $width = 7
  640. Local $c1 = Hex(0xFBFBFB, 6), $c2 = Hex(0x626562, 6), $c3 = Hex(0xBFC0BF, 6)
  641. For $i = 1 To 4
  642. Local $pixel1[3] = [$x + 1, $y + 1, $c1], $pixel2[3] = [$x + 1, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 1, $c3]
  643. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  644. $x += $width
  645. Return "U"
  646. Else
  647. $x += 1
  648. EndIf
  649. Next
  650. $x -= 4
  651.  
  652. ;search for 'u'
  653. $width = 6
  654. Local $c1 = Hex(0x525652, 6), $c2 = Hex(0xCBCCCB, 6), $c3 = Hex(0x888A88, 6)
  655. For $i = 1 To 4
  656. Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 2, $y + 7, $c2], $pixel3[3] = [$x + 4, $y + 3, $c3]
  657. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  658. $x += $width
  659. Return "u"
  660. Else
  661. $x += 1
  662. EndIf
  663. Next
  664. $x -= 4
  665.  
  666. ;search for 'V'
  667. $width = 7
  668. Local $c1 = Hex(0x898C89, 6), $c2 = Hex(0x707370, 6), $c3 = Hex(0xE1E2E1, 6)
  669. For $i = 1 To 4
  670. Local $pixel1[3] = [$x + 2, $y + 2, $c1], $pixel2[3] = [$x + 3, $y + 5, $c2], $pixel3[3] = [$x + 5, $y + 7, $c3]
  671. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  672. $x += $width
  673. Return "V"
  674. Else
  675. $x += 1
  676. EndIf
  677. Next
  678. $x -= 4
  679.  
  680. ;search for 'v'
  681. $width = 6
  682. Local $c1 = Hex(0x595C59, 6), $c2 = Hex(0x525652, 6), $c3 = Hex(0xEEEEEE, 6)
  683. For $i = 1 To 4
  684. Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 3, $y + 6, $c2], $pixel3[3] = [$x + 5, $y + 3, $c3]
  685. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  686. $x += $width
  687. Return "v"
  688. Else
  689. $x += 1
  690. EndIf
  691. Next
  692. $x -= 4
  693.  
  694. ;search for 'W'
  695. $width = 11
  696. Local $c1 = Hex(0xAEB0AE, 6), $c2 = Hex(0xC5C6C5, 6), $c3 = Hex(0x989A98, 6)
  697. For $i = 1 To 4
  698. Local $pixel1[3] = [$x + 2, $y + 3, $c1], $pixel2[3] = [$x + 6, $y + 1, $c2], $pixel3[3] = [$x + 9, $y + 8, $c3]
  699. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  700. $x += $width
  701. Return "W"
  702. Else
  703. $x += 1
  704. EndIf
  705. Next
  706. $x -= 4
  707.  
  708. ;search for 'w'
  709. $width = 9
  710. Local $c1 = Hex(0x8E918E, 6), $c2 = Hex(0x747674, 6), $c3 = Hex(0x797C79, 6)
  711. For $i = 1 To 4
  712. Local $pixel1[3] = [$x + 3, $y + 5, $c1], $pixel2[3] = [$x + 5, $y + 7, $c2], $pixel3[3] = [$x + 8, $y + 8, $c3]
  713. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  714. $x += $width
  715. Return "w"
  716. Else
  717. $x += 1
  718. EndIf
  719. Next
  720. $x -= 4
  721.  
  722. ;search for 'X'
  723. $width = 7
  724. Local $c1 = Hex(0x989B98, 6), $c2 = Hex(0x939593, 6), $c3 = Hex(0xB6B8B6, 6)
  725. For $i = 1 To 4
  726. Local $pixel1[3] = [$x + 1, $y + 2, $c1], $pixel2[3] = [$x + 3, $y + 7, $c2], $pixel3[3] = [$x + 5, $y + 4, $c3]
  727. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  728. $x += $width
  729. Return "X"
  730. Else
  731. $x += 1
  732. EndIf
  733. Next
  734. $x -= 4
  735.  
  736. ;search for 'x'
  737. $width = 6
  738. Local $c1 = Hex(0x8C8E8C, 6), $c2 = Hex(0x9EA09E, 6), $c3 = Hex(0x4C4F4C, 6)
  739. For $i = 1 To 4
  740. Local $pixel1[3] = [$x + 1, $y + 4, $c1], $pixel2[3] = [$x + 2, $y + 8, $c2], $pixel3[3] = [$x + 5, $y + 6, $c3]
  741. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  742. $x += $width
  743. Return "x"
  744. Else
  745. $x += 1
  746. EndIf
  747. Next
  748. $x -= 4
  749.  
  750. ;search for 'Y'
  751. $width = 7
  752. Local $c1 = Hex(0xA1A3A1, 6), $c2 = Hex(0x8C8E8C, 6), $c3 = Hex(0xD5D6D5, 6)
  753. For $i = 1 To 4
  754. Local $pixel1[3] = [$x + 2, $y + 1, $c1], $pixel2[3] = [$x + 5, $y + 5, $c2], $pixel3[3] = [$x + 3, $y + 8, $c3]
  755. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  756. $x += $width
  757. Return "Y"
  758. Else
  759. $x += 1
  760. EndIf
  761. Next
  762. $x -= 4
  763.  
  764. ;search for 'y'
  765. $width = 6
  766. Local $c1 = Hex(0x5D615D, 6), $c2 = Hex(0xEEEEEE, 6), $c3 = Hex(0xE8E9E8, 6)
  767. For $i = 1 To 4
  768. Local $pixel1[3] = [$x + 1, $y + 8, $c1], $pixel2[3] = [$x + 3, $y + 7, $c2], $pixel3[3] = [$x + 3, $y + 10, $c3]
  769. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  770. $x += $width
  771. Return "y"
  772. Else
  773. $x += 1
  774. EndIf
  775. Next
  776. $x -= 4
  777.  
  778. ;search for 'Z'
  779. $width = 7
  780. Local $c1 = Hex(0x505450, 6), $c2 = Hex(0x707370, 6), $c3 = Hex(0x888B88, 6)
  781. For $i = 1 To 4
  782. Local $pixel1[3] = [$x + 2, $y + 2, $c1], $pixel2[3] = [$x + 1, $y + 7, $c2], $pixel3[3] = [$x + 5, $y + 7, $c3]
  783. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  784. $x += $width
  785. Return "Z"
  786. Else
  787. $x += 1
  788. EndIf
  789. Next
  790. $x -= 4
  791.  
  792. ;search for 'z'
  793. $width = 4
  794. Local $c1 = Hex(0x757775, 6), $c2 = Hex(0x757875, 6), $c3 = Hex(0xDADBDA, 6)
  795. For $i = 1 To 4
  796. Local $pixel1[3] = [$x + 1, $y + 4, $c1], $pixel2[3] = [$x + 3, $y + 5, $c2], $pixel3[3] = [$x + 2, $y + 8, $c3]
  797. If boolPixelSearchChar($pixel1, $pixel2, $pixel3) Then
  798. $x += $width
  799. Return "z"
  800. Else
  801. $x += 1
  802. EndIf
  803. Next
  804. $x -= 4
  805.  
  806. Return "¦"
  807. EndFunc ;==>getChar
  808.  
  809.  
  810. #Region ##### PIXEL PROCESSING #####
  811. Func _CaptureRegion($iLeft = 0, $iTop = 0, $iRight = 860, $iBottom = 720, $ReturnBMP = False)
  812. _GDIPlus_BitmapDispose($hBitmap)
  813. _WinAPI_DeleteObject($hHBitmap)
  814. Local $iW = Number($iRight) - Number($iLeft), $iH = Number($iBottom) - Number($iTop)
  815. Local $hDC_Capture = _WinAPI_GetWindowDC(ControlGetHandle("BlueStacks App Player", "", "[CLASS:BlueStacksApp; INSTANCE:1]"))
  816. Local $hMemDC = _WinAPI_CreateCompatibleDC($hDC_Capture)
  817. $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC_Capture, $iW, $iH)
  818. Local $hObjectOld = _WinAPI_SelectObject($hMemDC, $hHBitmap)
  819. DllCall($user32, "int", "PrintWindow", "hwnd", $HWnD, "handle", $hMemDC, "int", 0)
  820. _WinAPI_SelectObject($hMemDC, $hHBitmap)
  821. _WinAPI_BitBlt($hMemDC, 0, 0, $iW, $iH, $hDC_Capture, $iLeft, $iTop, 0x00CC0020)
  822. $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap)
  823. _WinAPI_DeleteDC($hMemDC)
  824. _WinAPI_SelectObject($hMemDC, $hObjectOld)
  825. _WinAPI_ReleaseDC($HWnD, $hDC_Capture)
  826. EndFunc ;==>_CaptureRegion
  827. Func _PixelGetColor_GetPixel($iX, $iY)
  828. Local $aPixelColor = _GDIPlus_BitmapGetPixel($hBitmap, $iX, $iY)
  829. Return Hex($aPixelColor, 6)
  830. EndFunc ;==>_PixelGetColor_GetPixel
  831. Func _PixelSearch($iLeft, $iTop, $iRight, $iBottom, $iColor, $ColorVariation)
  832. _CaptureRegion($iLeft, $iTop, $iRight, $iBottom)
  833. For $x = $iRight - $iLeft To 0 Step -1
  834. For $y = 0 To $iBottom - $iTop
  835. Local $nColor1 = $iColor
  836. Local $nColor2 = _PixelGetColor_GetPixel($x, $y)
  837. If _ColorCheckVariation($nColor1, $nColor2, $ColorVariation) Then
  838. Local $Pos[2] = [$iLeft + $x, $iTop + $y]
  839. Return $Pos
  840. EndIf
  841. Next
  842. Next
  843. Return 0
  844. EndFunc ;==>_PixelSearch
  845. Func _ColorCheckVariation($nColor1, $nColor2, $sVari = 5)
  846. Local $Red1, $Red2, $Blue1, $Blue2, $Green1, $Green2
  847. $Red1 = Dec(StringMid(String($nColor1), 1, 2))
  848. $Blue1 = Dec(StringMid(String($nColor1), 3, 2))
  849. $Green1 = Dec(StringMid(String($nColor1), 5, 2))
  850. $Red2 = Dec(StringMid(String($nColor2), 1, 2))
  851. $Blue2 = Dec(StringMid(String($nColor2), 3, 2))
  852. $Green2 = Dec(StringMid(String($nColor2), 5, 2))
  853. If Abs($Blue1 - $Blue2) > $sVari Then Return False
  854. If Abs($Green1 - $Green2) > $sVari Then Return False
  855. If Abs($Red1 - $Red2) > $sVari Then Return False
  856. Return True
  857. EndFunc ;==>_ColorCheckVariation
  858. Func CheckColorVariPos($x, $y, $c, $vp = 0, $vc = 10)
  859. For $a = $x - $vp To $x + $vp
  860. For $b = $y - $vp To $y + $vp
  861. If _ColorCheckVariation(_PixelGetColor_GetPixel($a, $b), Hex($c, 6), $vc) Then
  862. Return True
  863. EndIf
  864. Next
  865. Next
  866. Return False
  867. EndFunc ;==>CheckColorVariPos
  868. #EndRegion ##### PIXEL PROCESSING #####
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement