Python Bot


SUBMITTED BY: Guest

DATE: Jan. 6, 2015, 8:52 p.m.

FORMAT: Python

SIZE: 3.5 kB

HITS: 1324

  1. import os, sys
  2. import Image, ImageGrab, ImageOps
  3. import time, random
  4. from random import randrange
  5. import win32api, win32con
  6. from numpy import *
  7. # Globals
  8. # ------------------
  9. x_pad = 0
  10. y_pad = 0
  11. # Screen Grab Function
  12. def screenGrab():
  13. b1 = (x_pad + 1,y_pad+1,x_pad+1921,y_pad+1081)
  14. im = ImageGrab.grab()
  15. return im
  16. #function for clicking
  17. def click(x,y):
  18. win32api.SetCursorPos((x,y))
  19. win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0)
  20. win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0,0)
  21. #goes to the third row
  22. def thirdRow():
  23. count = 0
  24. x=588
  25. y= 676
  26. while count <= 3:
  27. s = screenGrab()
  28. xy = (x, y)
  29. s = s.convert('RGB')
  30. r, g, b = s.getpixel(xy)
  31. if r > 200:
  32. count += 1
  33. x += 62
  34. print "Anti Bot"
  35. elif count <= 3 :
  36. click(x,y)
  37. time.sleep(3)
  38. #win32api.mouse_event(win32con.MOUSEEVENTF_WHEEL, x, y, -10000, 0)
  39. time.sleep(1)
  40. click(1272,511)
  41. time.sleep(.5)
  42. click(1272,551)
  43. time.sleep(.5)
  44. click(1272,591)
  45. time.sleep(2)
  46. click(1455,310)
  47. time.sleep(4)
  48. x += 62
  49. count += 1
  50. #Goes to the second row
  51. def secondRow():
  52. count = 0
  53. x=714
  54. y=548
  55. while count <= 3:
  56. s = screenGrab()
  57. xy = (x, y)
  58. s = s.convert('RGB')
  59. r, g, b = s.getpixel(xy)
  60. if r > 200:
  61. count += 1
  62. x += 62
  63. print "Anti Bot"
  64. elif count <= 3 :
  65. click(x,y)
  66. time.sleep(3)
  67. #win32api.mouse_event(win32con.MOUSEEVENTF_WHEEL, x, y, -10000, 0)
  68. time.sleep(1)
  69. click(1272,511)
  70. time.sleep(.5)
  71. click(1272,551)
  72. time.sleep(.5)
  73. click(1272,591)
  74. time.sleep(2)
  75. click(1455,310)
  76. time.sleep(4)
  77. x += 62
  78. count += 1
  79. #Main Loop
  80. while True:
  81. count = 0
  82. x = 590
  83. y = 420
  84. while count <= 5:
  85. s = screenGrab()
  86. xy = (x, y)
  87. s = s.convert('RGB')
  88. r, g, b = s.getpixel(xy)
  89. #Checks for the Anti Botting button, skips if it finds one
  90. if r > 200:
  91. count += 1
  92. x += 62
  93. print "Anti Bot"
  94. #All the clicking done here
  95. elif count <= 5:
  96. click(x,y)
  97. time.sleep(3)
  98. #win32api.mouse_event(win32con.MOUSEEVENTF_WHEEL, x, y, -10000, 0)
  99. time.sleep(1)
  100. click(1272,511)
  101. time.sleep(.5)
  102. click(1272,551)
  103. time.sleep(.5)
  104. click(1272,591)
  105. time.sleep(2)
  106. click(1455,310)
  107. time.sleep(4)
  108. x += 62
  109. count += 1
  110. #time.sleep(60)
  111. secondRow()
  112. #time.sleep(60)
  113. thirdRow()
  114. click(760,813)
  115. time.sleep(6)
  116. click(111,16)
  117. time.sleep(4)
  118. #time.sleep(55)
  119. #Python Bot for Like4Like.org

comments powered by Disqus