Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Clicker Heroes - Reskill Script



  • Please log in to reply
4 replies to this topic
Yusunoha
  • Members
  • 7 posts
  • Last active: Oct 16 2015 07:04 PM
  • Joined: 31 Mar 2014

I've been playing some clicker heroes for a while now, but right now I'm away from my computer for about a week so I'm playing on my laptop. on my computer I had some simple macro programs build into the keyboard, but there's no such thing on my laptop, so I've been using autohotkey for that.

 

right now I've a very simple script for 4 keybindings that activates the skills in a certain order, but since I'm using autohotkey anyways I'd like to automate this process aswell so the script will automatically loop these skill combinations for me.

 

the script right now is

!Ins::
Sleep, 500
Send 8
Sleep, 100
Send 5
Sleep, 100
Send 4
Sleep, 100
Send 1
Sleep, 100
Send 2
Sleep, 100
Send 3
Sleep, 100
Send 7
return

!Del::
Sleep, 500
Send 8
Sleep, 100
Send 3
Sleep, 100
Send 7
Sleep, 100
Send 1
Sleep, 100
Send 2
Sleep, 100
Send 4
return

!PgUp::
Sleep, 500
Send 8
Sleep, 100
Send 6
Sleep, 100
Send 9
Sleep, 100
Send 1
Sleep, 100
Send 2
Sleep, 100
Send 3
Sleep, 100
Send 4
Sleep, 100
Send 5
Sleep, 100
Send 7
return

!PgDn::
Sleep, 500
Send 8
Sleep, 100
Send 6
Sleep, 100
Send 9
Sleep, 100
Send 1
Sleep, 100
Send 2
Sleep, 100
Send 3
Sleep, 100
Send 4
Sleep, 100
Send 7
return

as you can see, I'm no coding genius, so I've no idea really on how to improve the script.

what I'd like is the script to stay like this, so I can still do this manually aswell, but when I press the hotkey combination ctrl+insert I want the script to do...

 

skill 869123457, wait 2 minutes and 30 seconds, skill 12, wait 2 minutes and 30 seconds,skill 12, wait 2 minutes and 30 seconds,skill 1234, wait 2 minutes and 30 seconds,skill 12, wait 2 minutes and 30 seconds,skill 12, wait 2 minutes and 30 seconds,skill 8541237, wait 2 minutes and 30 seconds,skill 12, wait 2 minutes and 30 seconds,skill 12, wait 2 minutes and 30 seconds,skill 1234, wait 2 minutes and 30 seconds,skill 12, wait 2 minutes and 30 seconds,skill 12, wait 2 minutes and 30 seconds

 

and when I press the hotkey combination again I want the script to stop completely, and if I were to press the hotkey combination again it'd have to start from the beginning again. I don't need the script to autoclick for me as I already have a program running for that. would it also be possible to perhaps have some sort of visual indication that the script is running? that way I know it's running or not to and won't accidentally be running the script while I'm doing other things...

 

I've been trying to figure it out myself, and it's probably related to the pause coding, but it's just all a bit too advanced for me



Spawnova
  • Members
  • 279 posts
  • Last active: Dec 22 2015 03:07 AM
  • Joined: 29 Jun 2011
✓  Best Answer
#persistent
combo1:="8-6-9-1-2-3-4-5-7"
combo2:="1-2"
combo3:="1-2-3-4"
combo4:="8-5-4-1-2-3-7"
return

f9::reload   ;this will reload the script, pressinf f1 will start it over again


f1::
loop 
{
UseCombo(combo1,150000)  ;150000 = 2.5 minutes
UseCombo(combo2,150000)
UseCombo(combo2,150000)
UseCombo(combo3,150000)
UseCombo(combo2,150000)
UseCombo(combo2,150000)
UseCombo(combo4,150000)
UseCombo(combo2,150000)
UseCombo(combo2,150000)
UseCombo(combo3,150000)
UseCombo(combo2,150000)
UseCombo(combo2,150000)
}
return


UseCombo(c,sleepAmount) {
sleep 500 ;comment out if you want, I noticed all your hotkeys had 500 sleep though.
loop,parse,c,-
{
send %a_loopfield%
sleep 100
}
sleep %sleepAmount%
}

f8::exitapp  ;always have an emergency shutdown when dealing with loops

That should work for you, you can change the hotkeys to whatever you like

 

for now F1 starts the loop

F9 reloads the script, stopping the loop and causing F1 to start over when pressed



Yusunoha
  • Members
  • 7 posts
  • Last active: Oct 16 2015 07:04 PM
  • Joined: 31 Mar 2014
#persistent
combo1:="8-6-9-1-2-3-4-5-7"
combo2:="1-2"
combo3:="1-2-3-4"
combo4:="8-5-4-1-2-3-7"
return

f9::reload   ;this will reload the script, pressinf f1 will start it over again


f1::
loop 
{
UseCombo(combo1,150000)  ;150000 = 2.5 minutes
UseCombo(combo2,150000)
UseCombo(combo2,150000)
UseCombo(combo3,150000)
UseCombo(combo2,150000)
UseCombo(combo2,150000)
UseCombo(combo4,150000)
UseCombo(combo2,150000)
UseCombo(combo2,150000)
UseCombo(combo3,150000)
UseCombo(combo2,150000)
UseCombo(combo2,150000)
}
return


