mIRC Home    About    Download    Register    News    Help

Print Thread
#211261 09/04/09 09:50 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I have a problem with a raw event, i use the code below, but the only thing that gives the right value is the last part:

Total: $nick($2,0,a)

everything else return 0, ideas?
Code:
raw *:*: {
  if ($numeric == 332) {
    .timer -m 1 400 echo -mt $2 Operators:  $+ $nick($2,0,o) $+  $+ / $+ $round($calc($nick($2,0,o) / $nick($2,0) * 100),0) $+  % . Voices:  $+ $nick($2,0,v) $+  $+ / $+ $round($calc($nick($2,0,v) / $nick($2,0) * 100),0) $+ % . Regulares:  $+ $nick($2,0,r) $+  $+ / $+ $round($calc($nick($2,0,r) / $nick($2,0) * 100),0) $+ % . Total: $nick($2,0,a) $+ .
  }
}


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
sparta #211266 10/04/09 01:04 AM
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
This only happen when you join a channel, not when you're issuing a /topic #chan.
This is because mirc receive the raw 332 and the JOIN before the raw 353 (/names) where mirc fill $nick()
You can see this bu using a debug window smile

Edit : before mirc can fill $nick(), $nick($chan,0) return 1 because mirc know you're in the channel, that why only the last part work.

Last edited by Wims; 10/04/09 01:06 AM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard