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.

Looking for a script or module to create custom commands

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
p
pavel_kbc
Voice
Posts: 23
Joined: Thu Dec 28, 2006 2:17 pm

Post by pavel_kbc »

<ra1nb0w> [02:01] Tcl error [del:command]: missing "
<ra1nb0w> [02:01] Tcl error [del:command]: missing "


i fixed.

proc del:command {n u h c a} {
global allcommands
set cmd [string tolower [lindex [split $a] 0]]
if {![catch {unbind pub - $cmd added:$cmd}]} {
if {[set i [lsearch $allcommands -exact $cmd]] != -1} {
set allcommands [lreplace $allcommands $i $i]
}
puthelp "notice $n :Successfully remove \002$cmd\002 PUB command."
} {
puthelp "notice $n :Command \002$cmd\002 does not exist."
}
}
p
pavel_kbc
Voice
Posts: 23
Joined: Thu Dec 28, 2006 2:17 pm

Post by pavel_kbc »

when i type : <r00t-fck> !delcommand !testing
its show me error on partyline:
<ra1nb0w> [02:06] Tcl error [del:command]: bad option "! !testing": must be -all, -ascii, -decreasing, -dictionary, -exact, -glob, -increasing, -inline, -integer, -not, -real, -regexp, -sorted, or -start
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

I've edited the code, these errors shouldn't occur anymore.

I wonder why nobody reported this before, they request and don't use? :lol:
p
pavel_kbc
Voice
Posts: 23
Joined: Thu Dec 28, 2006 2:17 pm

Post by pavel_kbc »

Sir_fz
what about this one ?

<ra1nb0w> [02:06] Tcl error [del:command]: bad option "! !testing": must be -all, -ascii, -decreasing, -dictionary, -exact, -glob, -increasing, -inline, -integer, -not, -real, -regexp, -sorted, or -start
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

I already fixed that. The bug was in using the [lsearch] command, instead of using [lsearch <switch> <list> <element>] I was using [lsearch <list> <switch> <element>] which obviously is fixed in the code edit. Replace your old code with the new edited code and rehash your Eggdrop.
p
pavel_kbc
Voice
Posts: 23
Joined: Thu Dec 28, 2006 2:17 pm

Post by pavel_kbc »

Sir_Fz, can you please edit for me?

like this :)
<x-r00t-x> !addcommand !cmds notice %nick testing
-lord- Added add:!cmds command.
<x-r00t-x> !cmds x-r00t-x
-lord- testing

i mean i want to set command like "notice , privmsg, etc"
User avatar
piggy
Voice
Posts: 14
Joined: Sun Aug 21, 2005 11:51 am
Location: London

Post by piggy »

Sir_Fz: A couple of questions to this tcl code.

First Question

Is it possible to make it that you can either state the nickname you want the command to be issued for, or if no nickname is stated then it will do the command for the nickname that issued the command.

Example:

<nickname> !beer MrX
* bot brings MrX a nice cold beer

or

(nickname) !beer
*bot brings (nickname) a nice cold beer


Second question:

Is there any chance of making it that you can add a command that makes the bot select a diffrent item from a list of items and a diffrent action for the responses each time the comand is issued?

Example of the command that would be set:

(owner) !addcommand !beer (pulls out (a fine|an excellent|an excquisite|a tasty|a nicely refined) | pours a (pint|litre|quart) of (Guinness|Amstel|Castle|Jever|Yuengling Lager|Black Label|Piraat|Franziskaner Hefeweizen) for

(nickname) !beer
*bot pulls out an excellent litre of Yuengling Lager for (nickname)

next time the command is issued it responds diffrently.

(nickname) !beer MrX
*bot pours a pint of Guinness for MrX


Third Question

Is it possible to make it that you can add a command that is 2 words?

Example:

(owner) !addcommand !beer me

(nickname) !beer me
*bot pours a quart of Amstel for (nickname)


If this is asking for to much just tell me, i just thought it would be nice to add abit more functionalty to this tcl, make the bot have diffrent responses for the same command :)

Thanks for any help you can give on this :oops:
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

I will get back to this when I have more time (i.e. When the semester finishes and when the bullshit happening in the country comes to rest).
a
atreides
Voice
Posts: 17
Joined: Mon Nov 20, 2006 11:58 pm

Post by atreides »

I'm finding that your script stopped working after awhile. I tried restarting the eggdrop and it doesnt respond to !addcommand anymore. It worked fine but i tried to delete binds. Then, i set a new .txt file to add information to but this isnt working.
Post Reply