UseCombo(c,sleepAmount) {
sleep 500 ;comment out if you want, I noticed all your hotkeys had 500 sleep though.
loop,parse,c,-
{
send %a_loopfield%
sleep 100
}
sleep %sleepAmount%
}

f8::exitapp  ;always have an emergency shutdown when dealing with loops

That should work for you, you can change the hotkeys to whatever you like

 

for now F1 starts the loop

F9 reloads the script, stopping the loop and causing F1 to start over when pressed

 

awesome, this is exactly what I was looking for! thank you very much for your help :D

 

I did tweak it slightly though to my liking, I've tweaked it to this

#persistent
combo1:="1-2"
combo2:="1-2-3-4"
combo3:="8-5-4-1-2-3-7"
combo4:="8-3-7-1-2-4"
combo5:="8-6-9-1-2-3-4-5-7"
combo6:="8-6-9-1-2-3-4-7"
return

^Del::reload   ;this will reload the script, pressinf f1 will start it over again

!Ins::
UseCombo(combo3,500) 
return

!Del::
UseCombo(combo4,500) 
return

!PgUp::
UseCombo(combo5,500) 
return

!PgDn::
UseCombo(combo6,500) 
return

^Ins::
loop 
{
UseCombo(combo5,150000)  ;150000 = 2.5 minutes
UseCombo(combo1,150000)
UseCombo(combo1,150000)
UseCombo(combo2,150000)
UseCombo(combo1,150000)
UseCombo(combo1,150000)
UseCombo(combo3,150000)
UseCombo(combo1,150000)
UseCombo(combo1,150000)
UseCombo(combo2,150000)
UseCombo(combo1,150000)
UseCombo(combo1,150000)
}
return


UseCombo(c,sleepAmount) {
sleep 500 ;comment out if you want, I noticed all your hotkeys had 500 sleep though.
loop,parse,c,-
{
send %a_loopfield%
sleep 100
}
sleep %sleepAmount%
}

^PgUp::exitapp  ;always have an emergency shutdown when dealing with loops

I do have a little question though. when I added the manual skill combo's I had to add the delay behind the combo call, otherwise it'd throw me an error

to be more precise, I'm talking about this...

UseCombo(combo3,500) 

does it matter to what delay I set it to? I tried changing it but it didn't seem to change anything really.



Spawnova
  • Members
  • 279 posts
  • Last active: Dec 22 2015 03:07 AM
  • Joined: 29 Jun 2011

I do have a little question though. when I added the manual skill combo's I had to add the delay behind the combo call, otherwise it'd throw me an error

to be more precise, I'm talking about this...

UseCombo(combo3,500)

does it matter to what delay I set it to? I tried changing it but it didn't seem to change anything really.

For using them manually and not inside the loop, simply use a 0 or a 1 for sleep

 

Alternatively you can change the function to this

UseCombo(c,sleepAmount="") {
sleep 500 ;comment out if you want, I noticed all your hotkeys had 500 sleep though.
loop,parse,c,-
{
send %a_loopfield%
sleep 100
}
if sleepamount
sleep %sleepAmount%
}

this way if you don't specify a sleep amount it will skip that part



Yusunoha
  • Members
  • 7 posts
  • Last active: Oct 16 2015 07:04 PM
  • Joined: 31 Mar 2014

For using them manually and not inside the loop, simply use a 0 or a 1 for sleep

 

Alternatively you can change the function to this

UseCombo(c,sleepAmount="") {
sleep 500 ;comment out if you want, I noticed all your hotkeys had 500 sleep though.
loop,parse,c,-
{
send %a_loopfield%
sleep 100
}
if sleepamount
sleep %sleepAmount%
}

this way if you don't specify a sleep amount it will skip that part

 

 

I've been thinking if it's possible to improve the script some more... would it be possible to have it so when the automatic skill chains are activated, the script would autoclick for you, though it'd be a bit more than just autoclicking.

 

you'd start with placing the mouse cursor ontop of a buy button of a hero.

when you start one of the automatic skill chains the mouse cursor would move a certain amount of pixel to the right and start autoclicking.

but each time after it casted a skill chain, the mouse cursor would move back to the original location (the location of the buy button), autoclick about 3-5 times while holding down control (holding down control when buying levels for a hero allows you to buy 100 levels at a time instead of 1), and then move back to the right at the amount of pixel that you've set it to so it continues to autoclick.

if possible you could be able change how fast the script would autoclick for you by changing the value in the script because there's a maximum amount of clicks that Clicker Heroes will register and I don't know if the developers are planning on changing this in the future.

if possible could you also be able change the amount of pixels the mouse cursor would move to the right, because I have Clicker Heroes running in a seperate window that I resize so it can run along with other program windows that I've open, but if I run Clicker Heroes on another system I may resize the window to a different size.

 

as it may be a little confusing what I've been trying to tell here I've tried to explain it in this screenshot aswell.

 

bgaQQd7.jpg

 

this addition to the script would greatly help me for the times that I have the automatic skill chains running when I'm AFK and be able to progress alot further in the game because the autoclicker program that I now have only allows me to autoclick on 1 position, so that'd mean I can now only either autoclick on the buy button for heroes, or autoclick on the monsters, but if this could be added to the script I'd be able to do both.