tomkay1985 wrote:
Since I am not the born programmer, but able to adapt things once I learned them by an example. I am looking for some help in coding a script.
This script should always react, if a specific person in the channel writes a specific word.
Code: Select all
# October 16, 2014
# http://forum.egghelp.org/viewtopic.php?t=19807
bind pubm - "#eggdrop *testword*" watch_word
proc watch_word {nick uhost handle chan text} {
if {"$nick" eq "some_nick_here"} {
putserv "privmsg $chan :$text"
}
}
Play around with this. It is just for demonstration. Perhaps you can
glean something from it.
You need to edit the channel name, the text to watch for (in this example: *testword*) and the nick to watch for (in this example: some_nick_here )
It will watch one channel, for posts that contain the text you configure.
If a post contains that text, and if it is from the nick you configure, it will then simply repeat the post that contained that text.
Reference:
http://www.eggheads.org/support/egghtml ... mands.html
and text search it for:
bind pubm
and read the short description there.
For general TCL commands, reference:
http://www.tcl.tk/man/tcl8.5/TclCmd/contents.htm
You can find the
if
command there.
This is a very simple example script. I hope it strikes you as such.
The point: It is worth your time to learn some basic TCL scripting for Eggdrops.
This:
http://suninet.the-demon.de/
is a nice little course that you might like to do.
It really helps to get you off the ground.
Then from the same line of this word, i need to extract some data and then write this information in my database which already exists.
Is there any script available already which is able to parse bascially like what I need?
Don't know. Need more info from you. The script above will detect posts that you want. After that, you would have to clarify what "some data" is, and you would have to describe this database if we are to proceed further.
I hope this helps.
Do spend some time perusing the links that I've given you. They really help.