mIRC Homepage
Posted By: Kriminal Why Won't This work... - 07/03/04 12:09 AM
on *:INPUT:*:{
if ($active == $chan) && ($1 ison $chan) { set %nicklen $len($1) | set %color  $+ $rand(2,15) $+ ,01 | msg $chan %color $remove($nick($chan,$1).pnick,$1) $+ $left($1,1) $+ 15,01 $+ $replace($right($1,$calc(%nicklen - 1)),$right($1,1),%color $+ $right($1,1)) $+ 00,01: $2- | unset %color | halt }
if ($left($1,1) == /) { return | halt }
if ($left($1,1) != /) { .echo $chan $time( $+ %timestamp $+ ) %color.left $+ 10,1 $+ $remove($nick($chan,$me).pnick,$me)) $+ 0,1 $+ $me $+ %color.right 00,01 $+ $1- | .msg $active $1- | halt }
}
Ignore the if ($left($1,1) == / or != / part.
I'm talking about the nick colorer. It works for almost every nick except for Jellodude and Hobo. I don't know why...
Here's what I get (You'll have to paste it on mIRC to see)
<Mew-scripting> 12,01 @J15,0112,01ellodud12,01e00,01: o_o
<Mew-scripting> 3,01 @J15,013,01ellodud3,01e00,01: o_o
<Mew-scripting> 10,01 @J15,0110,01ellodud10,01e00,01: o_o
<Mew-scripting> 4,01 %+M15,01ew-scriptin4,01g00,01: =\
<Mew-scripting> 7,01 @+f15,01t[away7,01]00,01: :|
~Mew (Kriminal)
Posted By: Kriminal Re: Why Won't This work... - 07/03/04 12:38 AM
Alright, I know why. Because Jellodude has two "e" 's in his name. As well as hobo, having 2 o's in his name. Anyone know how to get around this?
Posted By: z0r Re: Why Won't This work... - 07/03/04 12:44 AM
Very ugly. First of all, it helps if you stick to one command per line:
Code:
on *:INPUT:*:{
  if ($active == $chan) &amp;&amp; ($1 ison $chan) { 
    set %nicklen $len($1)
    set %color  $+ $rand(2,15) $+ ,01
    msg $chan %color $remove($nick($chan,$1).pnick,$1) $+ $left($1,1) $+ 15,01 $+ $replace($right($1,$calc(%nicklen - 1)),$right($1,1),%color $+ $right($1,1)) $+ 00,01: $2-
    unset %color
    halt
  }
  if ($left($1,1) == /) {
    return
    halt
  }
  if ($left($1,1) != /) {
    .echo $chan $time( $+ %timestamp $+ ) %color.left $+ 10,1 $+ $remove($nick($chan,$me).pnick,$me)) $+ 0,1 $+ $me $+ %color.right 00,01 $+ $1-
    .msg $active $1-
    halt
  }
}
 

Eh, this sub can be removed: if ($left($1,1) != /) {
Sheesh. I think you meant $timestamp, instead of %timestamp.
And finally, on *:INPUT:*:{
A space should be inserted between : and {. This is most likely your error, as I find things don't work when I don't use that space.
Code:
on *:INPUT:*: {
  if ($active == $chan) &amp;&amp; ($1 ison $chan) {
    set %nicklen $len($1)
    set %color  $+ $rand(2,15) $+ ,01
    msg $chan %color $remove($nick($chan,$1).pnick,$1) $+ $left($1,1) $+ 15,01 $+ $replace($right($1,$calc(%nicklen - 1)),$right($1,1),%color $+ $right($1,1)) $+ 00,01: $2-
    unset %color
    halt
  }
  if ($left($1,1) != /) {
    .echo $chan $time( $+ $timestamp $+ ) %color.left $+ 10,1 $+ $remove($nick($chan,$me).pnick,$me)) $+ 0,1 $+ $me $+ %color.right 00,01 $+ $1-
    .msg $active $1-
    halt
  }
}
 

Still kinda ugly. Enjoy.
Posted By: z0r Re: Why Won't This work... - 07/03/04 12:46 AM
Ohhh. That's what you meant. Well I'm through shifting through scripts today. Try to keep it more simple than you have been.
Posted By: Online Re: Why Won't This work... - 07/03/04 12:46 AM
If $1 = Online, $left($1,1) would be O, $mid($1,2,-1) would be nlin and $right($1,1) would be e.
Posted By: Kriminal Re: Why Won't This work... - 07/03/04 12:55 AM
z0r, Your mothers ugly. =/
FOr one, damn noob, %timestamp is intended to be %timestamp. KTHX
And to Online, Thanks The code is fixed.
All I needed was to replace my part that got the ob out of Hobo with The $mid part you put.
Thanks a bunch.
Posted By: DaveC Re: Why Won't This work... - 07/03/04 01:18 AM
While zor wasnt elegant in his dilivery he did have a point about placing the code out nicely one line a command, I saw your post before any replies were issued, and just passed it over aas it was all clustered together, when its like that it takes 50% or more of the time just to decypher what its doing before you can locate the problem, when spaced out it reads faster and cleaner and erros are more notcable.

He was right about the == \, but the timestamp one was a guess as you may/are using your own, and he was wrong
about the { i never have a problem puttting it next to the :

PS : why have you been staring at his mom?
Posted By: Kriminal Re: Why Won't This work... - 07/03/04 01:20 AM
I haven't. She was looking at me. ;/
© mIRC Discussion Forums