egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

error

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
alisetan
Voice


Joined: 21 May 2006
Posts: 36

PostPosted: Wed Aug 02, 2006 12:36 am    Post subject: error Reply with quote

Code:
set tr "!"
set cc "!"

set nopub "#q3f"

bind pub -|- ${tr}onair login
bind pub -|- ${tr}dj djs
bind pub -|- ${tr}offair logout
bind pub -|- ${tr}cleardj resetdj
bind pub -|- ${tr}request req

set qversion "1.5"

proc login {nick host hand chan arg} 
global url pathqstat cc nopub dj
if {[lsearch -exact $nopub [string tolower $chan]] >= 0} {return 0}
return 0
}
set dj "$nick"
putserv "NOTICE $nick :You Are Now On Air When U Are Done Please Sign Off"
}

proc djs {nick host hand chan arg} 
global url pathqstat cc nopub dj
if {[lsearch -exact $nopub [string tolower $chan]] >= 0} {return 0}
if {$arg == ""} {
putserv "PRIVMSG #perlis :4,1* 14,1 »15,1»14,1»4,1 Current DJ : $dj 14,1 »15,1»14,1» 4,1*"
return 0
}

proc logout {nick host hand chan arg} {
global url pathqstat cc nopub dj
if {[lsearch -exact $nopub [string tolower $chan]] >= 0} {return 0}
if {$nick == "$dj"} {
return 0
}
set dj "None"
putserv "NOTICE $nick :You Are Now Off Air When U Are Done Please Sign Off"
}

proc resetdj {nick host hand chan arg} 
global url pathqstat cc nopub dj
if {[lsearch -exact $nopub [string tolower $chan]] >= 0} {return 0}
return 0
}
set dj "None"
putserv "NOTICE $nick :The Dj Has Ben Reset"
}
proc req {nick host hand chan arg} {
   global url pathqstat cc nopub dj
        if ($dj == None)
   if {[lsearch -exact $nopub [string tolower $chan]] >= 0} {return 0}
   if {$arg == ""} {
   putserv "notice $nick :Usage: ${cc}request <exact Songname>"
return 0
}
set songname "$arg"
putserv "PRIVMSG $dj :$nick requested $songname"
putserv "NOTICE $nick :You have request $songname. Please do not re-request this."
}



what error for this...

wrong # args: should be "proc name args body"
while executing
"proc login {nick host hand chan arg} "
(file "scripts/newtcl.tcl" line 14)

Please use [code] tags next time.
Back to top
View user's profile Send private message
Vexor
Voice


Joined: 21 Jul 2006
Posts: 18
Location: Washington Court House

PostPosted: Wed Aug 02, 2006 5:52 am    Post subject: Reply with quote

Code:

proc login {nick host hand chan arg}
global url pathqstat cc nopub dj
if {[lsearch -exact $nopub [string tolower $chan]] >= 0} {return 0}
return 0
}


Looks to me like you've forgotten a few {}'s. Perhaps its not needed but I've always written procs as
Code:

proc name { args } { do whatever }

_________________
"just the usual suggestion, RTFM" --demond
Back to top
View user's profile Send private message Visit poster's website
alisetan
Voice


Joined: 21 May 2006
Posts: 36

PostPosted: Wed Aug 02, 2006 6:07 am    Post subject: Reply with quote

Vexor wrote:
Code:

proc login {nick host hand chan arg}
global url pathqstat cc nopub dj
if {[lsearch -exact $nopub [string tolower $chan]] >= 0} {return 0}
return 0
}


Looks to me like you've forgotten a few {}'s. Perhaps its not needed but I've always written procs as
Code:

proc name { args } { do whatever }



how to solve it?? i'm noob... new in tcl.. help me
Back to top
View user's profile Send private message
Vexor
Voice


Joined: 21 Jul 2006
Posts: 18
Location: Washington Court House

PostPosted: Wed Aug 02, 2006 4:32 pm    Post subject: Reply with quote

Just make sure your body statements are enclosed in {}

such as...

Code:


bind pub - howdy do_bind_speech

proc do_bind_speech { nick host hand chan text } {

          putserv "privmsg $chan :Howdy to you, $nick"
}

       

_________________
"just the usual suggestion, RTFM" --demond
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber