forked from ensingm2/SteamMonsterGameScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathminified_30cps.js
1 lines (1 loc) · 4.66 KB
/
minified_30cps.js
1
function startAutoClicker(){return autoClicker?void console.log("Autoclicker is already running!"):(autoClicker=setInterval(function(){var e=Math.floor(Math.random()*autoClickerVariance*2)-autoClickerVariance,t=clicksPerSecond+e;g_Minigame.m_CurrentScene.m_nClicks=t,debug&&console.log("Clicking "+t+" times this second.")},autoClickerFreq),void console.log("autoClicker has been started."))}function startAutoRespawner(){return autoRespawner?void console.log("autoRespawner is already running!"):(autoRespawner=setInterval(function(){debug&&console.log("Checking if the player is dead."),g_Minigame.m_CurrentScene.m_bIsDead&&(debug&&console.log("Player is dead. Respawning."),RespawnPlayer())},respawnCheckFreq),void console.log("autoRespawner has been started."))}function startAutoTargetSwapper(){return autoTargetSwapper?void console.log("autoTargetSwapper is already running!"):(autoTargetSwapper=setInterval(function(){var e=!1,t=!1,a=-1,o=-1,n=null;g_Minigame.m_CurrentScene.m_rgEnemies.each(function(r){e||(2==r.m_data.type?(e=!0,n=r):a>0&&0==r.m_data.type&&r.m_data.hp<a?(a=r.m_data.hp,n=r):0>a&&0==r.m_data.type?(a=r.m_data.hp,t=!0,n=r):o>0&&!t&&r.m_data.hp<o?(o=r.m_data.hp,n=r):0>o&&!t&&(o=r.m_data.hp,n=r))}),n&&(g_Minigame.m_CurrentScene.m_rgPlayerData.current_lane!=n.m_nLane&&g_Minigame.CurrentScene().TryChangeLane(n.m_nLane),g_Minigame.CurrentScene().TryChangeTarget(n.m_nID))},targetSwapperFreq),void console.log("autoTargetSwapper has been started."))}function startAutoAbilityUser(){return autoAbilityUser?void console.log("autoAbilityUser is already running!"):(autoAbilityUser=setInterval(function(){debug&&console.log("Checking if it's useful to use an ability.");var e,t=g_Minigame.CurrentScene().m_rgPlayerData.hp/g_Minigame.CurrentScene().m_rgPlayerTechTree.max_hp*100,a=g_Minigame.m_CurrentScene.m_rgEnemies[g_Minigame.m_CurrentScene.m_rgPlayerData.target];a&&(e=a.m_data.hp/a.m_data.max_hp*100),hasAbility(5),hasAbility(6),useMedicsAtPercent>=t&&!g_Minigame.m_CurrentScene.m_bIsDead&&(debug&&console.log("Health below threshold. Need medics!"),hasAbility(7)?(debug&&console.log("Unleash the medics!"),castAbility(7)):debug&&console.log("No medics to unleash!")),hasAbility(8),hasAbility(9)&&(debug&&console.log("Decreasing cooldowns."),castAbility(9)),a&&0==a.m_data.type&&e>=useNukeOnSpawnerAbovePercent&&hasAbility(10)&&(debug&&console.log("Nuclear launch detected."),castAbility(10)),hasAbility(11),hasAbility(12)},abilityUseCheckFreq),void console.log("autoAbilityUser has been started."))}function startAutoItemUser(){return autoItemUser?void console.log("autoItemUser is already running!"):(autoItemUser=setInterval(function(){debug&&console.log("Checking if it's useful to use an item.")},itemUseCheckFreq),void console.log("autoItemUser has been started."))}function startAllAutos(){startAutoClicker(),startAutoRespawner(),startAutoTargetSwapper(),startAutoAbilityUser(),startAutoItemUser()}function stopAutoClicker(){autoClicker?(clearInterval(autoClicker),autoClicker=null,console.log("autoClicker has been stopped.")):console.log("No autoClicker is running to stop.")}function stopAutoRespawner(){autoRespawner?(clearInterval(autoRespawner),autoRespawner=null,console.log("autoRespawner has been stopped.")):console.log("No autoRespawner is running to stop.")}function stopAutoTargetSwapper(){autoTargetSwapper?(clearInterval(autoTargetSwapper),autoTargetSwapper=null,console.log("autoTargetSwapper has been stopped.")):console.log("No autoTargetSwapper is running to stop.")}function stopAutoAbilityUser(){autoAbilityUser?(clearInterval(autoAbilityUser),autoAbilityUser=null,console.log("autoAbilityUser has been stopped.")):console.log("No autoAbilityUser is running to stop.")}function stopAutoItemUser(){autoItemUser?(clearInterval(autoItemUser),autoItemUser=null,console.log("autoItemUser has been stopped.")):console.log("No autoItemUser is running to stop.")}function stopAllAutos(){stopAutoClicker(),stopAutoRespawner(),stopAutoTargetSwapper(),stopAutoAbilityUser(),stopAutoItemUser()}function disableAutoNukes(){useNukeOnSpawnerAbovePercent=200,console.log("Automatic nukes have been disabled")}function castAbility(e){hasAbility(e)&&g_Minigame.CurrentScene().TryAbility(document.getElementById("ability_"+e).childElements()[0])}function hasAbility(e){return 1<<e&g_Minigame.CurrentScene().m_rgPlayerTechTree.unlocked_abilities_bitfield&&g_Minigame.CurrentScene().GetCooldownForAbility(e)<=0}var debug=!1,clicksPerSecond=30,autoClickerVariance=Math.floor(clicksPerSecond/10),respawnCheckFreq=5e3,targetSwapperFreq=1e3,abilityUseCheckFreq=2e3,itemUseCheckFreq=5e3,useMedicsAtPercent=30,useNukeOnSpawnerAbovePercent=75,autoClickerFreq=1e3,autoRespawner,autoClicker,autoTargetSwapper,autoAbilityUser,autoItemUser;startAllAutos();