Tap Heroes

Tap Heroes

评价数不足
[Script] Gem Grinding + Autoclick Script
由 aquatorrent 制作
AutoHotKey script to grind gems and autoclick the game.
   
奖励
收藏
已收藏
取消收藏
Introduction
I know there is already another script guide here but I find that this one is faster since you can reset the game by pressing F2. I also can't seem to get that script to work because the pixel detection is always off in the game. I ended up making a guide for those who also have the same problem as me. This script might not work if you have low health and leave the game for a long time though, so pump those extra stats on health.

This script requires you to install AutoHotkey[autohotkey.com].

Based on the AutoHotkey website,
AutoHotkey is a free, open-source scripting language for Windows that allows users to easily create small to complex scripts for all kinds of tasks such as: form fillers, auto-clicking, macros, etc.

This script might or might not require some configuration on your end so you have to install AutoHotkey to use this script.

Lastly, use it at your own risk.
Prerequisities
You might need to check your own coordinates and replace the one in the script based on your screen. Install this script by copying and paste-ing this code in a notepad and save it with an .ahk extension (ex: getcoordinates.ahk). Make sure that it has .ahk extension instead of .txt. You can change the setting in Windows here[support.microsoft.com].

CoordMode, Mouse, Window SetTimer, Check, 20 return Check: MouseGetPos, xx, yy PixelGetColor, color, %xx%, %yy% Tooltip %color% %xx% %yy% return ~^c:: Clipboard = %color% %xx% %yy% ClipWait return Esc::ExitApp

This code will basically retrieve your cursor's screen coordinates and pixel color based on your active window and show it in your cursor's tooltip. You can copy the information to your clipboard by pressing CTRL+C to paste it somewhere else (in a notepad, for example) by pressing CTRL+V. Lastly, the app will close if you press Escape button or you can right click the 'H' icon in your right taskbar tray and click Close. The second option works for all AHK script so you can also use it to close the actual script below.
The Script
#MaxThreadsPerHotkey 3 Pause Loop{ Sleep 3000 ; welcome screen Click down, 318, 283 Sleep 5 Click up {ClickUp} Sleep 1500 ; offline reward notification Click down, 318, 283 Sleep 5 Click up {ClickUp} Sleep 1500 ; next button Click down, 536, 233 Sleep 10 Click up {ClickUp} Sleep 1500 ; previous button Click down, 102, 225 Sleep 10 Click up {ClickUp} Sleep 1500 ; restart the game Send, {F2} } F8::Pause F9:: Toggle := !Toggle Loop { If (!Toggle) Break Click Sleep 43 ; Make this number higher for slower clicks, lower for faster. } Return Esc::ExitApp

In summary, the script will spam left click on the position of your mouse when you press F9 (auto clicker script).

The F8 script (gem grinding) is more complicated though. The script will send left click on the screen for the splash screen once, click "Good!" on the confirmation button for the offline progression notification, press next button, press previous button, and press F2 to restart the game. If you get it already, you must leave the script open on the splash screen and make sure that you're on area level 299 (or 199 or 99) to make sure that this script is working.

I'll explain the code bit by bit as you configure the coordinates yourself. Run the script in the prerequisites section, make sure that the Tap Heroes game is the active window (just click anywhere on the game just to make sure), and replace the coordinates and/or the color hex that I will mention below.

Note that I took the picture after I finished with the script so the coordinate might be different. I also take the picture from other level since I'm farming the last achievement when I took the screenshots. Note that you don't need to follow my coordinate; anywhere is fine as long as your cursor is pointing to what I'm talking about.

Sleep 3000 ; welcome screen Click down, 318, 283 Sleep 5 Click up {ClickUp} Sleep 1500 ; offline reward notification Click down, 318, 283 Sleep 5 Click up {ClickUp} Sleep 1500

This will wait for 3s (that splash screen animation) before it clicks on the screen twice. You can click the first one anywhere you want, but I prefer to click on the same location as the confirmation button (318,283) for the offline progression to make it easier. Move your cursor to the "Good!" button and replace 318, 283 with the coordinate of your "Good!" button.




; next button Click down, 536, 233 Sleep 10 Click up {ClickUp} Sleep 1500

This will click the next button. Move your cursor to the next button and replace 536, 233 with the coordinate of your next button.




; previous button Click down, 102, 225 Sleep 10 Click up {ClickUp} Sleep 1500

This will click the previous button. Move your cursor to the previous button and replace 536, 233 with the coordinate of your previous button.




; restart the game Send, {F2}

This will restart the game by pressing F2. You can try it out first in case it's not working or something.

Toggle := !Toggle Loop { If (!Toggle) Break Click Sleep 43 ; Make this number higher for slower clicks, lower for faster. }

