• Register so you can experience the greatest RPG server ever! Use the keyword "Herocraft" when registering!Register! Enjoy the server @ play.hc.to !
  • Guest, Make sure to use our LAUNCHER! Read more here!

How To Create GUI Elements in Macro Mod! (Cooldowns/Mana Bar)

Joined
Feb 24, 2011
Likes
47
Location
TERA, Mount Tyrannas
#1
THIS IS NOT RECOMMENDED ANY MORE!
IF YOU NEED A MOD TO DISPLAY INFORMATION USE THE HEROMOD FOUND
HERE!

EVERYTHING BELOW THIS IS LEGACY. USE AT YOUR OWN RISK!


--------------------------------------------------------------------------------------------------------------------------------------

BIG NOTE: TEST IT IN SINGLE PLAYER AND FAKE THE MESSAGES OR USE THE LOCAL CHANNEL (/ch l). SPAMMING CHAT = MUTE OR BAN.


This is a little guide on how you can add skill cooldowns to the HUD! With the Macro Mod, the possibilities are endless!


Below are the Base Scripts which I use are for the Ninja class. They can be modified to the hearts content to suit your looks, and skills.

Now, first we start with setting up your GUI. Open up your GUI Editor in the Macro Mod menu.


Once on the screen, make sure you add the in game screen to all of the slots, except for the first one.


