| View previous topic :: View next topic |
| Author |
Message |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Fri Feb 27, 2009 5:19 pm Post subject: help please |
|
|
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
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"
} _________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Fri Feb 27, 2009 5:36 pm Post subject: |
|
|
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: | proc myproc {arg1 arg2 arg3} {
puts stdout "arg1: $arg1"
puts stdout "arg2: $arg2"
puts stdout "arg3: $arg3"
return 0
}
|
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Sat Feb 28, 2009 4:49 am Post subject: |
|
|
| 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: | 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 _________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
dj-zath Op
Joined: 15 Nov 2008 Posts: 134
|
Posted: Sat Feb 28, 2009 7:32 am Post subject: |
|
|
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: |
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-
 |
|
| Back to top |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Sat Feb 28, 2009 7:45 am Post subject: |
|
|
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 _________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sat Feb 28, 2009 11:18 am Post subject: |
|
|
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
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. _________________ speechles' eggdrop tcl archive
Last edited by speechles on Sat Feb 28, 2009 11:21 am; edited 1 time in total |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
|
| Back to top |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Sat Feb 28, 2009 12:53 pm Post subject: |
|
|
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 _________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
|