Lastly, the F9 (autoclicker) script. This basically will send click every 43 ms when it's activated. You can toggle its activation by pressing F9 and if you notice it already, you need to move your cursor to the location where you need to spam your clicks.

Feel free to change the 43 number to anything you like. You can change the number higher for slower clicks and lower for faster clicks. I just find that 43ms is the right setup for me.
Utilizing the Script
Press F8 or F9 (depends on which script you want to use) to start and/or pause the script and press Escape to exit the script. You can also close the script by doing right click on the 'H' icon in your taskbar tray and choose exit.

Note that the F8 script (gem grinding) will only work if you start it on the splash screen so make sure that you're already on area level 299, 199, or 99 beforehand. It's also recommended to use this script when your max area level is 300 to avoid the script going haywire. You might need to supervise the script once in a while, especially if you have low health. Feel free to leave the script unattended if you have very high health though.

As for the F9 script (auto clicker), make sure to move your mouse cursor to the area where you need your clicks to be spammed before you run it.

If you think that the script is clicking too fast or too slow, you can try changing the Sleep 5, Sleep 10, Sleep 1500, and/or Sleep 3000 to a higher or lower amount. I recommend to increase it by 500 and see if it's still clicking too fast or too slow for you.
Modifying Your Save Files
In case you don't want to go through all those trouble and don't mind to cheat a bit, you can modify your save file to get the achievement. The save file in windows is located in:
C:\Users\<your username>\AppData\Roaming\MMFApplications

Open x1nntp.ini with notepad or any text editor and you'll see something like this:
[Stats] OfflineStart=1 TimeStamp=1594899857 EnemiesKilled=1001512 CoinsCollected=72728795 Taps=217221 DamageRec=11284535 Criticals=2726911 DamageDealt=1047395776 HealingRec=-1921881600 LvledUp=5161 TreasuresFound=282 UniqueBosses=38 BossesDefeated=182 GemsCollected=2769 UniqueDragons=3 PowersUsed=219 [General] Gems=3 NewLevel=1 World=1 PlayedBefore=1 Gold=391298 MaxArea=372 CurrentArea=1 TapTutorial=1 LowestDefeatedBoss=370 Heroes=2 Altar=1 MusicVol=0 ChangedMusicVol=1 SFXVol=0 ChangedSfxVol=1 [GodStats] Attack=249 AttackP=99999 Critical=80 CriticalP=11048 Heal=239 HealP=99999 [WarriorStats] Attack=2770 AttackP=99999 Speed=100 SpeedP=17389 Health=613 HealthP=99999 Critical=80 CriticalP=11048 [MageStats] Power=238 PowerP=99999 Speed=130 SpeedP=29602 Will=80 WillP=11048 [RogueStats] StunPower=100 StunPowerP=17389 Speed=145 SpeedP=36927 PoisonDamage=238 PoisonDamageP=99999 Potency=112 PotencyP=21884 [Options] Numbers=1 Shake=1 Finger=1 [Other] ShareLevel=10019 Share=1 [New] LB=1 LS=1 LG=1 LP=1 LE=1 [ExtraItems] Banker=3 Familiar=3 Warrior=2 Rogue=2 Mage=2 Inn=1 Potions=7 [Powers] GoldRush=1 GoldRushT=29 GoldRushR=1 HandOfGod=1 HandOfGodT=14 HandOfGodR=1 GreatTide=1 GreatTideT=24 GreatTideR=1 BattleCry=1 BattleCryT=14 BattleCryR=1 HealingLight=1 HealingLightT=14 HealingLightR=1 ArrowToTheKnee=1 ArrowToTheKneeT=14 ArrowToTheKneeR=1

Yep, that's my save file. In case you're wondering, the tap achievement isn't maxed in that save file since I forgot to backup that save before deleting it.

Anyways, just modify the number as you wish and restart the game.
Afterwords
Sorry if this feels rushed. I decided to make this guide all of a sudden at 3AM after I wake up so I'm half awake right now. Anyway, I hope this will help you somehow. Feel free to let me know if you know how to improve the script or want to ask questions about it. Now it's time for me to go back to sleep.
2 条留言
aquatorrent  [作者] 2021 年 10 月 27 日 下午 9:22 
@Revenant: i didnt think autohotkey is that heavy, hahah. It's nice to see that there is an alternative with other programs though. Thanks for sharing yours! :)
𝕽𝖊𝖛𝖊𝖓𝖆𝖓𝖙 2021 年 10 月 27 日 下午 6:02 
I find AutoHotkey too heavy. I use Macro Recorder with your idea. There I can record a rough program and perfect it. I already have my coordinates for the click point. 16 lines to the goal.
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2638691028