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.

help please

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

help please

Post by blake »

Can any one help me with this script ive put together this is the error msg i get when starting my eggdrop


16:11] Tcl error in file 'eggdrop.conf':
[16:11] wrong # args: should be "proc name args body"
while executing
"proc "msg:kill hand idx text" {
global botnick
set note [lrange $text 0 end]
if {[lindex $text 0] == ""} {
putidx $idx "USAGE kill <nick> <reaso..."
(file "scripts/cwmod.tcl" line 8)
invoked from within
"source scripts/cwmod.tcl"
(file "eggdrop.conf" line 1370)
[16:11] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)


Script

bind MSG o|o kill msg:kill
bind MSG o|o sajoin msg:sajoin
bind MSG o|o act msg:act
bind MSG o|o kick msg:kick
bind MSG o|o bankick msg:bankick
bind MSG o|o tempshun msg:tempshun

proc "msg:kill hand idx text" {
global botnick
set note [lrange $text 0 end]
if {[lindex $text 0] == ""} {
putidx $idx "USAGE kill <nick> <reason>"
return 1
}
putserv "kill $text (Kill Performed by $hand)"
putlog "$hand issued Kill Command: $text"
}

proc "msg:sajoin hand idx text" {
global botnick
set note [lrange $text 0 end]
if {[lindex $text 0] == ""} {
putidx $idx "USAGE sajoin <user> <chan>"
return 1
}
putserv "sajoin $text (Sajoin performed by $hand)"
putlog "$hand issued sajoin : $text"
}

proc "msg:act hand idx text" {
global botnick
set note [lrange $text 0 end]
if {[lindex $text 0] == ""} {
putidx $idx "USAGE act <chan> <text>"
return 1
}

}

proc "msg:kick hand idx text" {
global botnick
set note [lrange $text 0 end]
if {[lindex $text 0] == ""} {
putidx $idx "USAGE kick <chan> <nick> <reason>"
return 1
}

}

proc "msg:bankick hand idx text" {
global botnick
set note [lrange $text 0 end]
if {[lindex $text 0] == ""} {
putidx $idx "USAGE bankick <chan> <nick> <reason>"
return 1
}

}

proc "msg:tempshun hand idx text" {
global botnick
set note [lrange $text 0 end]
if {[lindex $text 0] == ""} {
putidx $idx "USAGE tempshun <nick> <reason>"
return 1
}
putserv "tempshun $text (tempshun Performed by $hand)"
putlog "$hand issued tempshun Command: $text"
}
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Your proc declarations are messed up...

Proper syntax is as follows:
proc <name> <argument list> <body>

Right now, you're combining the name and argument list into one single string.

The usual way of writing this is like this:

Code: Select all

proc myproc {arg1 arg2 arg3} {
 puts stdout "arg1: $arg1"
 puts stdout "arg2: $arg2"
 puts stdout "arg3: $arg3"
 return 0
}
NML_375
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

Post by blake »

nml375 wrote:Your proc declarations are messed up...

Proper syntax is as follows:
proc <name> <argument list> <body>

Right now, you're combining the name and argument list into one single string.

The usual way of writing this is like this:

Code: Select all

proc myproc {arg1 arg2 arg3} {
 puts stdout "arg1: $arg1"
 puts stdout "arg2: $arg2"
 puts stdout "arg3: $arg3"
 return 0
}

Anu chance you may be able to help me with it as i have no idea its a bit off code i found in another script ive just built on it but without no luck as you can see


many thanks
d
dj-zath
Op
Posts: 134
Joined: Sat Nov 15, 2008 6:49 am
Contact:

Post by dj-zath »

I didn't really troubleshoot your script, however, I did make "first-glance" corrections to your proc declorations..

if this script actually works, I donno...

To me, this looks more like mangled PHP than TCL!

good luck with it though.. I recommend that you study it, at least.. perhaps you can simply copy it back in.. and it will work for you!

Code: Select all


bind MSG o|o kill    msg:kill
bind MSG o|o sajoin  msg:sajoin
bind MSG o|o act     msg:act
bind MSG o|o kick    msg:kick
bind MSG o|o bankick msg:bankick
bind MSG o|o tempshun msg:tempshun

proc  msg:kill {hand idx text} {
global botnick
set note [lrange $text 0 end]
  if {[lindex $text 0] == ""} {
    putidx $idx "USAGE kill <nick> <reason>"
    return 1
  }
	putserv "kill $text (Kill Performed by $hand)"
	putlog "$hand issued Kill Command: $text"
}

proc msg:sajoin {hand idx text} {
global botnick
set note [lrange $text 0 end]
  if {[lindex $text 0] == ""} {
    putidx $idx "USAGE sajoin <user> <chan>"
    return 1
  }
	putserv "sajoin $text (Sajoin performed by $hand)"
	putlog "$hand issued sajoin : $text"
}

proc  msg:act  {hand idx text} {
global botnick
set note [lrange $text 0 end]
  if {[lindex $text 0] == ""} {
    putidx $idx "USAGE act <chan> <text>"
    return 1
  }

}

proc msg:kick {hand idx text} {
global botnick
set note [lrange $text 0 end]
  if {[lindex $text 0] == ""} {
    putidx $idx "USAGE kick <chan> <nick> <reason>"
    return 1
  }

}

proc msg:bankick {hand idx text} {
global botnick
set note [lrange $text 0 end]
  if {[lindex $text 0] == ""} {
    putidx $idx "USAGE bankick <chan> <nick> <reason>"
    return 1
  }

}

proc  msg:tempshun {hand idx text} {
global botnick
set note [lrange $text 0 end]
  if {[lindex $text 0] == ""} {
    putidx $idx "USAGE tempshun <nick> <reason>"
    return 1
  }
	putserv "tempshun $text (tempshun Performed by $hand)"
	putlog {"$hand issued tempshun Command: $text"}
(this is what happens when ppl confuse TCL with PHP!)

-DjZ-
:) :)
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

Post by blake »

I get this error on my bots partyline when i do /msg botsnick act #chan text

_-11:43am-_ <ChanGuardian> [06:43] Tcl error [msg:act]: wrong # args: should be "msg:act hand idx text"

The way you have corrected it is the way i had it origanaly
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

proc stuff {hand idx text} {

This is if you've bound to dcc chat, partyline which you haven't. So don't use the above, it's stupid.

This is what you use for a bind to a message

proc stuff {nick host hand text} {

Have a fun :P

Note: You also use list commands on strings throughout that script. Your not using the proper split on your lindex's or the proper split/join with your lranges. This will cause tcl errors the moment you try to use any special characters.
Last edited by speechles on Sat Feb 28, 2009 11:21 am, edited 1 time in total.
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

--pop--
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

Post by blake »

Lol this pretty much screws up my original idea :( tcl and me dont mix unfortunetly iv read the manuels and still dont understand it are their any manuels out their or such thing as tcl for dummies that give proper explanations seems most manuels are harder to understand then the actual scripting itself

I simply need a script that allows my chanops access to do things with my bot than actualy having them on the party line and most of the desired commands they need to be able to use are done via the party line my eggdrop is used as a moderation control programme allowing chanops to warn kick ban via the bot with an extra few privaledges

the act command is to act as the warning ie /msg botnick act #chan -Warning- $$1 You have been warned in #channel for advertising continue and you will be banned | /msg botnick act #wkblogs $me warned $$1 for advertising in #

kick /msg botnick act #chan $$1 You have been kicked from #chan for swearing continue and you will be banned | /msg botnick kick #chan $$1

This is pretty much how my warn kick ban script for mirc is set out but without the bot recognising these commands its pretty useless
Post Reply