egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[SOLVED] Public Command List Channel Members

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
gamer12
Voice


Joined: 14 Aug 2012
Posts: 10

PostPosted: Sun Sep 16, 2012 1:24 pm    Post subject: [SOLVED] Public Command List Channel Members Reply with quote

aaa

Edit: Original request for a script which lists members of a channel on public command. This thread is now locked. Sir_FZ


Last edited by gamer12 on Mon Sep 17, 2012 1:36 pm; edited 2 times in total
Back to top
View user's profile Send private message
Football
Master


Joined: 26 Dec 2008
Posts: 205
Location: Quakenet, #Football

PostPosted: Sun Sep 16, 2012 1:37 pm    Post subject: Reply with quote

Someone wrote this script for me a while ago:
Code:

bind pub o|o .call call:proc

proc call:proc {nick uhost hand chan arg} {
  global botnick
# check if user has access to bot or not
  set nicklist [chanlist $chan]
# removing botnick from list
  set notbot [lsearch $nicklist $botnick]
  set nicklist [lreplace $nicklist $notbot $notbot]
# removing nickname that triggered event
  set notnick [lsearch $nicklist $nick]
  set nicklist [lreplace $nicklist $notnick $notnick]
  puthelp "PRIVMSG $chan :$nicklist"
  puthelp "PRIVMSG $chan :>>>>> \0030,4$arg\003"
}

_________________
Idling at #Football, Quakenet.
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Mon Sep 17, 2012 12:25 am    Post subject: Reply with quote

Here's a better version, one that the bot won't flood itself off while trying to paste the entire list of channel members.
Code:

bind pub o|o !call pub:call

proc pub:call {nick uhost hand chan text} {
   # create the list with channel users (not bot's user's)
   set chanList [chanlist $chan]
   
   # remove botnick from list
   set pos [lsearch -nocase $chanList $::botnick]
   set chanList [lreplace $chanList $pos $pos]
   
   # paste 25 (or how many you wish) nicks per line
   while {[llength $chanList] != 0} {
      puthelp "PRIVMSG $chan :[join [lrange $chanList 0 25]]"
      set chanList [lrange $chanList 25 end]
   }
}

_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
gamer12
Voice


Joined: 14 Aug 2012
Posts: 10

PostPosted: Mon Sep 17, 2012 1:05 pm    Post subject: Reply with quote

thanks alot both of you!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber