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.

Banmasks first without delay and with delay after

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
simo
Revered One
Posts: 1139
Joined: Sun Mar 22, 2015 2:41 pm

Banmasks first without delay and with delay after

Post by simo »

Greetingz,

is there a way to have the first 6 stacked modes +bbbbbb (or of course if there are less than 6 to send in total) be sent direct without any delay and everything after that

Code: Select all


proc StackUnbans {chan banlist {max 6}} {
         set chan [string tolower $chan] 
      set count [llength $banlist]
      while {$count > 0} {
         if {$count> $max} {
            set mode [string repeat "b" $max]
            set masks [join [lrange $banlist 0 [expr {$max - 1}]]]
            set banlist [lrange $banlist $max end]
            incr count -$max
         } else {
            set mode [string repeat "b" $count]
            set masks [join $banlist]
            set count 0
         }
             incr counter 1
             after [expr {$counter*4000}] [list  puthelp "MODE $chan -$mode $masks"]
      }
   }

 

s
simo
Revered One
Posts: 1139
Joined: Sun Mar 22, 2015 2:41 pm

Re: Banmasks first without delay and with delay after

Post by simo »

Any help with this code?
User avatar
CrazyCat
Revered One
Posts: 1379
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: Banmasks first without delay and with delay after

Post by CrazyCat »

Did you try inverting the two lines:
   incr counter 1
   after [expr {$counter*4000}] [list  puthelp "MODE $chan -$mode $masks"]
Become:
   after [expr {$counter*4000}] [list  puthelp "MODE $chan -$mode $masks"]
   incr counter 1
s
simo
Revered One
Posts: 1139
Joined: Sun Mar 22, 2015 2:41 pm

Re: Banmasks first without delay and with delay after

Post by simo »

thank you for your reply CrazyCat ,

ive tried your suggestion and got this error :
can't read "counter": no such variable
s
simo
Revered One
Posts: 1139
Joined: Sun Mar 22, 2015 2:41 pm

Re: Banmasks first without delay and with delay after

Post by simo »

im not sure if its proper but i tried this and it seems to work

Code: Select all


   if {![info exists counter]} { putquick "MODE $chan +$mode $masks" -next
         }  else { after [expr {$counter*5000}] [list  puthelp "MODE $chan +$mode $masks"] }
	      incr counter 1


User avatar
CrazyCat
Revered One
Posts: 1379
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: Banmasks first without delay and with delay after

Post by CrazyCat »

simo wrote: Sat Jan 24, 2026 10:01 am thank you for your reply CrazyCat ,

ive tried your suggestion and got this error :
can't read "counter": no such variable
Just initialize counter to 0 at the beginning of the procedure.
s
simo
Revered One
Posts: 1139
Joined: Sun Mar 22, 2015 2:41 pm

Re: Banmasks first without delay and with delay after

Post by simo »

you mean like this right ?

Code: Select all

set counter 0
i've used it at the start of the proc as u suggested
that seems to work if i used proper
Post Reply