Guest User

clicker heros script

a guest
Jul 1st, 2015
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. def StartCH(): # Make sure CH tab is selected and start the run.
  2. if exists("1435481230906.png"): # looks for game tab on firefox
  3. click(getLastMatch())
  4. # makes abox left of where i need to scroll character to till i automate it
  5. Region.create(Rb.left(100)).highlight();
  6. mouseMove("1435402415929.png") # just lets me know i got time to scroll
  7. wait(5)
  8. else:
  9. popup("Clicker Heroes Is Not Running")
  10. # end of StartCH
  11. #
  12. def Pchat(): # If mouse is in chat area do nothing
  13. #if Rc.contains(Mouse.at()):
  14. while Chat.contains(Mouse.at()):
  15. pass
  16. # end of chat
  17. #
  18. def Tfarm(): # checks the progression button if its off wait a while then turn it back on
  19. Start = time.time()
  20. while exists(Pattern("1435503587183.png").similar(0.94)):
  21. Hero()
  22. if time.time() - Start > Settings.maxT:
  23. click(Pattern("1435503587183.png").similar(0.94))
  24. mouseMove("1435553154282.png")
  25. #
  26. #
  27. #
  28. def Hero():
  29. keyDown("z") # hold down z to buy 25 levels
  30. wait(1)
  31. Rb.click()
  32. keyUp()
  33. wait(0.5)
  34. mouseMove(Rb.left(100)) # move mouse to get rid of info screen when on character
  35. #
  36. #
  37. def Gild(): # checks for the gild present and deals with it
  38. if exists("1435587514020.png"):
  39. click("1435587514020.png")
  40. wait(1)
  41. if exists("1435585518660.png"):
  42. click("1435585518660.png")
  43. wait(2)
  44. click(Pattern("1435588421462.png").similar(0.85))
  45. #
  46. Settings.maxT = 30.0
  47. #
  48. # create regions
  49. Fish = Region(486,306,643,429) # area where fish spawns
  50. Chat = Region(1133,228,309,596) # chat area
  51. Rb = Region(154,542,110,63) # level up button
  52. #
  53. StartCH()
  54. # Region.create(Rb.left(100)).highlight();
  55. #
  56. while True:
  57. StartPosition = Env.getMouseLocation() #This variable is set to detect if you are actively moving the mouse.
  58. wait(2)
  59. EndPosition = Env.getMouseLocation()
  60. Pchat()
  61. while StartPosition != EndPosition:# loop 3 Here we check if the mouse moved at all while the scripts were running. If it has, enter a side loop until the mouse stops moving for 2 seconds.
  62. StartPosition = Env.getMouseLocation()
  63. wait(3)
  64. EndPosition = Env.getMouseLocation()
  65. Pchat()
  66. # end of loop
  67. if Fish.exists(Pattern("1435578564051.png").similar(0.85)):
  68. Fish.click(Pattern("1435578564051.png").similar(0.85))
  69. wait(2)
  70. Hero()
  71. #
  72. if exists(Pattern("1435503587183.png").similar(0.94)):
  73. Tfarm()
  74. if exists("1435587514020.png"):
  75. Gild()
Advertisement
Add Comment
Please, Sign In to add comment