Now open up your "ingame" screen, adjust the grid to how you feels good, and add in a Label. Using Recall as an example, just change the Label text to Recall for now. Change the colours and settings to your feel. (Control Name doesn't matter for this particular case.)


Now add in a progress bar. This is the main object that will be showing you your cooldown. For this, my recall's cooldown bar fills as the cooldown reduces. For this object, make sure you set the Max Value to the STARTING COOLDOWN value. Recalls in this case is 900 seconds. At this point, name the Control Name "RECALLCD" and make the Expr "[email protected]#recall". This expresses that it will fill as the cooldown reduces. (Foreground colour does not need to be modified. This is done in the script.)


Now, you have your basic GUI elements set up, time to add the scripts! Now, exit back into the main screen and open up the Text Editor from the same corner that the GUI editor is in. Once on the Text Editor screen, create a new file called "yourclassCD.txt" (replace yourclass with your class, durr) and click create.


You should open up to the text editor screen. Now, enter this code into the editor (copy and paste works):
Code:
$${
IFMATCHES(%CHATCLEAN%,"<name> used recall");
SET(@#recall, 900);
SETPROPERTY(RECALLCD,colour,#FFB52D00);
DO()
    IF(@#recall=0);
        BREAK;
    ENDIF;
    WAIT(1000ms);
    DEC(@#recall,1);
WHILE(@#recall>0);
SETPROPERTY(RECALLCD,colour,#FF66A8FF);
ENDIF;
}$$
Make sure to change <name> to your EXACT ingame name.

This is the script that will do the work for you. Now save it, return to the Macro Mod's main screen and go over to the Event's Binding tab. Here, we can make that script watch chat for the skill messages to trigger the GUI.


Now click on the "onChat" event and add this to the macro bind:
Code:
$$<filecreated.txt>
Make sure to change the file name to the one you created. (And keep the arrows! <>)

You have now successfully created a cooldown timer for Recall! You can basically recycle the code to create multiple cooldown timers to multiple skills. Just make sure to adjust them to be correct for that skill. All skill information can be found on the Herocraft Wiki! (hc.to/wiki)

Sample of multiple skills on the text file (using my preferred code):
Code:
$${
IFMATCHES(%CHATCLEAN%,"Jloy1 used recall");
SET(@#recall, 900);
SETLABEL(LABEL_RECALLCD, %@#recall%s);
SETPROPERTY(RECALLCD,colour,#FFB52D00);
DO()
    IF(@#recall=0);
        BREAK;
    ENDIF;
    WAIT(925ms);
    DEC(@#recall,1);
    SETLABEL(LABEL_RECALLCD, %@#recall%s);
WHILE(@#recall>0);
SETLABEL(LABEL_RECALLCD, "");
SETPROPERTY(RECALLCD,colour,#FF66A8FF);
ENDIF;

IFMATCHES(%CHATCLEAN%,"Jloy1 used backflip");
SET(@#backflip, 6);
SETLABEL(LABEL_BACKFLIPCD, %@#backflip%s);
SETPROPERTY(BACKFLIPCD,colour,#FFB52D00);
DO()
    IF(@#backflip=0);
        BREAK;
    ENDIF;
    WAIT(925ms);
    DEC(@#backflip,1);
    SETLABEL(LABEL_BACKFLIPCD, %@#backflip%s);
WHILE(@#backflip>0);
SETLABEL(LABEL_BACKFLIPCD, "");
SETPROPERTY(BACKFLIPCD,colour,#FF66A8FF);
ENDIF;
}$$
Make sure everything is placed in between the $${ }$$ brackets!

If you have any questions, feel free to post them here and I will try and answer them as best as I can.


HUGE thanks to @Rida for showing me the ways and making the base script. This would have not been possible without her.
Here are the original scripts I made for Pyro and Paladin classes, which can be easily modified for those two classes (if you're lazy). Jloy uses a slightly different method than I do, but it should be easy enough to figure out the small differences. I also included the gui for Pyro (I can supply the one for Paladin whenever), but again, slight differences.
http://www.filedropper.com/macros2

But yeah, note that his allows for numeric counters as well, while mine does not.
A few people asked me to do a video guide on how to get the cooldown bars working so here it is. Visual learners rejoice!
All credit to @Jloy1 for this game changing discovery
His thread:
http://herocraftonline.com/main/threads/create-gui-elements-in-macro-mod-cooldowns-mana-bar.52934/


The text code that I used in the video (I recommend you copy his though)
Code:
$${
IFMATCHES(%CHATCLEAN%,"Ahrall used Backflip");
SET(@#backflip, 6);
SETPROPERTY(BACKFLIP,colour,#FFB52D00);
DO()
    IF(@#backflip=0);
        BREAK;
    ENDIF;
    WAIT(1000ms);
    DEC(@#backflip,1);
WHILE(@#backflip>0);
SETPROPERTY(BACKFLIP,colour,#FF66A8FF);
ENDIF;
}$$

(Disclaimer: I am not responsible for any chat spam, mutes, bans, anger or brutally beaten PC's from attempting to do this. If you don't know how to work the mod, google it/research.)

 
Last edited:
Joined
Feb 24, 2011
Likes
47
Location
TERA, Mount Tyrannas
#2
Now, Mana Bar is much more simpler.

Just follow the same steps as before to create a label and progress bar for your Mana and name the Control Name "MANA" and the Expr to "@#mana". Max should be at 100.(And colour it. :p)

Create a new text file in the Text Editor named "ManaBar" and save this into it:
Code:
$${
IFMATCHES(%CHATCLEAN%,"^Mana: (.+?) - (.+?)%",&mana,2);
SET(@#mana,%&mana%);
ENDIF;
IFMATCHES(%CHATCLEAN%,"^MANA (.+?)%",&mana,1);
SET(@#mana,%&mana%);
ENDIF;
IFMATCHES(%CHATCLEAN%,"^(..)% ",&mana,1);
SET(@#mana,%&mana%);
ENDIF;
}$$
THIS REQUIRES MANA TO BE VERBOSED! Use TabbyChat to filter stuff to a blank tab.

Now change the onChat event bind to look like this:
Code:
$$<ManaBar.txt>|$$<classCD.txt>
This will run BOTH ManaBar and your Class macros at the same time.

It's as simple as that.
 
Last edited:
Joined
Mar 25, 2011
Likes
558
Location
Essos
#4
Thank you so much for posting this! I will be sure to test it out when I get home to my computer instead of this shitty macbook.
 

what777

Maximum Supporter X
Joined
Feb 5, 2012
Likes
132
#5
Hey Jloy, ingame I saw you post a bar of Envenom that showed you how long the skill was active. Can you explain how to do that?
 
Joined
Feb 24, 2011
Likes
47
Location
TERA, Mount Tyrannas
#6
Code:
$${
IFMATCHES(%CHATCLEAN%,"Jloy1 has coated his weapons with a deadly poison");

SET(@#envenom, 30);
SET(@#envenomdur, 14);

SETLABEL(LABEL_ENVENOMDUR, %@#envenomdur%s);
SETLABEL(LABEL_ENVENOM, "Envenom");
SETPROPERTY(ENVENOMDUR,colour,#FF09ED8E);

SETLABEL(LABEL_ENVENOMCD, %@#envenom%s);
SETPROPERTY(ENVENOMCD,colour,#FFB52D00);
SETPROPERTY(ENVENOMDUR,visible,true);
DO()
    IF(@#envenom=0);
        BREAK;
    ENDIF;
    IF(@#envenomdur=0);
        SETLABEL(LABEL_ENVENOMDUR, "");
        SETLABEL(LABEL_ENVENOM, "");
        SETPROPERTY(ENVENOMDUR,visible,false);
    ENDIF;
    WAIT(925ms);
    DEC(@#envenom,1);
    DEC(@#envenomdur, 1);

    SETLABEL(LABEL_ENVENOMCD, %@#envenom%s);
    IF(@#envenomdur>0);
        SETLABEL(LABEL_ENVENOMDUR, %@#envenomdur%s);
    ENDIF;;
WHILE(@#envenom>0);
SETLABEL(LABEL_ENVENOMCD, "");
SETPROPERTY(ENVENOMCD,colour,#FF66A8FF);
ENDIF;
}$$
Basically adding in SETLABEL and giving that a value and then making it blank when the cooldown is 0. It also uses envenomdur instead. I also make the objects visible upon using the skill and 14 seconds later, it goes back to being invisible.
 
Last edited:
Joined
May 12, 2014
Likes
12
#10
Here are the original scripts I made for Pyro and Paladin classes, which can be easily modified for those two classes (if you're lazy). Jloy uses a slightly different method than I do, but it should be easy enough to figure out the small differences. I also included the gui for Pyro (I can supply the one for Paladin whenever), but again, slight differences.
http://www.filedropper.com/macros2

But yeah, note that his allows for numeric counters as well, while mine does not.
 
Joined
May 12, 2014
Likes
12
#15
Jloy! Or Rida, ill pay if you guys set up a full cleric suite :3
I would recommend learning the process. Once you know what to do, making a set for a new class takes about 30 minutes or so. That way, you can also customize it how you like. My GUI looks different from Jloy1's, and both of ours look different from Piptendo's.
 

ShadowRavynn

Maximum Supporter X
Joined
Feb 3, 2013
Likes
73
Location
Florida
#18
You guys should all post a screenie of your screen setup! :)

and thank you for this! I figured you could do something but I never had the time to look into it further! <3 <3
 
Joined
May 12, 2014
Likes
12
#20
I need to add a few little tips.
1. If you want the mana bar to flash when low, post this here at the enc of the mana bar text file, just before the }$$: http://puu.sh/9kqe5/4ed1a088c4.jpg

2. To stop your configs changing back to default when you log, under OnJoin, type in $${CONFIG(Pyromancer)}$$ (Pyromancer being my configuration's name).

3. If you want to swap classes, but may want to change back, back up the GUI files just somewhere on your computer. You can also simply make a new text file.

4. If you want to delve further into the macro mod, check out this amazing list of commands, and check out the forums page for the mod (where you can find sample scripts and such if you search).

Also, here is my setup: On screen
Behind the scenes
In Action
 
Last edited:
Top