mIRC Homepage

topic and nicks

Posted By: juble

topic and nicks - 01/06/05 04:35 PM

hi there
i need a funny script but i dont know if its possible
i want every nick that join in channel then the bot to put him with some script code to the topic
for example
* RHETT_BUTLER has joined #channel
then the bot .......
* bot lchanges topic to 'RHETT_BUTLER,'
* Alice has joined #channel
then.........
* bot lchanges topic to 'RHETT_BUTLER,Alice '

thank you for advance smile
Posted By: LostServ

Re: topic and nicks - 01/06/05 04:41 PM

Code:
on 1:JOIN:#CHANNEL: {
   if (%jtnicks) set %jtnicks %jtnicks $nick
   else set %jtnicks $nick
   topic # %jtnicks
}


Make sure you change #CHANNEL to your channel.
Posted By: juble

Re: topic and nicks - 01/06/05 05:26 PM

thanks dude smile
Posted By: LostServ

Re: topic and nicks - 01/06/05 05:42 PM

Your welcome smile
Posted By: juble

Re: topic and nicks - 01/06/05 05:48 PM

but how can i make it if someone join-part three or four times to not wrote his nick three or four times?
something with variables but i cant make it
%jtnicks
Posted By: billythekid

Re: topic and nicks - 01/06/05 09:44 PM

Code:
 
on 1:JOIN:#CHANNEL: {

   if [color:red] !$findtok(%jtnicks,$nick,32) [/color]  set %jtnicks %jtnicks $nick

   else set %jtnicks $nick

   topic # %jtnicks

} 


i havent tested but should work.
Also you might wanna make a similar one for removing nicks when they quit/part/get kicked too.

btk
Posted By: FiberOPtics

Re: topic and nicks - 01/06/05 10:09 PM

You could replace:

if !$findtok(%jtnicks,$nick,32) set %jtnicks %jtnicks $nick
else set %jtnicks $nick

with

%jtnicks = $addtok(%jtnicks,$nick,32)
Posted By: DaveC

Re: topic and nicks - 02/06/05 05:10 AM

Code:
alias -l max.topic.length return 512
alias -l channel return #CHANNEL
;
on *:JOIN:$($channel): {
  if ($addtok($remtok(%jtnicks,$nick,1,32),$nick,32) != %jtnicks) {
    set -s %jtnicks $v1
    while ($len(%jtnicks) > $max.topic.length) { | var %jtnicks = $gettok(%jtnicks,2-,32) } | .timer.topic.change 1 1 topic $chan %jtnicks
  }
}
;
on *:PART:$($channel):{ 
  if ($istok(%jtnicks,$nick,32)) {
    set -s %jtnicks $remtok(%jtnicks,$nick,1,32)
    while ($len(%jtnicks) > $max.topic.length) { | var %jtnicks = $gettok(%jtnicks,2-,32) } | .timer.topic.change 1 1 topic $chan %jtnicks
  }
}
on *:KICK:$($channel):{
  if ($istok(%jtnicks,$knick,32)) {
    set -s %jtnicks $remtok(%jtnicks,$knick,1,32)
    while ($len(%jtnicks) > $max.topic.length) { | var %jtnicks = $gettok(%jtnicks,2-,32) } | .timer.topic.change 1 1 topic $chan %jtnicks
  }
}
;
on *:QUIT:{ var %chan = $channel
  if ($nick ison %chan) {
    set -s %jtnicks $remtok(%jtnicks,$nick,1,32)
    while ($len(%jtnicks) > $max.topic.length) { | var %jtnicks = $gettok(%jtnicks,2-,32) } | .timer.topic.change 1 1 topic %chan %jtnicks
  }
}
;
on *:NICK:{ var %chan = $channel
  if ($istok(%jtnicks,$nick,32)) {
    if ($reptok(%jtnicks,$nick,$newnick,1,32) != %jtnicks) {
      set -s %jtnicks $v1
      while ($len(%jtnicks) > $max.topic.length) { | var %jtnicks = $gettok(%jtnicks,2-,32) } | .timer.topic.change 1 1 topic %chan %jtnicks
    }
  }
}
Posted By: juble

Re: topic and nicks - 02/06/05 04:37 PM

wow thanks guys
specially DaveC
smile
Posted By: DaveC

Re: topic and nicks - 03/06/05 12:22 AM

no problems

hmmm just saw something to fix

see all the set -s they should just be set so the value isnt displayed as its set, i left them in when i was testing it.
© 2021 mIRC Discussion Forums