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.

wont let me set maxbans on dalnet

Help for those learning Tcl or writing their own scripts.
Post Reply
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

wont let me set maxbans on dalnet

Post by simo »

im testing this badnick tcl on dalnet and it seems the message to channel outputs as expected using max allowed modes per line wich on dalnet is 6
yet the ban part sets all kinds of channel modes except the bans and i cant figure why

Code: Select all

bind pub -|o !n pub:badnickbanX7000

proc pub:badnickbanX7000 {nick host hand chan text} {
 
		global botnick

                set reason [join [lrange [split $text "."] 1 end] "."]
	        set text  [lindex [split $text "."] 0]
	        if {$reason eq ""} { set reason "PLease Change Your NickName By Using \------> /NICK New-NICK And Rejoin By Using \------> /JOIN $chan ...... thank you." }

		foreach user $text {

			if {![onchan $user $chan]} {
				lappend umasks *$user*!*@* 
			} else {
				     lappend umasks *$user*!*@* 
			}
	} 
       if {[info exists umasks]} {  stackBans3zXX $chan $umasks }
}

 

proc stackBans3zXX {chan banlist {max 6}} {
      set count [llength $banlist]
      while {$count > 0} {
         if {$count> $max} {
            set modex [string repeat "b" $max]
            set masks [join [lrange $banlist 0 [expr {$max - 1}]]]
            set banlist [lrange $banlist $max end]
            incr count -$max
            incr total $max
         } else {
            set modex [string repeat "b" $count]
            set masks [join $banlist]
            incr total $count
            set count 0
         }
         putnow "privmsg $chan :+$modex $masks"
         putnow "MODE $chan :+$modex $masks"
      }
   }
02:06:23 <@Cappuccino> !n Archer Barkley Behlke Bower Calan Cerell Donella Geldens Langdon Lion Meagan Naoma Ophelie Paine Petuu Piwowar Plossl Salmon Wachtel Wang
02:06:23 -HawkONE- : +bbbbbb *Archer*!*@* *Barkley*!*@* *Behlke*!*@* *Bower*!*@* *Calan*!*@* *Cerell*!*@* (DALnet)
02:06:23 @HawkONE Sets Mode on #Questions-ReLay to: +cn
02:06:23 -HawkONE- : +bbbbbb *Donella*!*@* *Geldens*!*@* *Langdon*!*@* *Lion*!*@* *Meagan*!*@* *Naoma*!*@* (DALnet)
02:06:23 @HawkONE Sets Mode on #Questions-ReLay to: +nsiMm
02:06:23 -HawkONE- : +bbbbbb *Ophelie*!*@* *Paine*!*@* *Petuu*!*@* *Piwowar*!*@* *Plossl*!*@* *Salmon*!*@* (DALnet)
02:06:24 @HawkONE Sets Mode on #Questions-ReLay to: +piPntsSm
02:06:26 -HawkONE- : +bb *Wachtel*!*@* *Wang*!*@* (DALnet)
02:06:28 @HawkONE Sets Mode on #Questions-ReLay to: +ctn
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

why the extra : in the mode command¿
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

SpiKe^^ wrote:why the extra : in the mode command¿


i dont see the extra : tho
putnow "MODE $chan :+$modex $masks"
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Duh.
Copy your examples exactly, neatness counts...

Code: Select all

putnow "MODE $chan +$modex $masks" 
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

im not sure i understand what you mean spike^^ ?
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

I will assume you have the script working now?
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

no it doesnt seem to work proper it sets all kinds of channel modes and not the bans its suppose too
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

In your code you have:

Code: Select all

putnow "MODE $chan :+$modex $masks" 
do you notice the : in front of the $modex? It shouldn't be there. Our guess is that it might be the cause of the issues you are experiencing.

Btw, why not stick with pushmode and why bother changing the function name and variables from original code? Asking for my pure curiosity. :)
Last edited by caesar on Thu Jan 06, 2022 12:41 pm, edited 1 time in total.
Once the game is over, the king and the pawn go back in the same box.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Please do as I said twice and remove the : from your mode line, or replace yours with the one I offered.

I don't know what else to tell you:)
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
s
simo
Revered One
Posts: 1107
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

sorry my bad had a moment there

that seems to have fixed it

thanks Gents SpiKe^^ Caesar
Post Reply