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.

Need Help With This Proc I Made.

Old posts that have not been replied to for several years.
Locked
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Need Help With This Proc I Made.

Post by CoMMy »

I Have The Following Code.

Code: Select all

proc pub_globalunban {nick host handle chan testes} {
global botnick
set who [lindex $testes 0]
set banc 0
set bank 0
if {[matchattr $handle n]} {
if {$who == ""} {
putnotc $nick "Usage: ${::cmdchar}globalunban <host>"
return 0 }
foreach channel [channels] {
if {[isop $botnick $channel]} {
foreach banz [chanbans $channel] {
set mask [lrange $banz 0 end]
if {[string match [string tolower $who] [string tolower [lindex $banz 0]]]} {
pushmode $channel -b $mask
incr bank }}}}
foreach bans [banlist] {
set hm [lindex $bans 0]
if {[string match [string tolower $who] [string tolower [lindex $bans 0]]]} {
killban $hm
incr banc }}
putnotc $nick "Removed $banc (Internal) & $bank (ChanBanlist) Bans Matching '$who' From Global Banlists."
return 1 }}
And When I Execute It I Get An Error:

Code: Select all

Tcl error [pub_globalunban]: no value given for parameter "arg" to "pub_globalunban"
Can You Please Tell Me Where Is The Problem Here?
Thanks
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Post by Weirdo »

is there a value for the "testes" variable in the

proc pub_globalunban {nick host handle chan testes} { bit?

the arg is usually the $text variable
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

Code: Select all

proc pub_globalunban {nick uhost hand chan args} { 
global botnick
set who [lindex $args 0]
....?
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Post by CoMMy »

I Changed It To What ]Kami[ said but still it gives the same error.

Any other suggestions?
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
d
dollar
Op
Posts: 178
Joined: Tue Oct 28, 2003 3:47 pm
Location: Netherlands

Re: Need Help With This Proc I Made.

Post by dollar »

Hmm, I don't actually find what causes the error :P But here are a few hints anyway:
CoMMy wrote:

Code: Select all

proc pub_globalunban {nick host handle chan testes} {
global botnick
set who [lindex $testes 0]
$testes is a STRING, and you're using a LIST command on it, split $testes first.
CoMMy wrote:

Code: Select all

if {[string match [string tolower $who] [string tolower [lindex $banz 0]]]} { 
What about the -nocase switch for string match? :P
Oh and, think about using proper indentation on your code, so you can find errors more easily.
dollar (or something similar) at:
#eggdrop / #tcl - undernet
#egghelp / #tcl / #eggtcl - efnet
#eggdrop.support / #tcl - quakenet
#eggdrop - ircnet
Locked