• 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!

Current Chat Channel Indicator

0xNaomi

Legacy Supporter 6
Retired Staff
Joined
Feb 22, 2013
So, I've been constantly annoyed by not knowing what the heck channel you're chatting in when you want to say something important. You can /ch and make sure you're in the channel, but what's the fun of that?
So I took the macro mod and made it happen.
0RVo1WU.jpg
You can see on the right it says "Now chatting in Offtopic" just like what you see if you used /ch o.
You can also see that it's low. It's just about between where Rei's Minimap and cooldown timers are located on the GUI for convenience, but you can put it anywhere.
The indicator only shows when you have chat open, it disappears when you enter gameplay.

Want? You got it.
(Do note my knowledge of scripting in the mod is limited; if you have better code let me know!)
So, firstly open up the GUI editor from your chat.
RaC9glX.png
Find "Button Panel Commands" and choose "Add Label". Click on any grid space to place it there.
When finished, the channel indicator will appear onscreen at roughly the same location.
So3vaUW.png
For the sake of this, the control name will be ChannelLabel. Unless you know what you are doing, do not change it. Set the text to whatever, and change colors/alignment/shadow to your liking. Do not set a binding.
EFHcLjb.png
Okay, we have our label set, we get to do the scripting part now!
Make sure the button is saved, then go to the macro mod main menu and ready it for setting onChat binding.
8IyDbHn.png
Now, for some code. Assuming you named the label ChannelLabel you can put this code and use it:
Code:
$${IFCONTAINS(%CHAT%,Now chatting in );IFCONTAINS(%CHAT%,:);ELSE;SETLABEL(ChannelLabel,%CHAT%);ENDIF;ENDIF;}$$
Once you save that code, you should be good. Just change channels and it'll start working!
First off is an IFCONTAINS, saying if the chat message contains "Now chatting in " it will continue. Next it checks for a : which filters pretty much any player message so no one can just say that in chat and mess it up. The else is inverting, so if there is no : it will set the ChannelLabel label to the "Now chatting in " text. I couldn't figure out how to directly do if it doesn't contain, so that had to do =/
Wow, big wall of text. Well, that's all for this. Hope I was of help.
 

JacobBurkey

Portal
Joined
Jun 26, 2012
So if we didn't want the message to be "Now chatting in *chat*" we can just change in the code to what we want right? Ex: "Talking in Channel *chat*"
 

0xNaomi

Legacy Supporter 6
Retired Staff
Joined
Feb 22, 2013
Sadly, I don't know how it's done. I just ripped the text right out of chat so it as it currently is won't be able to.
It might be doable by someone who can effectively use the mod, but no promises.
 

MultiHeartGold

Legacy Supporter 2
Joined
Jun 7, 2012
Improved Chat has the channels appear on the chat right next to where you type, and with macros I usually have done /ch who every now and then, to check both the channel and the people there, but I guess this is still somewhat useful.
 

0xNaomi

Legacy Supporter 6
Retired Staff
Joined
Feb 22, 2013
Improved Chat has the channels appear on the chat right next to where you type, and with macros I usually have done /ch who every now and then, to check both the channel and the people there, but I guess this is still somewhat useful.
Ah, so that's what usefulness that mod has after a couple functions got into vanilla.
 
Top