Untitled diff
440 líneas
#The original script was made by Evildeliverance.
#The original script was made by Evildeliverance.
#Credit to Reddit user Dewarim for introducing Evildeliverance to this tool with his Fish autoSettings.MainScreen.clicker.
#Credit to Reddit user Dewarim for introducing Evildeliverance to this tool with his Fish autoSettings.MainScreen.clicker.
#---
#---
#The core (original script): "Settings.MainScreen.clickerHeroes.sikuli.2.0" by Evildeliverance
#The core (original script): "Settings.MainScreen.clickerHeroes.sikuli.2.0" by Evildeliverance
#------------------------
#------------------------
#This edition of the original script is made by TheWhiteAvatar. Message me on Reddit if you need help.
#This edition of the original script is made by TheWhiteAvatar. Message me on Reddit if you need help.
#
#
#"ClickerHeroes-Sikuli-TWA" - Version 1.2.2 (For the game v0.25 + Chinese New Year Theme)
#"ClickerHeroes-Sikuli-TWA" - Version 1.2.2 (For the game v0.25 + Chinese New Year Theme)
#
#
#New Features added: code improvements, Midas start, laptop resolutions support, Mac OS support,
#New Features added: code improvements, Midas start, laptop resolutions support, Mac OS support,
#short active mode before ascensions, dumping HS into Solomon, quests achievements farming, and other things...
#short active mode before ascensions, dumping HS into Solomon, quests achievements farming, and other things...
#------------------------
#------------------------
#New in version 1.2.2:
#New in version 1.2.2:
# - Automatic support of two monitors (you can run the game on either monitor, and it should work).
# - Automatic support of two monitors (you can run the game on either monitor, and it should work).
# You can even move your browser window between two monitors (in the middle of a speed run)
# You can even move your browser window between two monitors (in the middle of a speed run)
# and it should continue working after a few seconds when you stop moving your mouse.
# and it should continue working after a few seconds when you stop moving your mouse.
# (Just don't interrupt ascending routines in the beginning and the ending of a run).
# (Just don't interrupt ascending routines in the beginning and the ending of a run).
# If you will be changing your monitors setup, don't forget to restart the script (if it was running).
# If you will be changing your monitors setup, don't forget to restart the script (if it was running).
#------------------------
#------------------------
#------
#------
#This script automatically detects and Settings.MainScreen.clicks on Settings.MainScreen.clickables whenever they appear.
#This script automatically detects and Settings.MainScreen.clicks on Settings.MainScreen.clickables whenever they appear.
#------
#------
#The script can also farm Quests Achievements before each ascension,
#The script can also farm Quests Achievements before each ascension,
#if you set Settings.QuestsAchievementsFarming = True
#if you set Settings.QuestsAchievementsFarming = True
#Set it back to False to disable checking for Quests (it's disabled by default).
#Set it back to False to disable checking for Quests (it's disabled by default).
#If you set it to True it will check for available Mercenary Quests before each ascension,
#If you set it to True it will check for available Mercenary Quests before each ascension,
#and it will be choosing the shortest Quest available for each Mercenary.
#and it will be choosing the shortest Quest available for each Mercenary.
#It will result in the fast farming of Quests Achievements (5-minute quests and different types of quests).
#It will result in the fast farming of Quests Achievements (5-minute quests and different types of quests).
#It automatically collects rewards if necessary before starting new quests.
#It automatically collects rewards if necessary before starting new quests.
#The script doesn't revive/bury Mercenaries. Its purpose is only to farm Quests Achievements.
#The script doesn't revive/bury Mercenaries. Its purpose is only to farm Quests Achievements.
#------
#------
#Midas start always takes much less than 3 minutes (it varies) before instakilling will start after ascension.
#Midas start always takes much less than 3 minutes (it varies) before instakilling will start after ascension.
#But Midas start has a lot more HS gain efficiency during speed runs than waiting for a Settings.MainScreen.clickable,
#But Midas start has a lot more HS gain efficiency during speed runs than waiting for a Settings.MainScreen.clickable,
#because often while waiting for a Settings.MainScreen.clickable you will stop instakilling for 5, 10, 15 or even 20 minutes.
#because often while waiting for a Settings.MainScreen.clickable you will stop instakilling for 5, 10, 15 or even 20 minutes.
#
#
#To enable Midas start just set Settings.MidasStart to True and set Settings.WaitForClickableBeforeAscending to False
#To enable Midas start just set Settings.MidasStart to True and set Settings.WaitForClickableBeforeAscending to False
#You should have Pluto level to be 0.5 of your Siyalatas(or Argaiv) ancients for this to work for sure. It still might work anyways, though.
#You should have Pluto level to be 0.5 of your Siyalatas(or Argaiv) ancients for this to work for sure. It still might work anyways, though.
#There are also advanced settings you can adjust for Settings.FastMidasStart
#There are also advanced settings you can adjust for Settings.FastMidasStart
#
#
#To enable usage of active skills for 90 seconds before ascension for more efficiency
#To enable usage of active skills for 90 seconds before ascension for more efficiency
#(assuming you can instakill with all skills activated if used after you stop instakilling in your speed run),
#(assuming you can instakill with all skills activated if used after you stop instakilling in your speed run),
#set Settings.ActivateAllSkillsWithEnergizedLuckyStrikesBeforeAscension to True
#set Settings.ActivateAllSkillsWithEnergizedLuckyStrikesBeforeAscension to True
#
#
#(If you're using Mac, set Setting.MacComputerCompatibility = True Otherwise the script most probalby won't work properly.)
#(If you're using Mac, set Setting.MacComputerCompatibility = True Otherwise the script most probalby won't work properly.)
#------------------------
#------------------------
#Feel free to modify this script to suit your needs but if you redistribute it, please leave my name up here somewhere.
#Feel free to modify this script to suit your needs but if you redistribute it, please leave my name up here somewhere.
#------------------------
#------------------------
#These variables are meant to be edited by you to tweak the performance of the script.
#These variables are meant to be edited by you to tweak the performance of the script.
#True and False are CASE SENSITIVE
#True and False are CASE SENSITIVE
#---
#---
#"Quests Achievements Farming" settings
#"Quests Achievements Farming" settings
Settings.QuestsAchievementsFarming = False
Settings.QuestsAchievementsFarming = False
#Set it to True to enable the "Quests Achievements" farming, before each ascension.
#Set it to True to enable the "Quests Achievements" farming, before each ascension.
#This will result in checking Mercenaries right before ascending to send them on the shortest quests availabe.
#This will result in checking Mercenaries right before ascending to send them on the shortest quests availabe.
#(Better set it to False if you enable a "Deep Run Mode" (Beta) in settings below, or it might mess up things. I didn't test how it wworks in a deep run mode)
#(Better set it to False if you enable a "Deep Run Mode" (Beta) in settings below, or it might mess up things. I didn't test how it wworks in a deep run mode)
Settings.AdditionallyCheckForQuests = False #(This only works if you set Settings.QuestsAchievementsFarming = True)
Settings.AdditionallyCheckForQuests = False #(This only works if you set Settings.QuestsAchievementsFarming = True)
#Set it to True to additionally check Mercenaries periodically to send them on the shortest quests available.
#Set it to True to additionally check Mercenaries periodically to send them on the shortest quests available.
#(Remember, that if you collect "skill activation" quests rewards, you lose Idle mode for 1 minute during your run.)
#(Remember, that if you collect "skill activation" quests rewards, you lose Idle mode for 1 minute during your run.)
Settings.TimeToWaitBetweenCheckingForQuests = 8 # MINUTES between every check for Mercenaries Tab during a run.
Settings.TimeToWaitBetweenCheckingForQuests = 8 # MINUTES between every check for Mercenaries Tab during a run.
#The amount of minutes the script will wait between opening Mercenaries Tab to check for them.
#The amount of minutes the script will wait between opening Mercenaries Tab to check for them.
#The lowest possible value to set is 5 and the maximum possible value is 15.
#The lowest possible value to set is 5 and the maximum possible value is 15.
#---
#---
#Automatic Settings Control (Set these settings properly, first, before looking into other settings that you can Settings.MainScreen.find after these ones)
#Automatic Settings Control (Set these settings properly, first, before looking into other settings that you can Settings.MainScreen.find after these ones)
#---
#---
Settings.AutomaticEarlyGameMode = False #Set it True if you're in an early game (before having all gilds on Atlas or a later ranger).
Settings.AutomaticEarlyGameMode = False #Set it True if you're in an early game (before having all gilds on Atlas or a later ranger).
#Set it False if you're in a Mid/Late game (when you're gilded to Atlas or a later ranger, and you have Iris level equal to (your optimal ascending zone - 1000)).
#Set it False if you're in a Mid/Late game (when you're gilded to Atlas or a later ranger, and you have Iris level equal to (your optimal ascending zone - 1000)).
#(This setting (if set True) disables MidasStart settings completely, no matter what they were manually set to.)
#(This setting (if set True) disables MidasStart settings completely, no matter what they were manually set to.)
Settings.AutomaticGildedHeroesControl = True #Use it only in a Mid/Late game! Set it True if you have a main gilded hero (with all gilds).
Settings.AutomaticGildedHeroesControl = True #Use it only in a Mid/Late game! Set it True if you have a main gilded hero (with all gilds).
#If set True, it will work only if in the game you will put a gild on at least TWO heroes right above your main gilded hero!
#If set True, it will work only if in the game you will put a gild on at least TWO heroes right above your main gilded hero!
#(If after using a Settings.MainScreen.clickable after ascension no gilded hero becomes available to buy, make more single-gilded heroes leading to your main gilded hero!)
#(If after using a Settings.MainScreen.clickable after ascension no gilded hero becomes available to buy, make more single-gilded heroes leading to your main gilded hero!)
#Set it False if you don't have a main gilded hero, OR if you want to change settings related to gilded heroes yourself.
#Set it False if you don't have a main gilded hero, OR if you want to change settings related to gilded heroes yourself.
#(This setting automatically sets Settings.IHaveMoreThanTwoGildedHeroes = True and Settings.StartGildedSearchFromBottom = True no matter what they were manually set to.)
#(This setting automatically sets Settings.IHaveMoreThanTwoGildedHeroes = True and Settings.StartGildedSearchFromBottom = True no matter what they were manually set to.)
#---
#---
#Main settings
#Main settings
#---
#---
Settings.CheckForAscend = True #Set to False if you do not want the script to ascend for you.
Settings.CheckForAscend = True #Set to False if you do not want the script to ascend for you.
Settings.AscendNextLevelClicks = 12 #Set this lower if the script advances through levels too fast during ascension. Set it higher if it is too slow.
Settings.AscendNextLevelClicks = 12 #Set this lower if the script advances through levels too fast during ascension. Set it higher if it is too slow.
Settings.WaitForMoney = 0 #Set this higher if the script attempts to purchase things it can't afford during ascend
Settings.WaitForMoney = 0 #Set this higher if the script attempts to purchase things it can't afford during ascend
#!!!!Increase the value of the next variable if you ascend too fast or if you do not have Iris.
#!!!!Increase the value of the next variable if you ascend too fast or if you do not have Iris.
Settings.TimeToLookForMovementBeforeAscending = 2.5 #this is the number of seconds you must remain on a level before the script will decide you are leveling too slowly and you should ascend. Make it higher or lower if it ascends too early or too late.
Settings.TimeToLookForMovementBeforeAscending = 2.5 #this is the number of seconds you must remain on a level before the script will decide you are leveling too slowly and you should ascend. Make it higher or lower if it ascends too early or too late.
#2.5 is the lowest value SikuliX can handle. If you'd need it you can set it higher for your case, though.
#2.5 is the lowest value SikuliX can handle. If you'd need it you can set it higher for your case, though.
Settings.StartGildedSearchFromBottom = True #Change this to false if your preferred gilded hero is towards the top of the list.
Settings.StartGildedSearchFromBottom = True #Change this to false if your preferred gilded hero is towards the top of the list.
Settings.IHaveIris = True #Change this to False, if you don't have Iris
Settings.IHaveIris = True #Change this to False, if you don't have Iris
Settings.NoGildedHeroesAvailable = False #Set this to True if no gilded heroes are purchasable at the beginning of an ascension.
Settings.NoGildedHeroesAvailable = False #Set this to True if no gilded heroes are purchasable at the beginning of an ascension.
Settings.IHaveMoreThanTwoGildedHeroes = True #If this is true, we will periodically scroll to the bottom and look for a lower gilded hero.
Settings.IHaveMoreThanTwoGildedHeroes = True #If this is true, we will periodically scroll to the bottom and look for a lower gilded hero.
#These heroes must all be in a row for this to work!
#These heroes must all be in a row for this to work!
Settings.BuyAllHeroesFaster = True #Remove the mouse delay while going through and purchasing all heroes for their skills. Set to False if it tries to buy them faster than the money is coming in.
Settings.BuyAllHeroesFaster = True #Remove the mouse delay while going through and purchasing all heroes for their skills. Set to False if it tries to buy them faster than the money is coming in.
Settings.EDR = True #EDR after ascending?
Settings.EDR = True #EDR after ascending?
Settings.TurnProgressionBackOn = 10 #Number of minutes inbetween making sure progression mode is on. Good for deep runs. 0 for do not check.
Settings.TurnProgressionBackOn = 10 #Number of minutes inbetween making sure progression mode is on. Good for deep runs. 0 for do not check.
Settings.EDR_ER = False #EDR then ER then EDR then ER etc
Settings.EDR_ER = False #EDR then ER then EDR then ER etc
Settings.StopOnGoodRelic = False #Set this true to Settings.MainScreen.find +4 or +5% primal relics.
Settings.StopOnGoodRelic = False #Set this true to Settings.MainScreen.find +4 or +5% primal relics.
Settings.SomeHeroesGetSkipped = False #Turn this on only if some heroes get leveled 0 times.
Settings.SomeHeroesGetSkipped = False #Turn this on only if some heroes get leveled 0 times.
Settings.WaitForClickableBeforeAscending = False #Set this True if Iris is a high level and you want to wait for a Settings.MainScreen.clickable before ascending.
Settings.WaitForClickableBeforeAscending = False #Set this True if Iris is a high level and you want to wait for a Settings.MainScreen.clickable before ascending.
#If set False it will use Midas start (if you also set Settings.AutomaticEarlyGameMode = False).
#If set False it will use Midas start (if you also set Settings.AutomaticEarlyGameMode = False).
Settings.InterruptMidasStartIfClickableAppears = True #If set False, Midas start will happen even if a Settings.MainScreen.clickable appears
Settings.InterruptMidasStartIfClickableAppears = True #If set False, Midas start will happen even if a Settings.MainScreen.clickable appears
#If set True, it will interrupt Midas start if a Settings.MainScreen.clickable appears, even if Settings.WaitForClickableBeforeAscending = False
#If set True, it will interrupt Midas start if a Settings.MainScreen.clickable appears, even if Settings.WaitForClickableBeforeAscending = False
#Useful for overleveled Iris, when a Settings.MainScreen.clickable sometimes doesn't give enough gold to start instakilling after ascending.
#Useful for overleveled Iris, when a Settings.MainScreen.clickable sometimes doesn't give enough gold to start instakilling after ascending.
#---------
#---------
#Settings added by TheWhiteAvatar
#Settings added by TheWhiteAvatar
#---------
#---------
Settings.ActivateAllSkillsWithEnergizedLuckyStrikesBeforeAscension = False #For more efficiency go active for 90 secods before ascension
Settings.ActivateAllSkillsWithEnergizedLuckyStrikesBeforeAscension = False #For more efficiency go active for 90 secods before ascension
Settings.ActivatePowersurgeAndMetalDetectorInAdditionToEDR = True #After ascension with EDR combo (EDR would break Idle mode anyways)
Settings.ActivatePowersurgeAndMetalDetectorInAdditionToEDR = True #After ascension with EDR combo (EDR would break Idle mode anyways)
Settings.DumpAllHeroSoulsIntoSolomonAfterEachAscension = False # Set it True to dump all hero souls into Solomon after each ascension
Settings.DumpAllHeroSoulsIntoSolomonAfterEachAscension = False # Set it True to dump all hero souls into Solomon after each ascension
Settings.WaitBeforeDumpingSoulsIntoSolomon = True #If False, Solomon will be leveled up right after ascension. (Works only if the setting above set to True)
Settings.WaitBeforeDumpingSoulsIntoSolomon = True #If False, Solomon will be leveled up right after ascension. (Works only if the setting above set to True)
#If True, Solomon will get leveled up later, after getting all 200 hero levels. (Works only if the setting above set to True)
#If True, Solomon will get leveled up later, after getting all 200 hero levels. (Works only if the setting above set to True)
#---
#---
#Midas start
#Midas start
#---
#---
Settings.MidasStart = True #Uses Midas start after ascension. Set it False to disable MidasStart completely (good for early game stages).
Settings.MidasStart = True #Uses Midas start after ascension. Set it False to disable MidasStart completely (good for early game stages).
#Will work if set True (and if Settings.WaitForClickableBeforeAscending from above is set to False and if Settings.AutomaticEarlyGameMode is set False)
#Will work if set True (and if Settings.WaitForClickableBeforeAscending from above is set to False and if Settings.AutomaticEarlyGameMode is set False)
#If it would see a Settings.MainScreen.clickable during Midas Start usage, it would use a Settings.MainScreen.clickable instead.
#If it would see a Settings.MainScreen.clickable during Midas Start usage, it would use a Settings.MainScreen.clickable instead.
Settings.FastMidasStart = True #Instakillinlg after ascension will start faster. It has additional setting below. (Will work only if you set Settings.MidasStart = True)
Settings.FastMidasStart = True #Instakillinlg after ascension will start faster. It has additional setting below. (Will work only if you set Settings.MidasStart = True)
#It migth not work for some players. So, if it doesn't work that well, set it to False and see if it would be better working in your case.
#It migth not work for some players. So, if it doesn't work that well, set it to False and see if it would be better working in your case.
#Mostly, this option is for late game players. If needed, adjust four following settings below:
#Mostly, this option is for late game players. If needed, adjust four following settings below:
Settings.FastMidasStartZonesSkippingForClicking = 0 #The amount of zones skipping (2 zones at a time). It will happen before buying available heroes.
Settings.FastMidasStartZonesSkippingForClicking = 0 #The amount of zones skipping (2 zones at a time). It will happen before buying available heroes.
#If set to 0, nothing will happen. After zones skipping, several Settings.MainScreen.clicks on monsters will be done and a bit of wait to collect gold
#If set to 0, nothing will happen. After zones skipping, several Settings.MainScreen.clicks on monsters will be done and a bit of wait to collect gold
Settings.FastMidasStartMainZonesSkipping = 31 #The amount of zones skipping (2 zones at a time). No Settings.MainScreen.clicking on monsters will be done.
Settings.FastMidasStartMainZonesSkipping = 31 #The amount of zones skipping (2 zones at a time). No Settings.MainScreen.clicking on monsters will be done.
#If set to 0, no zones will be skipped. After zones skipping it will wait for gold for amount of seconds set by the setting below
#If set to 0, no zones will be skipped. After zones skipping it will wait for gold for amount of seconds set by the setting below
Settings.FastMidasStartSecondsToWaitForGold = 10 #The Amount of seconds to wait for gold, after skipping through zones
Settings.FastMidasStartSecondsToWaitForGold = 10 #The Amount of seconds to wait for gold, after skipping through zones
Settings.FastMidasStartWithClickstorm = True #If set True, it will activate Clickstorm, during a Fast Midas start
Settings.FastMidasStartWithClickstorm = True #If set True, it will activate Clickstorm, during a Fast Midas start
#---
#---
#Settings for Mac computer/laptop users!
#Settings for Mac computer/laptop users!
#---
#---
Settings.MacComputerCompatibility = False #Set it True, if you're using Mac computer/laptop, to make this script work properly
Settings.MacComputerCompatibility = False #Set it True, if you're using Mac computer/laptop, to make this script work properly
Settings.MacComputerDefaultMouseWheelScrollingDirection = True #Works only if Settings.MacComputerCompatibility set True
Settings.MacComputerDefaultMouseWheelScrollingDirection = True #Works only if Settings.MacComputerCompatibility set True
#By default True should work perfectly for Mac, but, if for some reason scrolling gets messed up, set it to False
#By default True should work perfectly for Mac, but, if for some reason scrolling gets messed up, set it to False
Settings.MacComputerQWERTZKeyboardLayout = False #Works only if Settings.MacComputerCompatibility set True
Settings.MacComputerQWERTZKeyboardLayout = False #Works only if Settings.MacComputerCompatibility set True
#False should work for a standard QWERTY keyboard layout. Set it True If you have a QWERTZ keyboard layout.
#False should work for a standard QWERTY keyboard layout. Set it True If you have a QWERTZ keyboard layout.
#-----------------------
#-----------------------
#Deep Run Mode (Beta) instead of ascending after a speed run. (For using in combination with a separate fast autoSettings.MainScreen.clicker.)
#Deep Run Mode (Beta) instead of ascending after a speed run. (For using in combination with a separate fast autoSettings.MainScreen.clicker.)
#This setting functionality wasn't tested properly yet. You may use it on your own risk!
#This setting functionality wasn't tested properly yet. You may use it on your own risk!
#If you'd want to add some fast autoSettings.MainScreen.clicking, you'll need to use any separate autoSettings.MainScreen.clicking program,
#If you'd want to add some fast autoSettings.MainScreen.clicking, you'll need to use any separate autoSettings.MainScreen.clicking program,
#but try not to set it to more than 30 Settings.MainScreen.clicks per second.
#but try not to set it to more than 30 Settings.MainScreen.clicks per second.
#This was tested without autocliking, just with automatic using skills from time to time, so it might not support fast autoSettings.MainScreen.clicking at all.
#This was tested without autocliking, just with automatic using skills from time to time, so it might not support fast autoSettings.MainScreen.clicking at all.
#It would stay in a deep run mode until you ascend manually (before it you should stop the script and change this setting back to False)
#It would stay in a deep run mode until you ascend manually (before it you should stop the script and change this setting back to False)
#You must have ALL your skills ready for usage before trying to go on a deep run with these settings.
#You must have ALL your skills ready for usage before trying to go on a deep run with these settings.
Settings.DeepRunInsteadOfAscension = False #Goes on a deep run with skills usage, if True and if Settings.CheckForAscend was set to True
Settings.DeepRunInsteadOfAscension = False #Goes on a deep run with skills usage, if True and if Settings.CheckForAscend was set to True
Settings.DeepRunWith_EDR_InsteadOfRandomSkillsUsage = True #If set True, it will use EDR (+ ER combo) every 30 minutes.
Settings.DeepRunWith_EDR_InsteadOfRandomSkillsUsage = True #If set True, it will use EDR (+ ER combo) every 30 minutes.
#After ER (Energize + Reload), during 15 minutes of waiting to use EDR combo again, it will use other skills in effective way.
#After ER (Energize + Reload), during 15 minutes of waiting to use EDR combo again, it will use other skills in effective way.
#After EDR (Energize + Dark Ritual + Reload) it will wait for 15 minutes without any skills usage.
#After EDR (Energize + Dark Ritual + Reload) it will wait for 15 minutes without any skills usage.
#(All cooldowns for skills should be lowered to their minimum by getting all needed ancients.)
#(All cooldowns for skills should be lowered to their minimum by getting all needed ancients.)
Settings.ForcedDeepRun = False #If set True, it will start a deep run (with EDR combo) the moment the game will be seen on the screen.
Settings.ForcedDeepRun = False #If set True, it will start a deep run (with EDR combo) the moment the game will be seen on the screen.
#------------------------
#------------------------
#------------------------
#------------------------
#------------------------
#------------------------
#These variables should be left alone. They are initialized here with their correct starting values and will change on their own.
#These variables should be left alone. They are initialized here with their correct starting values and will change on their own.
#---
#---
ClickablePic = Pattern("clickable.png").similar(0.90)
ClickablePic = Pattern("clickable.png").similar(0.90)
#---
#---
ScrollPic1 = Pattern("1432960811209.png").targetOffset(518,32)
ScrollPic1 = Pattern("1432960811209.png").targetOffset(518,32)
ScrollPic2 = Pattern("top-scroll.png").similar(0.85).targetOffset(-18,1)
ScrollPic2 = Pattern("top-scroll.png").similar(0.85).targetOffset(-18,1)
ScrollPic3 = Pattern("bottom-scroll.png").similar(0.85).targetOffset(-18,-1)
ScrollPic3 = Pattern("bottom-scroll.png").similar(0.85).targetOffset(-18,-1)
#---
#---
#Pictures for Mercenaries Quests
#Pictures for Mercenaries Quests
QuestCollectButtonPic = Pattern("quest_collect.png").similar(0.90) #Time - quest Collect
QuestCollectButtonPic = Pattern("quest_collect.png").similar(0.90) #Time - quest Collect
QuestStartButtonPic = Pattern("quest_start.png").similar(0.90) #Time - quest Start
QuestStartButtonPic = Pattern("quest_start.png").similar(0.90) #Time - quest Start
QuestAcceptButtonPic = Pattern("quest_accept.png").similar(0.90) #Time - quest Accept
QuestAcceptButtonPic = Pattern("quest_accept.png").similar(0.90) #Time - quest Accept
#---
#---
BuyButtonTopPic = Pattern("button-top.png").similar(0.85).targetOffset(-30,0)
BuyButtonTopPic = Pattern("button-top.png").similar(0.85).targetOffset(-30,0)
BuyButtonSidePic = Pattern("button-side.png").similar(0.85).targetOffset(-90,-30)
BuyButtonSidePic = Pattern("button-side.png").similar(0.85).targetOffset(-90,-30)
#---
#---
Settings.Times=0
Settings.Times=0
Settings.GildedHeroBelowFrostleafUpgradesPurchased = True#Don't change this.
Settings.GildedHeroBelowFrostleafUpgradesPurchased = True#Don't change this.
Settings.MoveMouseDelay = 0.5
Settings.MoveMouseDelay = 0.5
Settings.AscendStartTime = int(time.time())
Settings.AscendStartTime = int(time.time())
Settings.EDRTime = int(time.time()) - 500
Settings.EDRTime = int(time.time()) - 500
if Settings.TimeToWaitBetweenCheckingForQuests < 5:
if Settings.TimeToWaitBetweenCheckingForQuests < 5:
Settings.TimeToWaitBetweenCheckingForQuests = 5
Settings.TimeToWaitBetweenCheckingForQuests = 5
if Settings.TimeToWaitBetweenCheckingForQuests > 15:
if Settings.TimeToWaitBetweenCheckingForQuests > 15:
Settings.TimeToWaitBetweenCheckingForQuests = 15
Settings.TimeToWaitBetweenCheckingForQuests = 15
Settings.CheckForQuestStartButton = True
Settings.CheckForQuestStartButton = True
Settings.CheckForQuestsTime = int(time.time()) + (Settings.TimeToWaitBetweenCheckingForQuests * 60)
Settings.CheckForQuestsTime = int(time.time()) + (Settings.TimeToWaitBetweenCheckingForQuests * 60)
Settings.AscendRequirementsMet = False
Settings.AscendRequirementsMet = False
Settings.ProgressionLastVerified = int(time.time())
Settings.ProgressionLastVerified = int(time.time())
Settings.EDR_ER_State = "NONE"
Settings.EDR_ER_State = "NONE"
Settings.TimeWasted = 0
Settings.TimeWasted = 0
Settings.ScreensNumber = getNumberScreens() #For multi monitors systems
Settings.ScreensNumber = getNumberScreens()
Settings.ScreenOne = Screen(0)
Settings.Screens = []
if Settings.ScreensNumber > 1:
for i in range(Settings.ScreensNumber): #Populate the list of available screens
Settings.ScreenTwo = Screen(1)
Settings.Screens.append(Screen(i))
Settings.MainScreen = Settings.ScreenOne
Settings.MainScreen = FindScreen() #Find the screen Clicker Heroes is visible on
Settings.AdditionalBuyAllUpgradesLimit = 18
Settings.AdditionalBuyAllUpgradesLimit = 18
Settings.AdditionalBuyAllUpgrades = Settings.AdditionalBuyAllUpgradesLimit
Settings.AdditionalBuyAllUpgrades = Settings.AdditionalBuyAllUpgradesLimit
Settings.SmallResolutionController = 0
Settings.SmallResolutionController = 0
Settings.IfQuickMidasStartHappened = False
Settings.IfQuickMidasStartHappened = False
Settings.IfGoldenClicksWereUsed = False
Settings.IfGoldenClicksWereUsed = False
Settings.TryToSpeedUpMidasStart = True #Instakilling after ascension will start around 30 seconds faster than without this option
Settings.TryToSpeedUpMidasStart = True #Instakilling after ascension will start around 30 seconds faster than without this option
#It also will cause EDR combo to delay a bit more after ascension so it wouldn't slow you down at all when used because you'd be stronger already
#It also will cause EDR combo to delay a bit more after ascension so it wouldn't slow you down at all when used because you'd be stronger already
Settings.EDRDelayValueIfQuickMidasStartHappened = 10
Settings.EDRDelayValueIfQuickMidasStartHappened = 10
Settings.EDRDelayCounterIfQuickMidasStartHappened = 0
Settings.EDRDelayCounterIfQuickMidasStartHappened = 0
Settings.DeepRunStartPositionTemporary = Env.getMouseLocation()
Settings.DeepRunStartPositionTemporary = Env.getMouseLocation()
Settings.EnableProgressModeIfNotRightAfterAscending = True
Settings.EnableProgressModeIfNotRightAfterAscending = True
Settings.AlternativeFrostLeafSearch = False #It's slower.
Settings.AlternativeFrostLeafSearch = False #It's slower.
#Set it True only if the script for some reason can't identify when to stop buying 200 levels of each hero after ascension.
#Set it True only if the script for some reason can't identify when to stop buying 200 levels of each hero after ascension.
Settings.WheelUpConstant = WHEEL_UP
Settings.WheelUpConstant = WHEEL_UP
Settings.WheelDownConstant = WHEEL_DOWN
Settings.WheelDownConstant = WHEEL_DOWN
KEY_Z = 'z'
KEY_Z = 'z'
if Settings.AutomaticEarlyGameMode == True:
if Settings.AutomaticEarlyGameMode == True:
Settings.MidasStart = False
Settings.MidasStart = False
Settings.FastMidasStart = False
Settings.FastMidasStart = False
Settings.ActivateAllSkillsWithEnergizedLuckyStrikesBeforeAscension = False
Settings.ActivateAllSkillsWithEnergizedLuckyStrikesBeforeAscension = False
Settings.DumpAllHeroSoulsIntoSolomonAfterEachAscension = False
Settings.DumpAllHeroSoulsIntoSolomonAfterEachAscension = False
if Settings.AutomaticGildedHeroesControl == True:
if Settings.AutomaticGildedHeroesControl == True:
Settings.IHaveMoreThanTwoGildedHeroes = True
Settings.IHaveMoreThanTwoGildedHeroes = True
Settings.StartGildedSearchFromBottom = True
Settings.StartGildedSearchFromBottom = True
if Settings.WaitForClickableBeforeAscending == True:
if Settings.WaitForClickableBeforeAscending == True:
Settings.MidasStart = False
Settings.MidasStart = False
if Settings.ForcedDeepRun == True:
if Settings.ForcedDeepRun == True:
Settings.DeepRunInsteadOfAscension = True
Settings.DeepRunInsteadOfAscension = True
if Settings.DeepRunInsteadOfAscension == True:
if Settings.DeepRunInsteadOfAscension == True:
Settings.TurnProgressionBackOn = 10
Settings.TurnProgressionBackOn = 10
if Settings.MacComputerCompatibility == True: #Reverse scrolling directions for mouse wheel function, since on Mac it works the opposite way by default
if Settings.MacComputerCompatibility == True: #Reverse scrolling directions for mouse wheel function, since on Mac it works the opposite way by default
if Settings.MacComputerDefaultMouseWheelScrollingDirection == True:
if Settings.MacComputerDefaultMouseWheelScrollingDirection == True:
Settings.WheelUpConstant = WHEEL_DOWN
Settings.WheelUpConstant = WHEEL_DOWN
Settings.WheelDownConstant = WHEEL_UP
Settings.WheelDownConstant = WHEEL_UP
if Settings.MacComputerQWERTZKeyboardLayout == True:
if Settings.MacComputerQWERTZKeyboardLayout == True:
KEY_Z = 'y'
KEY_Z = 'y'
if Settings.MidasStart == False:
if Settings.MidasStart == False:
Settings.FastMidasStart = False
Settings.FastMidasStart = False
if Settings.MidasStart == True:
if Settings.MidasStart == True:
Settings.BuyAllHeroesFaster = True
Settings.BuyAllHeroesFaster = True
from guide import *#If you get an error on this line, you are using an old version of Sikuli! Update to 1.1.0+
from guide import *#If you get an error on this line, you are using an old version of Sikuli! Update to 1.1.0+
import java.awt.Robot as JRobot#JRobot is used for identifying the color of a pixel.
import java.awt.Robot as JRobot#JRobot is used for identifying the color of a pixel.
myRobot = JRobot()
myRobot = JRobot()
def FindAndClick(Picture, ModifierVar = 0, CheckStart = True): #Function to Settings.MainScreen.find an image and Settings.MainScreen.click it. ModifierVar is for Ctrl+Clicking and such. CheckStart tests if the mouse moved.
def FindAndClick(Picture, ModifierVar = 0, CheckStart = True): #Function to Settings.MainScreen.find an image and Settings.MainScreen.click it. ModifierVar is for Ctrl+Clicking and such. CheckStart tests if the mouse moved.
if Settings.MainScreen.exists(Picture,0) and (StartPosition == Env.getMouseLocation() or CheckStart == False):
if Settings.MainScreen.exists(Picture,0) and (StartPosition == Env.getMouseLocation() or CheckStart == False):
Settings.MainScreen.click(Settings.MainScreen.getLastMatch(), ModifierVar)
Settings.MainScreen.click(Settings.MainScreen.getLastMatch(), ModifierVar)
if Settings.DeepRunInsteadOfAscension == False:
if Settings.DeepRunInsteadOfAscension == False:
Settings.MainScreen.hover(Location(StartPosition))
Settings.MainScreen.hover(Location(StartPosition))
else:
else:
Settings.MainScreen.hover(Location(Settings.DeepRunStartPositionTemporary))
Settings.MainScreen.hover(Location(Settings.DeepRunStartPositionTemporary))
return True
return True
else:
else:
return False
return False
def clickBuy100Levels(ClickLocation):
def clickBuy100Levels(ClickLocation):
if Settings.MacComputerCompatibility == False:
if Settings.MacComputerCompatibility == False:
Settings.MainScreen.click(ClickLocation,KEY_CTRL)
Settings.MainScreen.click(ClickLocation,KEY_CTRL)
else:
else:
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.keyDown(KEY_Z)
Settings.MainScreen.keyDown(KEY_Z)
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.keyUp(KEY_Z)
Settings.MainScreen.keyUp(KEY_Z)
def goClick(ClickLocation, ModifierVar = 0, CheckStart = True):#checks if the mouse has moved, if it has not, Settings.MainScreen.clicks the location specified
def goClick(ClickLocation, ModifierVar = 0, CheckStart = True):#checks if the mouse has moved, if it has not, Settings.MainScreen.clicks the location specified
if StartPosition == Env.getMouseLocation() or CheckStart == False:
if StartPosition == Env.getMouseLocation() or CheckStart == False:
#Region(ClickLocation.getX()-2,ClickLocation.getY()-2,4,4).highlight(5)
#Region(ClickLocation.getX()-2,ClickLocation.getY()-2,4,4).highlight(5)
if Settings.MacComputerCompatibility == False:
if Settings.MacComputerCompatibility == False:
Settings.MainScreen.click(ClickLocation, ModifierVar)
Settings.MainScreen.click(ClickLocation, ModifierVar)
Settings.MainScreen.hover(Location(StartPosition))
Settings.MainScreen.hover(Location(StartPosition))
else:
else:
if ModifierVar == KEY_CTRL or ModifierVar == KeyModifier.CTRL:
if ModifierVar == KEY_CTRL or ModifierVar == KeyModifier.CTRL:
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.keyDown(KEY_Z)
Settings.MainScreen.keyDown(KEY_Z)
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.click(ClickLocation)
Settings.MainScreen.keyUp(KEY_Z)
Settings.MainScreen.keyUp(KEY_Z)
Settings.MainScreen.hover(Location(StartPosition))
Settings.MainScreen.hover(Location(StartPosition))
return True
return True
else:
else:
return False
return False
def FindAndClickAll(Picture):#This function Settings.MainScreen.clicks every occurance of an image on the screen.
def FindAndClickAll(Picture):#This function Settings.MainScreen.clicks every occurance of an image on the screen.
try:
try:
FA = Settings.MainScreen.findAll(Picture)
FA = Settings.MainScreen.findAll(Picture)
for i in FA:
for i in FA:
Settings.MainScreen.click( i)
Settings.MainScreen.click( i)
Settings.MainScreen.hover(Location(StartPosition))
Settings.MainScreen.hover(Location(StartPosition))
FA.destroy()
FA.destroy()
return True
return True
except:
except:
return False
return False
def TryToFind(Picture): #This function just checks to see if an image is on screen at all. Added this so I could modify the delay globally without needing to Settings.MainScreen.find and replace all.
def TryToFind(Picture): #This function just checks to see if an image is on screen at all. Added this so I could modify the delay globally without needing to Settings.MainScreen.find and replace all.
if Settings.MainScreen.exists(Picture,0):
if Settings.MainScreen.exists(Picture,0):
return True
return True
else:
else:
return False
return False
#Some Pictures with offsets that might be useful later
#Some Pictures with offsets that might be useful later
#FindAndClick(Pattern("1432960811209.png").targetOffset(505,87),0,False) #Scroll up a bit
#FindAndClick(Pattern("1432960811209.png").targetOffset(505,87),0,False) #Scroll up a bit
#FindAndClick(Pattern("1432960811209.png").targetOffset(505,520),0,False) #Scroll down a bit
#FindAndClick(Pattern("1432960811209.png").targetOffset(505,520),0,False) #Scroll down a bit
#FindAndClick(Pattern("1432960811209.png").targetOffset(505,102),0,False) #Scroll up to the top
#FindAndClick(Pattern("1432960811209.png").targetOffset(505,102),0,False) #Scroll up to the top
#FindAndClick(Pattern("1432960811209.png").targetOffset(505,503),0,False) #Scroll down to the bottom
#FindAndClick(Pattern("1432960811209.png").targetOffset(505,503),0,False) #Scroll down to the bottom
#FindAndClick(Pattern("scroll-bar-top.png").similar(0.95).targetOffset(1,-27),0,False) #Scroll up (similar to wheel usage for 4 times)
#FindAndClick(Pattern("scroll-bar-top.png").similar(0.95).targetOffset(1,-27),0,False) #Scroll up (similar to wheel usage for 4 times)
#FindAndClick(Pattern("scroll-bar.png").similar(0.95).targetOffset(1,24),0,False) #Scroll down (similar to wheel usage for 4 times)
#FindAndClick(Pattern("scroll-bar.png").similar(0.95).targetOffset(1,24),0,False) #Scroll down (similar to wheel usage for 4 times)
#if Settings.MainScreen.exists(Pattern("mac-0-dps.png").similar(0.92)): #Special picture taken from Mac computer
#if Settings.MainScreen.exists(Pattern("mac-0-dps.png").similar(0.92)): #Special picture taken from Mac computer
def CollectCoins():
def CollectCoins():
StoreSpeed = Settings.MoveMouseDelay
StoreSpeed = Settings.MoveMouseDelay
Settings.MoveMouseDelay = .5
Settings.MoveMouseDelay = .5
ShowTheGameBottomForSmallScreenResolutions()
ShowTheGameBottomForSmallScreenResolutions()
if Settings.MainScreen.exists(Pattern("1434493975401.png").targetOffset(-315,-187),0):
if Settings.MainScreen.exists(Pattern("1434493975401.png").targetOffset(-315,-187),0):
Settings.MainScreen.hover(Settings.MainScreen.getLastMatch())
Settings.MainScreen.hover(Settings.MainScreen.getLastMatch())
wait(.1)
wait(.1)
Settings.MainScreen.hover(Pattern("1434493975401.png").targetOffset(329,-180))
Settings.MainScreen.hover(Pattern("1434493975401.png").targetOffset(329,-180))
Settings.MainScreen.hover(Location(StartPosition))
Settings.MainScreen.hover(Location(StartPosition))
wait(.5)
wait(.5)
Settings.MoveMouseDelay = StoreSpeed
Settings.MoveMouseDelay = StoreSpeed
ShowTheGameTopForSmallScreenResolutions()
ShowTheGameTopForSmallScreenResolutions()
def ShowTheGameTopForSmallScreenResolutions():
def ShowTheGameTopForSmallScreenResolutions():
if Settings.SmallResolutionController == 2:
if Settings.SmallResolutionController == 2:
if not Settings.MainScreen.exists(Pattern("1432967930862.png").similar(0.85),0):
if not Settings.MainScreen.exists(Pattern("1432967930862.png").similar(0.85),0):
spd = Settings.MoveMouseDelay
spd = Settings.MoveMouseDelay
if Settings.MainScreen.exists(Pattern("shop-button.png").similar(0.90).targetOffset(-880,-60),0):
if Settings.MainScreen.exists(Pattern("shop-button.png").similar(0.90).targetOffset(-880,-60),0):
Settings.MoveMouseDelay = 0
Settings.MoveMouseDelay = 0
FindAndClick(Pattern("shop-button.png").similar(0.90).targetOffset(-880,-60))
FindAndClick(Pattern("shop-button.png").similar(0.90).targetOffset(-880,-60))
else:
else:
ShowTheGameBottomForSmallScreenResolutions()
ShowTheGameBottomForSmallScreenResolutions()
Settings.MoveMouseDelay = 0
Settings.MoveMouseDelay = 0
FindAndClick(Pattern("shop-button.png").similar(0.90).targetOffset(-880,-60))
FindAndClick(Pattern("shop-button.png").similar(0.90).targetOffset(-880,-60))
Settings.MoveMouseDelay = spd
Settings.MoveMouseDelay = spd
i=0
i=0
while i < 2:
while i < 2:
i = i + 1
i = i + 1
if Settings.MainScreen.exists(Pattern("1432967930862.png").similar(0.85),0):
if Settings.MainScreen.exists(Pattern("1432967930862.png").similar(0.85),0):
i = 2
i = 2
else:
else:
if Settings.MainScreen.exists(Pattern("shop-button.png").similar(0.90).targetOffset(-880,-60),0):
if Settings.MainScreen.exists(Pattern("shop-button.png").similar(0.90).targetOffset(-880,-60),0):
Settings.MainScreen.wheel(Settings.MainScreen.getLastMatch().getTarget(),Settings.WheelUpConstant,1)
Settings.MainScreen.wheel(Settings.MainScreen.getLastMatch().getTarget(),Settings.WheelUpConstant,1)
if Settings.MainScreen.exists(Pattern("scroll-bar.png").similar(0.95),0):
if Settings.MainScreen.exists(Pattern("scroll-bar.png").similar(0.95),0):
FindAndClick(Pattern("scroll-bar.png").similar(0.95).targetOffset(1,24))
FindAndClick(Pattern("scroll-bar.png").similar(0.95).targetOffset(1,24))
else:
else:
if Settings.MainScreen.exists(Pattern("1432960811209.png").targetOffset(-46,0),0):
if Settings.MainScreen.exists(Pattern("1432960811209.png").targetOffset(-46,0),0):
Settings.MainScreen.wheel(Settings.MainScreen.getLastMatch().getTarget(),Settings.WheelUpConstant,1)
Settings.MainScreen.wheel(Settings.MainScreen.getLastMatch().getTarget(),Settings.WheelUpConstant,1)
if Settings.MainScreen.exists(Pattern("scroll-bar.png").similar(0.95),0):
if Settings.MainScreen.exists(Pattern("scroll-bar.png").similar(0.95),0):
FindAndClick(Pattern("scroll-bar.png").similar(0.95).targetOffset(1,24))
FindAndClick(Pattern("scroll-bar.png").similar(0.95).targetOffset(1,24))
def ShowTheGameBottomForSmallScreenResolutions():
def ShowTheGameBottomForSmallScreenResolutions():
if Settings.SmallResolutionController == 2:
if Settings.SmallResolutionController == 2:
if not Settings.MainScreen.exists(Pattern("shop-button.png").similar(0.90).targetOffset(-880,0),0):
if not Settings.MainScreen.exists(Pattern("shop-button.png").similar(0.90).targetOffset(-880,0),0):
if Settings.MainScreen.exists(Pattern("1432960811209.png").targetOffset(-46,0),0):
if Settings.MainScreen.exists(Pattern("1432960811209.png").targetOffset(-46,0),0):
FindAndClick(Pattern("1432960811209.png").targetOffset(-46,0))
FindAndClick(Pattern("1432960811209.png").targetOffset(-46,0))
i=0
i=0
while i < 2:
while i < 2:
i = i + 1
i = i + 1
if Settings.MainScreen.exists(Pattern("shop-button.png").similar(0.90).targetOffset(-880,0),0):
if Settings.MainScreen.exists(Pattern("shop-button.png").similar(0.90).targetOffset(-880,0),0):
i = 2
i = 2
else:
else:
if Settings.MainScreen.exists(Pattern("1432960811209.png").targetOffset(-46,0),0):
if Settings.MainScreen.exists(Pattern("1432960811209.png").targetOffset(-46,0),0):
Settings.MainScreen.wheel(Settings.MainScreen.getLastMatch().getTarget(),Settings.WheelDownConstant,1)
Settings.MainScreen.wheel(Settings.MainScreen.getLastMatch().getTarget(),Settings.WheelDownConstant,1)
def ScrollUp(ScrollSpeed, GoToTheTop = False):
def ScrollUp(ScrollSpeed, GoToTheTop = False):
Scroll(Settings.WheelUpConstant, ScrollSpeed, GoToTheTop)
Scroll(Settings.WheelUpConstant, ScrollSpeed, GoToTheTop)
def ScrollDown(ScrollSpeed, GoToTheTop = False):
def ScrollDown(ScrollSpeed, GoToTheTop = False):
Scroll(Settings.WheelDownConstant, ScrollSpeed, GoToTheTop)
Scroll(Settings.WheelDownConstant, ScrollSpeed, GoToTheTop)
def ScrollOLD(ScrollDirection, ScrollSpeed, GoToTheTop = False):
def ScrollOLD(ScrollDirection, ScrollSpeed, GoToTheTop = False):
if GoToTheTop == True:
if GoToTheTop == True:
ShowTheGameTopForSmallScreenResolutions()
ShowTheGameTopForSmallScreenR
if Settings.MainScreen.exists(Pattern(