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.

little help please

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
p
petea4
Voice
Posts: 7
Joined: Sun Jan 21, 2007 11:08 am

little help please

Post by petea4 »

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
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Code: Select all

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 :)
p
petea4
Voice
Posts: 7
Joined: Sun Jan 21, 2007 11:08 am

Post by petea4 »

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: Select all

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
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

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] " | "]."
  }
}
p
petea4
Voice
Posts: 7
Joined: Sun Jan 21, 2007 11:08 am

Post by petea4 »

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..
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

change

Code: Select all

0:$chan...
to

Code: Select all

1:$chan...
p
petea4
Voice
Posts: 7
Joined: Sun Jan 21, 2007 11:08 am

Post by petea4 »

nice Sir_Fz ......you da man....... works like a dream
thanx so much m8
Post Reply