mIRC Homepage
Posted By: sparta theme help - 21/03/13 11:18 AM
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:
raw *:* {
  if ($numeric == 329) {
    set %:topic $chan($2).topic
    set %:chan $2 
    if (!%:topic) { set %:topic no topic found }
  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?
Posted By: sparta Re: theme help - 21/03/13 08:09 PM
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.
Posted By: Deega Re: theme help - 21/03/13 09:33 PM
Why are you messing around setting/unsetting vars?
Just echo the info straight to the relevant channel.
raw *:* {
  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))

Posted By: sparta Re: theme help - 22/03/13 09:53 AM
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.
© mIRC Discussion Forums