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 

anyway we can use this for stacked whois

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


Joined: 22 Mar 2015
Posts: 941

PostPosted: Thu Oct 13, 2022 6:41 am    Post subject: anyway we can use this for stacked whois Reply with quote

greetingz i took this code from CrazyCat from thread http://forum.egghelp.org/viewtopic.php?t=21204

Code:
 

namespace eval randmsg {

   setudef flag randmsg

   bind cron - "*/5 * * * *" ::randmsg::do

   proc do {mi ho da mo dow} {
      foreach chan [channels] {
         if {![channel get $chan randmsg]} { continue }
         set ulist [chanlist $chan]
         set vict [lindex $ulist [rand [llength $ulist]]]
         putserv "whois $vict"
      }
   }
}



i was wondering if this could be edited to use for stacked whois on nicks in stacks of 20

Quote:

/whois nick,nick,nick,nick,nick,nick,nick,nick,nick,nick,nick,nick,nick,nick,nick,nick,nick,nick,nick,nick


with delay between the stacks (as thats what dalnet allows per whois command) be it random or in alphabetical order at a time we would prefer in alphabetical order in stacks of 20 (so entire chanlist gets checked as using random might skip some and repeat check some) we want to use this to check for bad channels

thanks in advance gentz,
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Sat Oct 15, 2022 8:38 am    Post subject: Reply with quote

i did an attempt and got this far

Code:



namespace eval whois {


   bind cron - {* * * * *} [namespace current]::whois:cron

   setudef flag stackedwhois


   proc whois:cron {min hour day month weekday} {
      foreach channel [channels] {
         if {![channel get $channel stackedwhois]} continue
         if {![botisop $channel]} continue
         foreach member [chanlist $channel] {
            if {[isbotnick $member]} continue
            if {[isop $member $channel] || [ishalfop $member $channel] || [matchattr [nick2hand $member] fon|fon $channel]} continue
            lappend userList $member
         }
         if {[info exists userList]} { Stack:WHois $channel $userList }
      }
   }

   proc Stack:WHois {chan userList {max 20}} {
         set userList [lsort -dictionary $userList]
      set count [llength $userList]
      while {$count > 0} {
         if {$count > $max} {
            set users [join [lrange $userList 0 [expr {$max - 1}]] ","]
            set userList [lreplace $userList 0 [expr {$max -1}]]
            incr count -$max
         } else {
            set users [join $userList ","]
            set count 0
         }
                after [expr {2*1000*1}] [list  putnow "whois :$users"]
      }
   }
}
 


not sure where to go from here
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Sat Oct 15, 2022 9:11 am    Post subject: Reply with quote

next i wanted to add a delay after each stack of 20 nicks have been whoised
to prevent bot to be disconnected the timer i added didnt seem to do the job
after looking at where i added it it made sense why it shouldnt work only im not sure where to add the delay tbh
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