P.S. I know nuts about TCL coding/scripting!
Please help! Thank you...

Code: Select all
bind pub - "!voice" scan:and:voice
proc scan:and:voice {nick uhost hand chan text} {
if {([botisop $chan])} {; set oplist [list]
putserv "PRIVMSG $chan :Scanning $chan for *!*@*.au users..."
foreach user [chanlist $chan] {
if {([string match "*.au" [lindex [split [getchanhost $user $chan] "@"] 1]])} {
lappend oplist $user }
}
putserv "PRIVMSG $chan :Scanning complete."
if {([llength $oplist] == 0)} { putserv "PRIVMSG $chan :No users matching *!*@.au found"; return 0 }
if {([llength $oplist] > 5])} { set oplist [lrange $oplist 0 4] }
putserv "PRIVMSG $chan :Found '5' or more users matching *!*@.au. Voicing the first 5 found."
putserv "MODE $chan +vvvvv [join $oplist]"; return 0
}
}
Code: Select all
putserv "MODE $chan +ooooo [join $oplist]"; return 0
Code: Select all
Tcl: syntax error in expression "([llength $oplist] > 5])"
Tcl: ("if" test expression)
Tcl: while compiling
Tcl: "if {([llength $oplist] > 5])} { set oplist [lrange $oplist 0 4] } "
Tcl: ("if" then script line 9)
Tcl: while compiling
Tcl: "if {([botisop $chan])} {; set oplist [list]
Tcl: putserv "PRIVMSG $chan :Scanning $chan for *!*@*.sg users..."
Tcl: foreach user [chanlist $chan] {
Tcl: if {(..."
Tcl: (compiling body of proc "scan:and:voice", line 2)
Tcl: invoked from within
Tcl: "scan:and:voice $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"
Code: Select all
bind pub - "!voice" scan:and:voice
proc scan:and:voice {nick uhost hand chan text} {
if {([botisop $chan])} {; set oplist [list]
putserv "PRIVMSG $chan :Scanning $chan for *!*@*.au users..."
foreach user [chanlist $chan] {
if {([string match "*.au" [lindex [split [getchanhost $user $chan] "@"] 1]])} {
lappend oplist $user }
}
putserv "PRIVMSG $chan :Scanning complete."
if {([llength $oplist] == 0)} { putserv "PRIVMSG $chan :No users matching *!*@.au found"; return 0 }
if {([llength $oplist] > 5)} { putserv "PRIVMSG $chan :Found '5' or more users matching *!*@.au. Voicing the first 5 found."
set oplist [lrange $oplist 0 4] }
putserv "MODE $chan +vvvvv [join $oplist]"; return 0
}
}
Thanks awyeah. It's work perfectly fine now. But what's make the TCL uncomplete is that I notice the bot only voice the first 5 of the channel nicklist, and the other users (nick below the first 5) which have *!*@*.au ISP doesn't get a voice after I did a second round of "!voice".awyeah wrote:Oops, sorry yeah missed a square bracket.
Try this:
Code: Select all
bind pub - "!voice" scan:and:voice proc scan:and:voice {nick uhost hand chan text} { if {([botisop $chan])} {; set oplist [list] putserv "PRIVMSG $chan :Scanning $chan for *!*@*.au users..." foreach user [chanlist $chan] { if {([string match "*.au" [lindex [split [getchanhost $user $chan] "@"] 1]])} { lappend oplist $user } } putserv "PRIVMSG $chan :Scanning complete." if {([llength $oplist] == 0)} { putserv "PRIVMSG $chan :No users matching *!*@.au found"; return 0 } if {([llength $oplist] > 5)} { putserv "PRIVMSG $chan :Found '5' or more users matching *!*@.au. Voicing the first 5 found." set oplist [lrange $oplist 0 4] } putserv "MODE $chan +vvvvv [join $oplist]"; return 0 } }
Code: Select all
if {([string match "*.au" [lindex [split [getchanhost $user $chan] "@"] 1]])} {
Code: Select all
if {([string match "*.au" [lindex [split [getchanhost $user $chan] "@"] 1]]) && (![isvoice $user $chan])} {
Code: Select all
!voice *!*@.isp.com
That's a great idea. But how do I edit it from the previous code if I want it to scan the entire channel and voice all within 1 time?awyeah wrote:Plus if you want to voicing all users it is better than voicing 5 users each time, when you type !voice, !voice uptill all users are voiced.
It can be noted that, !voiceall *!*@*.isp.com will voice all people with the matching host, !voice *!*@.isp.com 8 will only voice 8 users matching that host and so on you can make a script according to your needs.
Code: Select all
bind pub - "!voice" scan:and:voice
proc scan:and:voice {nick uhost hand chan text} {
if {([botisop $chan])} {; set oplist [list]
putserv "PRIVMSG $chan :Scanning $chan for *!*@*.au users..."
foreach user [chanlist $chan] {
if {([string match "*.au" [lindex [split [getchanhost $user $chan] "@"] 1]]) && (![isvoice $user $chan])} {
lappend oplist $user } }
putserv "PRIVMSG $chan :Scanning complete."
if {([llength $oplist] == 0)} { putserv "PRIVMSG $chan :No users matching *!*@.au found in $chan."; return 0 }
if {([llength $oplist] >= 1)} {
putserv "PRIVMSG $chan :Found '[llength $oplist] users' matching *!*@.au found in $chan."
foreach person $oplist {
pushmode "MODE $chan +v $person"
}; flushmode $chan
}; return 0
}
}
Tcl: wrong # args: should be "pushmode channel mode ?arg?"
Tcl: while executing
Tcl: "pushmode "MODE $chan +v $person" "
Tcl: (procedure "scan:and:voice" line 12)
Tcl: invoked from within
Tcl: "scan:and:voice $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"
Code: Select all
pushmode "MODE $chan +v $person"
Code: Select all
pushmode $chan +v $person
Cool, it's working perfectly well again!awyeah wrote:My bad.
/me *whacks* himself with a trout.
Replace:with:Code: Select all
pushmode "MODE $chan +v $person"
Code: Select all
pushmode $chan +v $person