Maybe someone can help me with this?
When users type in wrong or command which does not exist I would like eggdrop to respond with custom text - something like "please type in !help for available commands"
I think he means external commands rather than dcc commands.
When text is sent to a channel the eggdrop evaluates it and checks what it see's on channel to what it has listed in its bind list. If it doesn't exist in the bind list it ignores the text untill the next set of text it see's so any potential text in a channel could be considered as a trigger it doesn't have to start with a !.
The way it could be done is to write a script that executes when it sees a '!' at the start of a line. Have a list that contains all of the binds that exist already. If a trigger is seen that already exists return the procedure else if its not in the list then print use !help.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
awyeah wrote:A more efficient solution would be a structure like this, for your proc:
You can use bind pubm with this and match [lindex $text 0] for the trigger you want in this case, so it will be binded to "*".
if { ..... } {
#do help1
}
elseif { .... } {
#do help2
}
elseif { .... } {
#do help3
}
elseif { .... } {
#do help4
}
else { PUT INVALID COMMAND IN HERE
}
If i understand what you are saying you want him to add an if statement for every bind he has?
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
bind pubm - "% !*" pubm:check
proc pubm:check { n u h c t } {
if {[lsearch -exact $::bl [lindex [split $t] 0]]!=-1} { return }
putserv "PRIVMSG $c :please type in !help for available commands"
}
proc mbl {} {
set ::bl {}
foreach b [binds pub*] {lappend ::bl [lindex [lindex $b 2] end]}
}
mbl
here is code for doom's suggestion. didn't test, but it should work. make sure mbl is executed after all your binds.
spock wrote:
make sure mbl is executed after all your binds.
Just to clarify what spock means by that is make sure that script is the very last one on your source scripts/script.tcl list at the bottom of your config file
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born