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 my on_off script

Old posts that have not been replied to for several years.
Locked
B
Blade2
Voice
Posts: 10
Joined: Sat Feb 07, 2004 11:11 pm

Need help with my on_off script

Post by Blade2 »

I have a problem with my script:

Code: Select all

bind pub -|- .trigger status
set blub(active) "1"
set blub(mytime) "60"

proc status {nick host hand channel rest} {
global blub
set mytime [lindex $rest 1]
set wazup [lindex $rest 0]
if {[matchattr $hand T|T $chan]} {
 switch -- [string tolower $wazup] {
 	""    { putserv "NOTICE $nick :\002Syntax:\002 .trigger <on/off/time/show> \[time\]" }
 	"off" { set blub(active) 0 }
 	"on"  { set blub(active) 1 }
 	"time" { set blub(mytime) $mytime }
 	"show" { putserv "privmsg $channel :Trigger Infos: (Active: $blub(active)) (Timer: $blub(mytime) min)" }
 	}
 if {$blub(active) == 0} { putserv "privmsg $channel :Trigger if currentlly off"
 } else { putserv "privmsg $channel :Trigger is currentlly on" }
 if ($mytime == ""} {
 putserv "notice $nick :Bitte gib einen Timer an!" 
 } else { putserv "notice $nick :Timer wurde auf $mytime gesetzt." }
} else { putserv "notice $nick :\002Access denied\002" }
}
And as error I get that:
wrong # args: should be "proc name args body"
while executing
"proc status {nick host hand channel rest} {
global blub
set mytime [lindex $rest 1]
set wazup [lindex $rest 0]
if {[matchattr $hand T|T $chan]} {
swi..."
whats wrong ? which args are wrong ?
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Welll... this is a lesson in why it's important to properly format your code. You don't have a problem with the args, you really have a problem with matching braces. You also have one more problem, in one of your if statements you used a ( instead of {, which causes another brace mismatch.

Anyway, try formatting your code in a nice easy to read way and I'm sure you will see where the problems are!
Locked