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.
Help for those learning Tcl or writing their own scripts.
simo
Revered One
Posts: 1106 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Mon Jan 03, 2022 9:12 pm
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
SpiKe^^
Owner
Posts: 831 Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:
Post
by SpiKe^^ » Thu Jan 06, 2022 12:47 am
why the extra : in the mode command¿
simo
Revered One
Posts: 1106 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Thu Jan 06, 2022 10:43 am
SpiKe^^ wrote: why the extra : in the mode command¿
i dont see the extra : tho
putnow "MODE $chan :+$modex $masks"
SpiKe^^
Owner
Posts: 831 Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:
Post
by SpiKe^^ » Thu Jan 06, 2022 11:33 am
Duh.
Copy your examples exactly, neatness counts...
Code: Select all
putnow "MODE $chan +$modex $masks"
simo
Revered One
Posts: 1106 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Thu Jan 06, 2022 11:53 am
im not sure i understand what you mean spike^^ ?
SpiKe^^
Owner
Posts: 831 Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:
Post
by SpiKe^^ » Thu Jan 06, 2022 11:54 am
I will assume you have the script working now?
simo
Revered One
Posts: 1106 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Thu Jan 06, 2022 12:32 pm
no it doesnt seem to work proper it sets all kinds of channel modes and not the bans its suppose too
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Thu Jan 06, 2022 12:40 pm
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.
SpiKe^^
Owner
Posts: 831 Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:
Post
by SpiKe^^ » Thu Jan 06, 2022 12:40 pm
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:)
simo
Revered One
Posts: 1106 Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo » Thu Jan 06, 2022 1:17 pm
sorry my bad had a moment there
that seems to have fixed it
thanks Gents SpiKe^^ Caesar