mIRC Home    About    Download    Register    News    Help

Print Thread
#102827 13/11/04 02:26 PM
C
compaq
compaq
C
How do I add a random nick completer? Do I need to create an alias?

#102828 13/11/04 03:47 PM
S
Sigh
Sigh
S
You could create an alias to style text a particular way for added use in other areas of your script. Could you clarify what you mean by "random", how exactly you want it to look, and do you actually want to complete a nickname or style a nickname if it exists as the first word of an input message (or both)?

#102829 13/11/04 07:46 PM
C
compaq
compaq
C
For instance, if the nickname is XceL and I type "Xc, Hi", it'll be "XceL, Hi" in random colours.

#102830 13/11/04 08:12 PM
S
Sigh
Sigh
S
Here's one that uses ',' as a trigger, so it'll search for a matching nickname if a comma is used at the front of the first word. Colors the nickname, any more and it's likely to be quite annoying for others in the channel

Code:
alias randcol {
  var %i = $len($1),%t
  while (%i) {
    %t = $+(,$base($r(1,15),10,10,2),$mid($1,%i,1),%t)
    dec %i
  }
  return %t $+ 99
}


on *:input:#:{
  if (*, iswm $1) && ($nick(#,$fline(#,$replace($1,$chr(44),*),1,1))) {
    say $randcol($v1) $+ , $2-
    halt
  }
}


Note you can use $randcol(text) as an custom identifier in other parts of your script to return randomly colored text

#102831 13/11/04 09:21 PM
C
compaq
compaq
C
Ahhh, it doesn't work. When I type the nickname and a msg after the comma, it deletes the nickname and only the comma and the msg appear.

#102832 13/11/04 09:51 PM
S
Sigh
Sigh
S
You must be using a version of mIRC older than 6.16, change $v1 to $ifmatch in $randcol()

#102833 14/11/04 01:58 AM
C
compaq
compaq
C
Thanks a lot. But is it normal that whenever I type nickname, msg, it says the whole msg twice?

#102834 14/11/04 02:05 AM
C
compaq
compaq
C
Is it possible to add specific colour codes? Such as underline, or only colouring specific letters, instead of random-colouring ALL the letters in the nickname?


Link Copied to Clipboard