• Guest, we are doing a new map (refresh) for Herocraft. Gather your friends and get ready! Coming next Friday, 06/28/24 @ 7PM CT play.hc.to
    Read up on the guides and new systems! Here.
    View the LIVE Map here @ hc.to/map
    Stuck or have a problem? use "/pe create" to to open a ticket with staff (There are some known issues and other hotfixes we will be pushing asap)
  • Guest, Make sure to use our LAUNCHER! Read more here!

How To How to make GUI Counters!

Pugglez_

Legacy Supporter 3
Joined
Jun 11, 2011
Make sure that you include the "$$ {" at the beginning of the script and "}$$" at the end of the script and that you replace the right words. Yes, it does matter if a letter is lowercase or uppercase and even double spaces between words can make a difference.

Note: This is different from Jloy1/Rida_'s method of GUI Progress Bars, this uses Counters instead of Progress Bars.

1. Open up your keyboard layout and open up the GUI Editor at the bottom right corner.
831661dfcf.png

-----------------------------------
2. Make sure everything is default except for "ingame" You can do this by dragging whatever item you need from the "Available Screens" from the bar to the left.
11c5fe9a64.png

-----------------------------------
3. Open up your Text Editor which is found in the bottom right corner from your key bind layout, which is the icon "…I" It is the second button to the right from the GUI Editor.
-----------------------------------
4. Create a new file called classCD.txt. Ofcourse the "class" being your class. For example, a file for the wizard cd, then wizardCD.txt
1. From the file you created, copy and paste this code
Code:
$${

IFMATCHES(%CHATCLEAN%,"^    \[Skill\] PlayerName used SkillName!");
    Set(#counterNumber, CD);
        do()
    SetLabel(@skill,&cSkill %#counterNumber%);
        Dec(#counterNumber);
        wait(1);
    Until(#counterNumber == 0)
    if(#counterNumber == 0)
        SetLabel(@skill, Skill);
    ENDIF;
ENDIF;
}$$
-----------------------------------
2. Now you basically replace the things like "PlayerName," "SkillName," "#counterNumber," "CD,"
So for example this is a script for Fireball:
Code:
$${
IFMATCHES(%CHATCLEAN%,"^    \[Skill\] whiteninja1970 used Fireball!");
    Set(#counter1, 5);
        do()
    SetLabel(@fireball,&cFireball %#counter1%);
        Dec(#counter1);
        wait(1);
    Until(#counter1 == 0)
    if(#counter1 == 0)
        SetLabel(@fireball, Fireball);
    ENDIF;
ENDIF;
}$$
Pay attention to the #counter Numbers, these will change as you add more skills. Like if we made a Counter for another skill, we would name it #counter2 instead of #counter1. When setting cooldowns they are in seconds and make them one second less than the actual cool down. So in this case, Fireball has a 6 second cool down so I put a 5 second instead for the CD. Make sure to properly capitalize everything, so if its lowercase its lowercase.

Now, there are other skills that appear as "PlayerName used SkillName on …" You basically replace the
\[Skill\] PlayerName used SkillName! with \[Skill\] PlayerName used SkillName on (.+?). So for example,
Code:
IFMATCHES(%CHATCLEAN%,"^    \[Skill\] whiteninja1970 used Megabolt on (.+?)!");
    Set(#counter8, 20);
        do()
    SetLabel(@megabolt,&cMegabolt %#counter8%);
        Dec(#counter8);
        wait(1);
    Until(#counter8 == 0)
    if(#counter8 == 0)
        SetLabel(@megabolt, Megabolt);
    ENDIF;
ENDIF;
1. To create your labels, go to your GUI Editor again, and double click the "ingame" button from the "Available Screens" tab on the left side.
-----------------------------------
2. This should bring up a grid editing for "ingame," adjust the grid to what you want.
-----------------------------------
3. Now add a label from the bottom left corner.
7897dd95aa.png

-----------------------------------
4. For the Label Settings its like this:
Control Name: @skill
Label Text: %%
Binding: #counterNumber
So for example, I made a counter for fireball and set the counter to #counter1:
e85ce0fb3f.png
1. Now after you set up your labels and script code, make sure to add the "$${" at the beginning of the script and "}$$" at the end of the script.
-----------------------------------
2. Now you go back to your keyboard layout and switch to "Macro Bindings: Events" by using the arrows from the top left corner.
-----------------------------------
3. Now click onChat and type in $$<file.txt> and obviously replace the "file" to be whatever name is the file you created. So for example $$<wizardCD.txt>
I plan on making scripts for you guys for other classes on other classes. Also on these scripts, just replace all the "whiteninja1970" with your username.
Wizard Script: http://pastie.org/9288773
#counter1: @fireball
#counter2: @replenish
#counter3: @icebolt
#counter4: @pulse
#counter5: @entangle
#counter6: @bolt
#counter7: @fireblast
#counter8: @megabolt

Bloodmage Script: http://pastie.org/9307394
#counter1: @siphonblood
#counter2: @infusion
#counter3: @combustblood
#counter4: @boilblood
#counter5: @bloodritual
#counter6: @bloodgift
#counter7: @thickenblood
Bard Script: http://pastie.org/9533331
#counter1: @warsong
#counter2: @manasong
#counter3: @kick
#counter4: @boastfulbellow
#counter5: @voidsong


Credits to @Rida @Jloy1 @w0nd3rb0y @kenster1092 for all the help in order to make this thread :D

 
Last edited:

CoolBeans279

Legacy Supporter 3
Joined
Jan 6, 2014
Location
uremom
Make sure that you include the "$$ {" at the beginning of the script and "}$$" at the end of the script and that you replace the right words. Yes, it does matter if a letter is lowercase or uppercase and even double spaces between words can make a difference.
1. Open up your keyboard layout and open up the GUI Editor at the bottom right corner.
831661dfcf.png

-----------------------------------
2. Make sure everything is default except for "ingame" You can do this by dragging whatever item you need from the "Available Screens" from the bar to the left.
11c5fe9a64.png

-----------------------------------
3. Open up your Text Editor which is found in the bottom right corner from your key bind layout, which is the icon "…I" It is the second button to the right from the GUI Editor.
-----------------------------------
4. Create a new file called classCD.txt. Ofcourse the "class" being your class. For example, a file for the wizard cd, then wizardCD.txt
1. From the file you created, copy and paste this code
Code:
$${

IFMATCHES(%CHATCLEAN%,"^    \[Skill\] PlayerName used SkillName!");
    Set(#counterNumber, CD);
        do()
    SetLabel(@skill,&cSkill %#counterNumber%);
        Dec(#counterNumber);
        wait(1);
    Until(#counterNumber == 0)
    if(#counterNumber == 0)
        SetLabel(@skill, Skill);
    ENDIF;
ENDIF;
}$$
-----------------------------------
2. Now you basically replace the things like "PlayerName," "SkillName," "#counterNumber," "CD,"
So for example this is a script for Fireball:
Code:
$${
IFMATCHES(%CHATCLEAN%,"^    \[Skill\] whiteninja1970 used Fireball!");
    Set(#counter1, 5);
        do()
    SetLabel(@fireball,&cFireball %#counter1%);
        Dec(#counter1);
        wait(1);
    Until(#counter1 == 0)
    if(#counter1 == 0)
        SetLabel(@fireball, Fireball);
    ENDIF;
ENDIF;
}$$
Pay attention to the #counter Numbers, these will change as you add more skills. Like if we made a Counter for another skill, we would name it #counter2 instead of #counter1. When setting cooldowns they are in seconds and make them one second less than the actual cool down. So in this case, Fireball has a 6 second cool down so I put a 5 second instead for the CD. Make sure to properly capitalize everything, so if its lowercase its lowercase.

Now, there are other skills that appear as "PlayerName used SkillName on …" You basically replace the
\[Skill\] PlayerName used SkillName! with \[Skill\] PlayerName used SkillName on (.+?). So for example,
Code:
IFMATCHES(%CHATCLEAN%,"^    \[Skill\] whiteninja1970 used Megabolt on (.+?)!");
    Set(#counter8, 20);
        do()
    SetLabel(@megabolt,&cMegabolt %#counter8%);
        Dec(#counter8);
        wait(1);
    Until(#counter8 == 0)
    if(#counter8 == 0)
        SetLabel(@megabolt, Megabolt);
    ENDIF;
ENDIF;
1. To create your labels, go to your GUI Editor again, and double click the "ingame" button from the "Available Screens" tab on the left side.
-----------------------------------
2. This should bring up a grid editing for "ingame," adjust the grid to what you want.
-----------------------------------
3. Now add a label from the bottom left corner.
7897dd95aa.png

-----------------------------------
4. For the Label Settings its like this:
Control Name: @skill
Label Text: %%
Binding: #counterNumber
So for example, I made a counter for fireball and set the counter to #counter1:
e85ce0fb3f.png
1. Now after you set up your labels and script code, make sure to add the "$${" at the beginning of the script and "}$$" at the end of the script.
-----------------------------------
2. Now you go back to your keyboard layout and switch to "Macro Bindings: Events" by using the arrows from the top left corner.
-----------------------------------
3. Now click onChat and type in $$<file.txt> and obviously replace the "file" to be whatever name is the file you created. So for example $$<wizardCD.txt>
I plan on making scripts for you guys for other classes on other classes.
Wizard Script: http://pastie.org/9288773
#counter1: @fireball
#counter2: @replenish
#counter3: @icebolt
#counter4: @pulse
#counter5: @entangle
#counter6: @bolt
#counter7: @fireblast
#counter8: @megabolt

Credits to @Rida @Jloy1 @w0nd3rb0y @kenster1092 for all the help in order to make this thread :D
Could you make a bm script?

Would be much appreciated :D

@whiteninja1970
 

Pugglez_

Legacy Supporter 3
Joined
Jun 11, 2011
Sheesh, so greedy, I made this so YOU guys make your own sets :p But oh well since I'm a nice guy, I'll make it sometime this week. The rune blade, Ranger, and Paladin sets. On a vacation atm.
 

dils1

Legacy Supporter 7
Joined
Jun 19, 2011
Location
New Zealand
If you're feeling nice mohh could you make me a ninja one? I tried but the number kept counting backwards in negative
 

Pugglez_

Legacy Supporter 3
Joined
Jun 11, 2011
If you're feeling nice mohh could you make me a ninja one? I tried but the number kept counting backwards in negative
The number goes back in negative sometimes if theres lag.

This may no longer be needed with the new skill cooldowns on the scoreboard.
Not really, I still favor this over the cool down scoreboard that will be implemented since I can see the cool downs more with the gui counters.
 

Pugglez_

Legacy Supporter 3
Joined
Jun 11, 2011
is there a way to make the text when the skills on CD a different color?
Yes, you change the "&COLORID" from "SetLabel(@skill,&COLORIDSkill %#counterNumber%);" of the fourth line. For example, I changed the &COLORID to the color of "d" which is pink.

SetLabel(@fireball,&dFireball %#counter1%);

Code:
IFMATCHES(%CHATCLEAN%,"^    \[Skill\] whiteninja1970 used Fireball!");
    Set(#counter1, 5);
        do()
    SetLabel(@fireball,&dFireball %#counter1%);
        Dec(#counter1);
        wait(1);
    Until(#counter1 == 0)
    if(#counter1 == 0)
        SetLabel(@fireball, Fireball);
    ENDIF;
ENDIF;


Here is the color codes:
Colors.png
 

SurvivalManZ

ICE ICE ICE!
Joined
Jan 31, 2014
Location
Araria
Yes, you change the "&COLORID" from "SetLabel(@skill,&COLORIDSkill %#counterNumber%);" of the fourth line. For example, I changed the &COLORID to the color of "d" which is pink.

SetLabel(@fireball,&dFireball %#counter1%);

Code:
IFMATCHES(%CHATCLEAN%,"^    \[Skill\] whiteninja1970 used Fireball!");
    Set(#counter1, 5);
        do()
    SetLabel(@fireball,&dFireball %#counter1%);
        Dec(#counter1);
        wait(1);
    Until(#counter1 == 0)
    if(#counter1 == 0)
        SetLabel(@fireball, Fireball);
    ENDIF;
ENDIF;


Here is the color codes:
Colors.png
Make sure that you include the "$$ {" at the beginning of the script and "}$$" at the end of the script and that you replace the right words. Yes, it does matter if a letter is lowercase or uppercase and even double spaces between words can make a difference.
1. Open up your keyboard layout and open up the GUI Editor at the bottom right corner.
831661dfcf.png

-----------------------------------
2. Make sure everything is default except for "ingame" You can do this by dragging whatever item you need from the "Available Screens" from the bar to the left.
11c5fe9a64.png

-----------------------------------
3. Open up your Text Editor which is found in the bottom right corner from your key bind layout, which is the icon "…I" It is the second button to the right from the GUI Editor.
-----------------------------------
4. Create a new file called classCD.txt. Ofcourse the "class" being your class. For example, a file for the wizard cd, then wizardCD.txt
1. From the file you created, copy and paste this code
Code:
$${

IFMATCHES(%CHATCLEAN%,"^    \[Skill\] PlayerName used SkillName!");
    Set(#counterNumber, CD);
        do()
    SetLabel(@skill,&cSkill %#counterNumber%);
        Dec(#counterNumber);
        wait(1);
    Until(#counterNumber == 0)
    if(#counterNumber == 0)
        SetLabel(@skill, Skill);
    ENDIF;
ENDIF;
}$$
-----------------------------------
2. Now you basically replace the things like "PlayerName," "SkillName," "#counterNumber," "CD,"
So for example this is a script for Fireball:
Code:
$${
IFMATCHES(%CHATCLEAN%,"^    \[Skill\] whiteninja1970 used Fireball!");
    Set(#counter1, 5);
        do()
    SetLabel(@fireball,&cFireball %#counter1%);
        Dec(#counter1);
        wait(1);
    Until(#counter1 == 0)
    if(#counter1 == 0)
        SetLabel(@fireball, Fireball);
    ENDIF;
ENDIF;
}$$
Pay attention to the #counter Numbers, these will change as you add more skills. Like if we made a Counter for another skill, we would name it #counter2 instead of #counter1. When setting cooldowns they are in seconds and make them one second less than the actual cool down. So in this case, Fireball has a 6 second cool down so I put a 5 second instead for the CD. Make sure to properly capitalize everything, so if its lowercase its lowercase.

Now, there are other skills that appear as "PlayerName used SkillName on …" You basically replace the
\[Skill\] PlayerName used SkillName! with \[Skill\] PlayerName used SkillName on (.+?). So for example,
Code:
IFMATCHES(%CHATCLEAN%,"^    \[Skill\] whiteninja1970 used Megabolt on (.+?)!");
    Set(#counter8, 20);
        do()
    SetLabel(@megabolt,&cMegabolt %#counter8%);
        Dec(#counter8);
        wait(1);
    Until(#counter8 == 0)
    if(#counter8 == 0)
        SetLabel(@megabolt, Megabolt);
    ENDIF;
ENDIF;
1. To create your labels, go to your GUI Editor again, and double click the "ingame" button from the "Available Screens" tab on the left side.
-----------------------------------
2. This should bring up a grid editing for "ingame," adjust the grid to what you want.
-----------------------------------
3. Now add a label from the bottom left corner.
7897dd95aa.png

-----------------------------------
4. For the Label Settings its like this:
Control Name: @skill
Label Text: %%
Binding: #counterNumber
So for example, I made a counter for fireball and set the counter to #counter1:
e85ce0fb3f.png
1. Now after you set up your labels and script code, make sure to add the "$${" at the beginning of the script and "}$$" at the end of the script.
-----------------------------------
2. Now you go back to your keyboard layout and switch to "Macro Bindings: Events" by using the arrows from the top left corner.
-----------------------------------
3. Now click onChat and type in $$<file.txt> and obviously replace the "file" to be whatever name is the file you created. So for example $$<wizardCD.txt>
I plan on making scripts for you guys for other classes on other classes. Also on these scripts, just replace all the "whiteninja1970" with your username.
Wizard Script: http://pastie.org/9288773
#counter1: @fireball
#counter2: @replenish
#counter3: @icebolt
#counter4: @pulse
#counter5: @entangle
#counter6: @bolt
#counter7: @fireblast
#counter8: @megabolt

Bloodmage Script: http://pastie.org/9307394
#counter1: @siphonblood
#counter2: @infusion
#counter3: @combustblood
#counter4: @boilblood
#counter5: @bloodritual
#counter6: @bloodgift
#counter7: @thickenblood

Credits to @Rida @Jloy1 @w0nd3rb0y @kenster1092 for all the help in order to make this thread :D

I did all that you said, but when I saw the counter, all I saw was Fireball 0 in red, then when it was ready, Fireball 0 in green. Did I do something wrong? Should there be a count down timer or something?
 
Top