mIRC Homepage
Posted By: simps Message customization - 15/11/05 02:06 AM
Well, I've seen all my friends have something different than the default symbols around their nicks when they copy and paste something someone said, such as (nick) or something.
I've asked them, but none of them could get the correct script. frown
I was wondering if any of you could help me make a remote for that. My requests are:
a) Keep my own colors that I've customized already
b) have (nick) when a person says something in a channel or a private message
c) have all the modes that the person has, such as (@%nick)

All help would be appreciated.
Thanks in advance.
- simps
Posted By: SladeKraven Re: Message customization - 15/11/05 06:25 AM
I'm not too sure how this will work out for you, I've just coded it now.. It seems to work for me but if you find any bugs let me know here or Private Message, alternatively my e-mail address is on my profile in case I'm not currently active on the forum..

*** Note this will only work on mIRC version 6.16.. ***

Code:
On *:Exit: hsave -i cm cm.dat

On *:Start: {
  hmake cm 10
  if ($exists(cm.dat)) hload -i cm cm.dat
}

dialog cm {
  title "Custom Messages"
  size -1 -1 99 61
  option dbu
  text ". (Owner)", 2, 5 3 30 8
  text "@ (Op)", 3, 5 13 30 8
  text "% (Half Op)", 4, 5 23 30 8
  text "@ (Voice)", 5, 5 34 30 8
  button "Random", 6, 25 46 23 10
  edit "", 8, 38 2 55 10
  edit "", 9, 38 12 55 10
  edit "", 10, 38 22 55 10
  edit "", 11, 38 32 54 10
  button "Clear", 12, 52 46 23 10
}

On *:Dialog:cm:sclick:*: {
  if ($did == 6) { 
    var %x = 8
    while (%x <= 11) {
      did -ra cm %x $rand(0,15)
      inc %x
    }
  }
  elseif ($did == 12) { 
    did -r cm ,8,9,10,11
  }
  hsave -i cm cm.dat
} 

On *:Dialog:cm:close:0: {
  var %x = 8
  while (%x <= 11) {
    if (!$did(%x)) hadd -m cm $replace($gettok($gettok($did($dname,$calc(%x - 6)),2,40),1,41),$chr(32),$chr($asc(_))) $rand(0,15)
    else { hadd -m cm $replace($gettok($gettok($did($dname,$calc(%x - 6)),2,40),1,41),$chr(32),$chr($asc(_))) $did(%x) }
    inc %x
  }
  hsave -i cm cm.dat
}

On *:Dialog:cm:init:0: {
  if (!$hget(cm)) hmake cm 1
  var %x = 8
  while (%x <= 11) {
    if ($hget(cm,$replace($gettok($gettok($did($dname,$calc(%x - 6)),2,40),1,41),$chr(32),$chr($asc(_))))) did -a cm %x $v1
    inc %x
  }
  hsave -i cm cm.dat
}

alias cm {
  if (!$1) && (!$dialog(cm)) dialog -dm cm cm
  if ($1 isreg $2) set %pnick $1
  else {
    var %mode = $left($nick($2,$1).pnick,1), %nick = $nick($2,$1).pnick
    if (%mode == &) || (%mode == .) set %pnick $+($chr(3),$iif($hget(cm,owner),$v1,$rand(0,15)),%mode,$chr(3),$mid(%nick,2))
    if (%mode == @) set %pnick $+($chr(3),$iif($hget(cm,op),$v1,$rand(0,15)),%mode,$chr(3),$mid(%nick,2))
    if (%mode == %) set %pnick $+($chr(3),$iif($hget(cm,half_op),$v1,$rand(0,15)),%mode,$chr(3),$mid(%nick,2)))
    if (%mode == +) set %pnick $+($chr(3),$iif($hget(cm,voice),$v1,$rand(0,15)),%mode,$chr(3),$mid(%nick,2))
  }
  return %pnick
}

On ^*:Text:*:#: {
  echo -at $+($chr(40),$cm($nick,$chan),$chr(41)) $1-
  haltdef
}


Type /cm to open up control panel you can customize your colours there. In each edit box you can choose the colour for a nick mode.

Ex: . (Owner) 0 will make the . or & for owner in white. smile

-Andy
Posted By: simps Re: Message customization - 15/11/05 10:30 PM

There's a screenshot. It has multi color prefixes. Can the multicolor prefixes be changed to just the color i set? confused Also, I don't have ( ) around my nick. Thanks for making a script that included the modes that a nick has, though. grin
Posted By: SladeKraven Re: Message customization - 16/11/05 04:35 AM
With my one you can predefine the colour for each mode in the control panel, each mode can have it's own colour.

Code:
on *:INPUT:*: {  
  if (/* !iswm $1) && (!$ctrlenter) {
    echo -t $target ( $+ $nick($chan,$me).pnick $+ ) $1-
    .msg $target $1-
    halt
  }
}


This is for brackets around your nickname.

-Andy
Posted By: Riamus2 Re: Message customization - 16/11/05 02:21 PM
I'm guessing your script has a $rand method for determining the color of the prefix. You could always try searching the scripts for $rand. Usually, you won't have to look through too many lines as $rand isn't used THAT often, but it may also be that there will be hundreds to search through. It's worth a shot, though. If you see something about color and prefixes that uses $rand, then you could replace that with your specific color instead of $rand(1,15) or whatever it happens to use.
Posted By: simps Re: Message customization - 17/11/05 01:35 AM
I really suck at coding. Can you please take out the $rand stuff for me because I think I'll mess it up or something. Also, messages from inactive channels are going into my active channel (including my server window). It's really weird. Can you please fix that? Thanks in advance. grin
Posted By: SladeKraven Re: Message customization - 17/11/05 01:50 AM
Replace my cm alias with this.

Code:
alias cm {
  if (!$1) && (!$dialog(cm)) dialog -dm cm cm
  if ($1 isreg $2) set %pnick $1
  else {
    var %mode = $left($nick($2,$1).pnick,1), %nick = $nick($2,$1).pnick
    if (%mode == &) || (%mode == .) set %pnick $+($chr(3),$iif($hget(cm,owner),$v1),%mode,$chr(3),$mid(%nick,2))
    if (%mode == @) set %pnick $+($chr(3),$iif($hget(cm,op),$v1),%mode,$chr(3),$mid(%nick,2))
    if (%mode == %) set %pnick $+($chr(3),$iif($hget(cm,half_op),$v1),%mode,$chr(3),$mid(%nick,2)))
    if (%mode == +) set %pnick $+($chr(3),$iif($hget(cm,voice),$v1),%mode,$chr(3),$mid(%nick,2))
  }
  return %pnick
}


-Andy
Posted By: simps Re: Message customization - 17/11/05 04:47 AM
There are still messages that are coming from inactive channels to the active one. Can you help me get rid of that?

I don't have the ( ) around my nick.

Also, can I just use the colors that I've set in the mIRC Colors box?


Sorry for making you guys edit the code so much. frown
Posted By: SladeKraven Re: Message customization - 17/11/05 05:04 AM
1.

Code:
On ^*:Text:*:#: {  
  echo -t $target $+($chr(40),$cm($nick,$chan),$chr(41)) $1-
  haltdef
}


2.

The code for () around your nickname is my On Input code above.

3. mIRC Colours Box has nothing to do with nick modes in a chat room, you are better off sticking to my control panel.

-Andy
Posted By: simps Re: Message customization - 17/11/05 05:26 AM
The little tab bars of the channels used to turn red when there was someone saying something. Now it only turns blue. Can I make it turn red? confused

Also, now everyone saying stuff has my nick.
© mIRC Discussion Forums