Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def StartCH(): # Make sure CH tab is selected and start the run.
- if exists("1435481230906.png"): # looks for game tab on firefox
- click(getLastMatch())
- # makes abox left of where i need to scroll character to till i automate it
- Region.create(Rb.left(100)).highlight();
- mouseMove("1435402415929.png") # just lets me know i got time to scroll
- wait(5)
- else:
- popup("Clicker Heroes Is Not Running")
- # end of StartCH
- #
- def Pchat(): # If mouse is in chat area do nothing
- #if Rc.contains(Mouse.at()):
- while Chat.contains(Mouse.at()):
- pass
- # end of chat
- #
- def Tfarm(): # checks the progression button if its off wait a while then turn it back on
- Start = time.time()
- while exists(Pattern("1435503587183.png").similar(0.94)):
- Hero()
- if time.time() - Start > Settings.maxT:
- click(Pattern("1435503587183.png").similar(0.94))
- mouseMove("1435553154282.png")
- #
- #
- #
- def Hero():
- keyDown("z") # hold down z to buy 25 levels
- wait(1)
- Rb.click()
- keyUp()
- wait(0.5)
- mouseMove(Rb.left(100)) # move mouse to get rid of info screen when on character
- #
- #
- def Gild(): # checks for the gild present and deals with it
- if exists("1435587514020.png"):
- click("1435587514020.png")
- wait(1)
- if exists("1435585518660.png"):
- click("1435585518660.png")
- wait(2)
- click(Pattern("1435588421462.png").similar(0.85))
- #
- Settings.maxT = 30.0
- #
- # create regions
- Fish = Region(486,306,643,429) # area where fish spawns
- Chat = Region(1133,228,309,596) # chat area
- Rb = Region(154,542,110,63) # level up button
- #
- StartCH()
- # Region.create(Rb.left(100)).highlight();
- #
- while True:
- StartPosition = Env.getMouseLocation() #This variable is set to detect if you are actively moving the mouse.
- wait(2)
- EndPosition = Env.getMouseLocation()
- Pchat()
- 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.
- StartPosition = Env.getMouseLocation()
- wait(3)
- EndPosition = Env.getMouseLocation()
- Pchat()
- # end of loop
- if Fish.exists(Pattern("1435578564051.png").similar(0.85)):
- Fish.click(Pattern("1435578564051.png").similar(0.85))
- wait(2)
- Hero()
- #
- if exists(Pattern("1435503587183.png").similar(0.94)):
- Tfarm()
- if exists("1435587514020.png"):
- Gild()
Advertisement
Add Comment
Please, Sign In to add comment