mIRC Home    About    Download    Register    News    Help

Print Thread
B
Boogzor
Boogzor
B
Hey

I am looking for something that can automatically change a users name in to a specific color based on what one specific person says in chat.

So when user1 says "user2 has been promoted to rank major(4)" then user2 should automatically get a bright green color in the address book

It should only change color if user1 says that line but with different usernames and ranks.

Thanks
/Boogzor

5
5618
5618
5
You can use the /cnick command for this:
E.g.
Code:
on *:TEXT:*has been promoted to*:#chan:{
  if (($nick == user1) && ($1 ison $chan)) {
     if ($7 == major(4)) .cnick -a $v1 4
     elseif ($7 == major(5)) .cnick -a $v1 5
  }
}

This checks if the nick saying it is user1 and if the nickname he supplied is currently on the channel. It then looks at what the new rank is and changes the nick color in the address book (where 4 is red, 5 is brown, etc.).
Don't forget to also change #chan in the on TEXT event.

Last edited by 5618; 07/05/13 12:47 PM.
B
Boogzor
Boogzor
B
Thanks for the code.

Where should in put it with the Script editor?

and if i need to ad more ranks like this:
Private - Dark green
Corporal - Dark green
Sergeant - Dark green
Lieutenant - Dark green
Captain - Dark green
Major - lightgreen
Colonel - light greeen
Mjr.General - Yellow
Lt.General - light cyan

Should i ad more of these
Code:
elseif ($7 == major(5)) .cnick -a $v1 5


and change major to Colonel and the color code 5 to 9

Should have said that I am totally new to this.

Last edited by Boogzor; 07/05/13 06:09 PM.
5
5618
5618
5
The code should be placed under Remote (Alt+R), preferably a blank, new file (File > New) if you already have scripts loaded there.

And you are right about adding elseif-statements.
For instance, you change "major(5)" to "Captain" and then change "5" to "3".


Link Copied to Clipboard