mIRC Home    About    Download    Register    News    Help

Print Thread
#99616 03/10/04 01:05 AM
Joined: Sep 2004
Posts: 12
R
Pikka bird
OP Offline
Pikka bird
R
Joined: Sep 2004
Posts: 12
When %dj is set by the code below, it adds two spaces rather than just one so the funtions that call the %dj don't work. What am I doing wrong?

Code:
on 1:TEXT:!onair * - *:#: {
  if ($nick isop $chan) {
    tokenize $asc(-) $2-
    topic $chan :: Rock 101.9 The Edge :: Now Playing: $1 :: %announce ::
    set %show $1
    set %dj $2
  }
  else { msg $chan You don't have permission to use this feature. }
} 


Thanks!
Rock1019

#99617 03/10/04 02:47 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Stupidity removed wink

Instead of what you have, try something like this:
Code:
on $*:TEXT:/!onair ([\w\s]+) - ([\w\s]+)/:#: {
  if ($nick isop $chan)) {
    var %1 = $regml(1), %2 = $regml(2)
    ;
    ; ...from here, use %1 as $1 and %2 as $2...
    ;
  }
}


If it's okay for the values to contain spaces, then leave the \s in both the ()'s of the event. Otherwise, remove the \s from the ()'s.

If neither values are supposed

Last edited by KingTomato; 03/10/04 02:58 AM.

-KingTomato
#99618 03/10/04 02:52 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
While your script is fine on the face of it, you misidentified the original poster's problem, as he had used /tokenize to split the orignal tokens.

set %dj $right($2,-1) would of fixed his problem, but your way is better (more accurate).

#99619 03/10/04 02:57 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Ahh, my mistake. I hadn't noticed the tokenize command, and should have probably also looked for it wink Oops! blush


-KingTomato

Link Copied to Clipboard