| View previous topic :: View next topic |
| Author |
Message |
alisetan Voice
Joined: 21 May 2006 Posts: 36
|
Posted: Wed Aug 02, 2006 12:36 am Post subject: error |
|
|
| 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 |
|
 |
Vexor Voice

Joined: 21 Jul 2006 Posts: 18 Location: Washington Court House
|
Posted: Wed Aug 02, 2006 5:52 am Post subject: |
|
|
| 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 |
|
 |
alisetan Voice
Joined: 21 May 2006 Posts: 36
|
Posted: Wed Aug 02, 2006 6:07 am Post subject: |
|
|
| 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 |
|
 |
Vexor Voice

Joined: 21 Jul 2006 Posts: 18 Location: Washington Court House
|
Posted: Wed Aug 02, 2006 4:32 pm Post subject: |
|
|
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 |
|
 |
|