• 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 Create GUI Elements in Macro Mod! (Cooldowns/Mana Bar)

w0nd3rb0y

Legacy Supporter 5
Joined
May 4, 2012
Location
Charlotte, North Carolina
It's pretty simple. Here is the script for the Macro.
Follow instruction on how to make a .txt file from the OP.
Code:
IFMATCHES(%CHATCLEAN%,"^    \[Skill\] Player used Skill on (.+?)!");
    Set(#counter1, 15);
        do()
    SetLabel(@skill,&cSkill %#counter1%);
        Dec(#counter1);
        wait(1);
    Until(#counter1 == 0)
    if(#counter1 == 0)
        SetLabel(@skill, Skill);
    ENDIF;
ENDIF;

It is VERY important that you match the Chat, to the first line. So when you use the skill, it activates the macro. If the skill uses the [Skill] in chat format, make sure you "^<TAB>\[Skill\]<SPACE>player used. The Backslashes in "Skill" are essential.

If the skill is used on a player or even yourself, replace the name of the player with (.+?) as seen in this code.

Some skills do not use the [Skill] format, ie Balance where the chat message is just You used Balance! If this is the case just put "^You used Balance!" Simple enough, most people with a brain will be able to figure it out.

Now onto the counter. Each skill needs to be a different counter. Notice in this script it is #counter1. This will work for the first skill. The next script you write for another skill will be #counter2 and so on.

Edit: the number next to the first #counter1 is the CD in seconds, in this case 15

Moving on the the @skill. This appears twice in the script. This is the control name. So name it after the skill for ease of remembering. I would suggest using lowercase. So if we are doing it for the skill "JUMP" make the control name @jump.

Lastly you will notice just the word Skill after the control name. This is What will appear in the Label we make later. The first Skill follows a color code, &c which is Red. This is the color the label will be when on CD. The second is not colored, and this is because that color is determined by the color you choose on the label.

On to the Label.
Go to your GUI screen, and select one of the GUIs either default, ingame, or inchat. Either on you choose, MAKE SURE you drag the GUI from the LEFT to the RIGHT "ingame" location.
Qlpvm0b.png

Next "Add Label" on gui screen.
2eimg7x.png

In control name you will put the control name from the script. So as previously stated if you used @jump, this is what you will but there.

In Label text just put %%

In binding you will put your counter from the script. In this case it will be #counter1. However this will change with each script, so pay attention.

Next it's up to you to make it pretty. I select Middle Centre and make the Opacity 0%. The color is also up to you. In the picture it is the default green, but you can make it whatever you want.

Lastly, go to OnChat event and put in.\:
Code:
$${$$<classcds.txt>$$}$$
Obviously replacing classcds.txt with the name of you text file.

@Ahrall if you find time, could you make a video on this? You commentate far better than I.
 
Last edited:

CoolBeans279

Legacy Supporter 3
Joined
Jan 6, 2014
Location
uremom
It's pretty simple. Here is the script for the Macro.
Follow instruction on how to make a .txt file from the OP.
Code:
IFMATCHES(%CHATCLEAN%,"^    \[Skill\] Player used Skill on (.+?)!");
    Set(#counter1, 15);
        do()
    SetLabel(@skill,&cSkill %#counter1%);
        Dec(#counter1);
        wait(1);
    Until(#counter1 == 0)
    if(#counter1 == 0)
        SetLabel(@skill, Skill);
    ENDIF;
ENDIF;

It is VERY important that you match the Chat, to the first line. So when you use the skill, it activates the macro. If the skill uses the [Skill] in chat format, make sure you "^<TAB>\[Skill\]<SPACE>player used. The Backslashes in "Skill" are essential.

If the skill is used on a player or even yourself, replace the name of the player with (.+?) as seen in this code.

Some skills do not use the [Skill] format, ie Balance where the chat message is just You used Balance! If this is the case just put "^You used Balance!" Simple enough, most people with a brain will be able to figure it out.

Now onto the counter. Each skill needs to be a different counter. Notice in this script it is #counter1. This will work for the first skill. The next script you write for another skill will be #counter2 and so on.

Moving on the the @skill. This appears twice in the script. This is the control name. So name it after the skill for ease of remembering. I would suggest using lowercase. So if we are doing it for the skill "JUMP" make the control name @jump.

Lastly you will notice just the work Skill after the control name. This is What will appear in the Label we make later. The first Skill follows a color code, &c which is Red. This is the color the label will be when on CD. The second is not colored, and this is because that color is determined by the color you choose on the label.

On to the Label.
Go to your GUI screen, and select one of the GUIs either default, ingame, or inchat. Either on you choose, MAKE SURE you drag the GUI from the LEFT to the RIGHT "ingame" location.
Qlpvm0b.png

Next "Add Label" on gui screen.
2eimg7x.png

In control name you will put the control name from the script. So as previously stated if you used @jump, this is what you will but there.

In Label text just put %%

In binding you will put your counter from the script. In this case it will be #counter1. However this will change with each script, so pay attention.

Next it's up to you to make it pretty. I select Middle Centre and make the Opacity 0%. The color is also up to you. In the picture it is the default green, but you can make it whatever you want.

Lastly, go to OnChat event and put in.\:
Code:
$${$$<classcds.txt>$$}$$
Obviously replacing classcds.txt with the name of you text file.

@Ahrall if you find time, could you make a video on this? You commentate far better than I.
Counter's look far better, i get kinda lost trying to follow the steps in text. If Ahrall could make a video i'd be happy :D
 

Pugglez_

Legacy Supporter 3
Joined
Jun 11, 2011
Code:
IFMATCHES(%CHATCLEAN%,"^    \[Skill\] Player used Skill on (.+?)!");
    Set(#counter1, 15);
        do()
    SetLabel(@skill,&cSkill %#counter1%);
        Dec(#counter1);
        wait(1);
    Until(#counter1 == 0)
    if(#counter1 == 0)
        SetLabel(@skill, Skill);
    ENDIF;
ENDIF;
Can you post an example code for a non-targettable skill like Jump? Still don't get what i have to replace.
 

werwew19

Coder
Balance Team
Legacy Supporter 6
Joined
Apr 10, 2012
Location
United States
Hate to be that guy but I thought herocraft limited use to only keybinds and macro scripting wasn't allowed? Did this change when I was under a rock for the past 3-4 months?
 

Eldrylars

Legacy Supporter 8
Joined
Apr 28, 2012
Location
Dragon through ...
Pretty sure the entirety of macro mod was banned..... I've seen my brothers get executed by the kain hammer for a simple coord macro

Interesting, I know general macros from third party programs that spammed things like "/skill smelt iron" on a timer were not illegal and used heavily the last two maps. That is as long as you are at your computer when it's running. I know of several people who walked away while it was running and got temp banned :rolleyes:
 

Eldrylars

Legacy Supporter 8
Joined
Apr 28, 2012
Location
Dragon through ...
Regardless, this thread has been alive for days with tons of people working on it in and out of game with no resistance, so whatever the case may have been before, it's obviously not a problem anymore.
 

Egorh

Outcast
Legacy Supporter 7
Joined
Jun 30, 2011
I remember Macro Mod being completely illegal at the start of DG but it became legal. I can't say if at one point all the scripting 'components' were disabled but I remember a few have always been there (I remember the party coords used to work but that got disabled sadly)
 

Eldrylars

Legacy Supporter 8
Joined
Apr 28, 2012
Location
Dragon through ...
Seems like the information needed to make party healthbars and coords should be able to be used here since HeroMod was able to get to them.

Any idea's about grabbing the party information so to can have healthbars for party members?
 

greenliketea

A frightening Cactus!
Joined
May 4, 2011
I'm not sure how to get this to work with Blink since it doesn't display any message when using the skill. Sorry if there's an obvious answer to this question.
 

CoolBeans279

Legacy Supporter 3
Joined
Jan 6, 2014
Location
uremom
Seems like the information needed to make party healthbars and coords should be able to be used here since HeroMod was able to get to them.

Any idea's about grabbing the party information so to can have healthbars for party members?
Would love to see this happen!

I'm not sure how to get this to work with Blink since it doesn't display any message when using the skill. Sorry if there's an obvious answer to this question.
blink wont ever work because there is no message for using it.
 

w0nd3rb0y

Legacy Supporter 5
Joined
May 4, 2012
Location
Charlotte, North Carolina
Seems like the information needed to make party healthbars and coords should be able to be used here since HeroMod was able to get to them.

Any idea's about grabbing the party information so to can have healthbars for party members?
I'm not entirely sure how to go about it just yet, however I'm sure it would require onhealthchange and echo fictions to be put in, on top of that, everyone would need to be running the script to get their health
 

w0nd3rb0y

Legacy Supporter 5
Joined
May 4, 2012
Location
Charlotte, North Carolina
Seems like the information needed to make party healthbars and coords should be able to be used here since HeroMod was able to get to them.

Any idea's about grabbing the party information so to can have healthbars for party members?
I did figure it out, but unfortunately it would require 4 things.
1. everyone would need tabbychat, this is just for convenience
2. would need a private chat for party member HP status chat spam
3. onhealthchange would need to be enabled
4. echo function would need to be enabled.
 

Eldrylars

Legacy Supporter 8
Joined
Apr 28, 2012
Location
Dragon through ...
I did figure it out, but unfortunately it would require 4 things.
1. everyone would need tabbychat, this is just for convenience
2. would need a private chat for party member HP status chat spam
3. onhealthchange would need to be enabled
4. echo function would need to be enabled.

Yeah, lots of steps.
Seems like there should already be an existing data feed that Heromod would have used to gather this information.
 

what777

Max Legacy Supporter
Joined
Feb 5, 2012
Yeah, lots of steps.
Seems like there should already be an existing data feed that Heromod would have used to gather this information.

heromod wasn't made through MacroMod though.
MacroMod can read HP etc too, but it's disabled for HC I believe.
(Even: OnHealthChange)
 
Top