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 

little help please

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
petea4
Voice


Joined: 21 Jan 2007
Posts: 7

PostPosted: Sun Jan 21, 2007 11:14 am    Post subject: little help please Reply with quote

hi guys
im lookin for a script that will scan all channels its in and report any nicks containing RSC

i.e
<me>!RSC
<bot> |channel A has 33| |channel B has 12| |channel C has 55| all nicks contain RSC
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sun Jan 21, 2007 3:02 pm    Post subject: Reply with quote

Code:
bind PUB m|o !RSC find:rsc

proc find:rsc {nickname hostname handle channel arguments} {

  if {[array exists channels]} {
    array unset channels
  }
  array set channels {}

  foreach chan [channels] {
    foreach user [chanlist $chan] {
      if {[string match *RSC* $user]} {
        set channels($chan) [expr {![info exists channels($chan)]?0:[incr $channels($chan)]}]
      }
    }
  }

  if {![array size channels]} {
    putserv "NOTICE $nickname :Found no users."
  } else {
    putserv "PRIVMSG $channel :[join [array get channels] " | "]."
  }
}


Untested Smile
Back to top
View user's profile Send private message
petea4
Voice


Joined: 21 Jan 2007
Posts: 7

PostPosted: Sun Jan 21, 2007 3:47 pm    Post subject: Reply with quote

dont seem to work i made a booboo by saying RCS when it is RDS so i changed all the rcs to rds
as below
Code:
bind PUB m|o !RDS find:rds

proc find:rds {nickname hostname handle channel arguments} {

  if {[array exists channels]} {
    array unset channels
  }
  array set channels {}

  foreach chan [channels] {
    foreach user [chanlist $chan] {
      if {[string match *RDS* $user]} {
        set channels($chan) [expr {![info exists channels($chan)]?0:[incr $channels($chan)]}]
      }
    }
  }

  if {![array size channels]} {
    putserv "NOTICE $nickname :Found no users."
  } else {
    putserv "PRIVMSG $channel :[join [array get channels] " | "]."
  }
}


but all i keep getting is
Tcl error [find:rds]: can't read "0": no such variable

thanks for trying
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Jan 21, 2007 8:47 pm    Post subject: Reply with quote

Code:
bind PUB m|o !RDS find:rds

proc find:rds {nickname hostname handle channel arguments} {
  foreach chan [channels] {
    foreach user [chanlist $chan] {
      if {[string match *RDS* $user]} {
        set channels($chan) [expr {![info exists channels($chan)]?0:$channels($chan)+1}]
      }
    }
  }

  if {![array size channels]} {
    putserv "NOTICE $nickname :Found no users."
  } {
    putserv "PRIVMSG $channel :[join [array get channels] " | "]."
  }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
petea4
Voice


Joined: 21 Jan 2007
Posts: 7

PostPosted: Mon Jan 22, 2007 2:37 pm    Post subject: Reply with quote

thanx Sir_Fz
seems to work but one of the 3 channels comes back as havin 0 in it when i can see one nick in all 3 channels. so seems to pick that nick up in 2 channels but not channel 3 it picked 5 up in channel 1 and 9 in channel 2 but 0 in channel 3 but one of the nicks was in all 3 channels..
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Jan 22, 2007 2:48 pm    Post subject: Reply with quote

change
Code:
0:$chan...

to
Code:
1:$chan...

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
petea4
Voice


Joined: 21 Jan 2007
Posts: 7

PostPosted: Mon Jan 22, 2007 3:07 pm    Post subject: Reply with quote

nice Sir_Fz ......you da man....... works like a dream
thanx so much m8
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    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