Code: Select all
bind pib o !masters pub:showmasters
proc pub:showmasters {nick uh hand chan arg} {
set a {}
foreach b [chanlist $chan m|m] {
lappend a "$b ([nick2hand $b $chan])"
}
if {[llength $b] >= 2} {
puthelp "PRIVMSG $chan :There are [llength $b] masters in the channel: [string range [join $b {, }] 0 end-2]"
} else {
puthelp "PRIVMSG $chan :There is [llength $b] masters in the channel: [string range [join $b {, }] 0 end-2]"
}
}
oke but this still didn't work if i do this it crashed with the errorppslim wrote:Code: Select all
bind pib o !masters pub:showmasters proc pub:showmasters {nick uh hand chan arg} { set a {} foreach b [chanlist $chan m|m] { lappend a "$b ([nick2hand $b $chan])" } if {[llength $b] >= 2} { puthelp "PRIVMSG $chan :There are [llength $b] masters in the channel: [string range [join $b {, }] 0 end-2]" } else { puthelp "PRIVMSG $chan :There is [llength $b] masters in the channel: [string range [join $b {, }] 0 end-2]" } }
[15:52:17] <MrZap> [15:52] Tcl error in file 'mrzap.conf':
[15:52:17] <MrZap> [15:52] bad type, should be one of: act, away, bcst, bot, chat, chjn, chof, chon, chpt, ctcp, ctcr, dcc, disc, evnt, fil, filt, flud, join, kick, link, load, lost, mode, msg, msgm, need, nick, nkch, notc, note, part, pub, pubm, raw, rcvd, rejn, sent, sign, splt, time, topc, tout, unld, wall
[15:52:17] <MrZap> while executing
[15:52:17] <MrZap> "bind pib o !masters pub:showmasters "
[15:52:17] <MrZap> (file "scripts/homonl.tcl" line 116)
[15:52:17] <MrZap> invoked from within
[15:52:17] <MrZap> "source scripts/homonl.tcl"
[15:52:17] <MrZap> (file "mrzap.conf" line 333)
i found the error and changed it but the script still doesn't work.
[15:55:23] <BoBjUh> !masters
[15:55:24] <MrZap> There is 1 masters in the channel: BoBj
also if i change my nick still doesn't display my whole nick
Working code:ppslim wrote:Code: Select all
bind pib o !masters pub:showmasters proc pub:showmasters {nick uh hand chan arg} { set a {} foreach b [chanlist $chan m|m] { lappend a "$b ([nick2hand $b $chan])" } if {[llength $b] >= 2} { puthelp "PRIVMSG $chan :There are [llength $b] masters in the channel: [string range [join $b {, }] 0 end-2]" } else { puthelp "PRIVMSG $chan :There is [llength $b] masters in the channel: [string range [join $b {, }] 0 end-2]" } }
Code: Select all
bind pub o !masters pub:showmasters
proc pub:showmasters {nick uh hand chan arg} {
set a {}
foreach b [chanlist $chan m|m] {
lappend a "$b ([nick2hand $b $chan])"
}
if {[llength $b] >= 2} {
puthelp "PRIVMSG $chan :There are [llength $b] masters in the channel: [string range [join $b {, }] 0 end-2]"
} else {
puthelp "PRIVMSG $chan :There is [llength $b] masters in the channel: [string range [join $b {, }] 0 end-2]"
}
}
We got rid of the (stupid) typo.ppslim wrote:Typos, so shoot me