mIRC Home    About    Download    Register    News    Help

Print Thread
join and topik #122417 10/06/05 05:01 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
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


IceCapped
Re: join and topik #122418 10/06/05 05:15 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
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.


Invision Support
#Invision on irc.irchighway.net
Re: join and topik #122419 10/06/05 05:37 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
on *:op:#[color:red]channel[/color]:{
  if ($opnick == $me) && ($chan($chan).topic == $null) topic $chan [color:red]topic here[/color]
}


New username: hixxy
Re: join and topik #122420 10/06/05 06:27 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
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?


Invision Support
#Invision on irc.irchighway.net
Re: join and topik #122421 10/06/05 06:38 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
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.


New username: hixxy
Re: join and topik #122422 10/06/05 06:42 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Ah, okay. I didn't realize ! refers to 0 and $false as well as $null. I learn something new every day. smile


Invision Support
#Invision on irc.irchighway.net
Re: join and topik #122423 10/06/05 07:03 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
this works super, but with 1 flaw

i got this

"#channel my topic"

and i would preffer only

"my topic"


IceCapped
Re: join and topik #122424 10/06/05 07:07 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
nvm i just removed $chan to gain what i wanted laugh

thanks for help !


IceCapped
Re: join and topik #122425 10/06/05 07:07 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
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


Invision Support
#Invision on irc.irchighway.net
Re: join and topik #122426 10/06/05 07:42 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
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.


New username: hixxy