mIRC Homepage
Posted By: raZOR join and topik - 10/06/05 05:01 PM
how to make that on join if i am op and if topic is empty to do / topic something...

coz i dont see $topic identifier :P
Posted By: Riamus2 Re: join and topik - 10/06/05 05:15 PM
To get the currect topic, use $chan(#channame).topic

So:

Code:
on *:join:#yourchan: { if ($nick == $me) { .timer 1 5 set.topic $chan } }

alias set.topic {
  if ($me isop $1 && !$chan($1).topic) {
    topic New topic
  }
}


Replace #yourchan and "New topic".

This hasn't been tested as I'm at work and can't connect right now, but I believe it will work.

The timer/alias combo gives you the delay for gaining ops. If you aren't gaining ops within 5 seconds of joining, adjust the timer.
Posted By: tidy_trax Re: join and topik - 10/06/05 05:37 PM
Code:
on *:op:#[color:red]channel[/color]:{
  if ($opnick == $me) && ($chan($chan).topic == $null) topic $chan [color:red]topic here[/color]
}
Posted By: Riamus2 Re: join and topik - 10/06/05 06:27 PM
Heh. Didn't consider doing it with an on join. laugh

Like I mentioned, I can't test right now... does !$chan(#channel).topic work (with the !), or do you need to use == $null instead?
Posted By: tidy_trax Re: join and topik - 10/06/05 06:38 PM
if (!$chan($chan).topic) works, but it's possible to set a topic to 0 or $false, so if ($chan($chan).topic == $null) is a more thorough check.
Posted By: Riamus2 Re: join and topik - 10/06/05 06:42 PM
Ah, okay. I didn't realize ! refers to 0 and $false as well as $null. I learn something new every day. smile
Posted By: raZOR Re: join and topik - 10/06/05 07:03 PM
this works super, but with 1 flaw

i got this

"#channel my topic"

and i would preffer only

"my topic"
Posted By: raZOR Re: join and topik - 10/06/05 07:07 PM
nvm i just removed $chan to gain what i wanted laugh

thanks for help !
Posted By: Riamus2 Re: join and topik - 10/06/05 07:07 PM
Code:
on *:op:[color:red]#channel[/color]:{
  if ($opnick == $me) && ($chan($chan).topic == $null) topic [color:red]topic here[/color]
}


Replace the red.

Easy mistake since most commands require $chan. smile
Posted By: tidy_trax Re: join and topik - 10/06/05 07:42 PM
That wasn't a mistake.

From /help /topic:

Quote:
/TOPIC #channel newtopic
Changes the topic for the channel.

example: /topic #friendly Oh what a beautiful day!


Does the default alias file have a topic alias with it? If so that might be why you didn't need to pass the #channel argument.
© mIRC Discussion Forums