mIRC Home    About    Download    Register    News    Help

Print Thread
#241138 21/03/13 11:18 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I made a theme engine for my script, but i got stuck on a problem, i cant get it to work as it should, it working as i want as long as i only join 1 channel, but if i do /join #one,#two it get f*ed up, the code looks like:
Code:
raw *:* {
  haltdef
  if ($numeric == 329) {
    set %:topic $chan($2).topic
    set %:chan $2 
    if (!%:topic) { set %:topic no topic found }
    _join
  }
  elseif ($numeric == 333) {
   set %:setby $gettok($1-,3,32)
   set %:time $asctime($gettok($1-,4,32))
}

alias _join {
  echo %:chan $+($chr(91),%:chan,$chr(93),$chr(32),Topic,$chr(32),$chr(40),%:topic,$chr(41))
  echo %:chan $+($chr(91),%:chan,$chr(93),$chr(32),Set,$chr(32),by,$chr(32),$chr(40),%:setby,$chr(41),$chr(32),At,$chr(32),$chr(40),%:time,$chr(41))
  unset %:*
}

Hixxy sugested i should use the $numeric 332 instead of the one i using, but i still got a problem. if i join more then one channel the echo of who set the topic ends up in the wrong channel, $numeric 329 will be sent after 333 so thats why i using that to call the _join alias. Any ideas?


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
sparta #241143 21/03/13 08:09 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
To old post to edit.

This is what happens now when i join more then one channel at a time:

You have entered #testing ...
(21:05) [#testing] Topic (Just a topic for show)
(21:05) [#testing] Set by (Nick) At (Thu Mar 21 21:00:03 2013)

Topic is the right one, the one created the topic is wrong. "Nick" made the topic in the second channel i joined, not the first one.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
sparta #241144 21/03/13 09:33 PM
Joined: Oct 2012
Posts: 164
D
Vogon poet
Offline
Vogon poet
D
Joined: Oct 2012
Posts: 164
Why are you messing around setting/unsetting vars?
Just echo the info straight to the relevant channel.
Code:
raw *:* {
  haltdef
  if ($numeric == 332) {
    echo $2 $+([,$2,] Topic $chr(40),$3-,$chr(41))
  }
  elseif ($numeric == 333) {
    echo $2 $+([,$2,] Set by $chr(40),$3,$chr(41) At $chr(40),$asctime($4),$chr(41))
  } 
}


Deega #241146 22/03/13 09:53 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I solved it with the use of only $numeric 333, and from that raw i can echo to the channel when raw i catched, no need of the alias i used first. smile Thnx for the help anyway.

echo -mt $2 rest of the text

$chan($2).topic = Topic from the channel.

$lower($gettok($3,1,33)) = Set by.

$asctime($4) = When topic was created.

Posting it here if somone else have the same problem as i did.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Link Copied to Clipboard