This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Join -> Count users -> Part

Old posts that have not been replied to for several years.
Locked
m
minotaur
Voice
Posts: 19
Joined: Sun Jul 06, 2003 8:36 pm

Join -> Count users -> Part

Post by minotaur »

Hi,

how can i say my bot to join a channel and count alle the people there (how many people in the channel) and then part :P the rest i know but not how to count a channel where the bot already is.
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

You need some script.Script will join a channel count users and part, how to make script or if anybody have scripte like this

:P
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

Code: Select all

  set counter 0
  set l1 [chanlist $chan] 
  foreach u $l1 { 
     incr counter
  } 
you can combine it with an [isvoice $u $chan] and so on to check how many ops are in there, etc...
that code should help you out, else i can make a full script for you tomorrow...i'm falling asleep allready

@]Kami[ : state usefull answers or just be silent...i dont think "you need a script" is a usefull answer if he asks for such a script
Last edited by GodOfSuicide on Mon Jul 28, 2003 3:43 pm, edited 1 time in total.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

just a simple

Code: Select all

set count [llength [chanlist $chan]]
will do the trick
Elen sila lúmenn' omentielvo
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

GodOfSuicide wrote:

Code: Select all

  set counter 0
  set l1 [chanlist $chan] 
  foreach u $l1 { 
     incr counter
  } 
you can combine it with an [isvoice $u $chan] and so on to check how many ops are in there, etc...
that code should help you out, else i can make a full script for you tomorrow...i'm falling asleep allready

@]Kami[ : state usefull answers or just be silent...i dont think "you need a script" is a usefull answer if he asks for such a script
Man you are stil joker :P , ok next time i will give ful anwser, you you will be quiet :P
m
minotaur
Voice
Posts: 19
Joined: Sun Jul 06, 2003 8:36 pm

Post by minotaur »

My problem is if i use something like that:

proc scan:chan { nick idx handle chan lochan } {
set lochan [split $lochan]
set localchannel [lindex $lochan 0]
channel add $localchannel
set chanlist [llength [chanlist $localchannel]]
if { $chanlist > "20" } {
putlog "Channel accepted $localchannel"
} else {
putlog "Channel not accepted"
}
channel remove $localchannel
}

But now he joins and party but always says Channel not accepted. I think he cant count because he check it before he is joined :(. how to do this?

than he says
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

how are you calling the proc and where do you want the output?
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

channel add $localchannel
set chanlist [llength [chanlist $localchannel]]

That's your problem - you add the channel but don't give the bot time before he joins it. Break your proc into several smaller ones, and use binds or timers to add a delay.
Locked