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.

Need help: TCL & MySql

Old posts that have not been replied to for several years.
Locked
v
valki

Need help: TCL & MySql

Post by valki »

Hi guys!

/me is a complete noob with tcl and eggdrop - I am only fit on php, C, perl.

What am I looking for?
A tcl-script which lets the bot react on keywords with predefined phrases

-> I am sure that this kind of script is already avaliable - just tell me WHICH one is good and where to get it :-)

2nd Question:
It would be great if the bot could "lookup" in a MySql - Database and tell some recordsets from there if a keyword has been told in the channel.

Is this possible?

Thx for suggestions!
Valki
I
Iridium

Post by Iridium »

Code: Select all

bind pubm - "%<word>%" mytrigger

proc mytrigger {nick host hand chan args} {
  putserv "PRIVMSG $chan :Leave the <word> alone!"
}
Above is a really simple script that would react whenever <word> was said. Really it should be simple enough to change <word> to whatever you want, and change the text after the : to make it say something different.

put the code above in a .tcl file, then put "source scripts/whatever.tcl" in your *.conf file, then rehash your bot.

2)
Okay, mysql is getting a little more tricky. I've been searching for this sort of thing myself with no luck. For a start, (in the cases I've come across) you need MySQL installed locally, and you can only connect to local databases (my problem as it wasn't my system, I couldn't have MySQL installed locally and I needed to access an external database). If you're still here, then you need to find a module or a tcl addon that will add some MySQL commands, and follow the instructions included.

If you want statistics, I can suggest the stats module, you can find an example of its use here
v
valki

Post by valki »

Thx :-)

The simple "bind" stuff is logical - but i am looking for a more comfortable way to maintain by some channel moderators...
Even a warning system would be nice - like "Hello NICK, bla bla say "word" again and u will be banned for 1 hour!"
Any good script known supporting all this?


And for the mysql: I installed the mytcl C-thingy but its quite buggy...
I will try and try - but time is my problem :-)

Greetz, Valki
I
Iridium

Post by Iridium »

Hmm, I'm not sure quite what you mean by
The simple "bind" stuff is logical - but i am looking for a more comfortable way to maintain by some channel moderators...
v
valki

Post by valki »

hehe... sorry - but english is not my motherlanguage - ill try it again! :-)

I know about the way how i can "bind" special keywords in the .conf File of eggdrop or - alternatively - in a linked tcl - file.
The function / procedure u mention in your first post is clear - it works... i know - BUT:

Those channel-ops / botmasters who want to add a new "badword" to the script would need to have access to edit the .conf or tclfile... in your example they would need to edit the somescript.tcl and add a new "bind" - line to it.

BETTER would be if this "addbadword" - function would be interactive so that botmasters can add / remove badwords WITHOUT editing any files on the server... just via commands.

As u can see there is a "bigger" script needed with the impelementation of all theese "admin-commands" - and i am sure its no problem to add more functionality to it like counting the number of warnings which are sent to the "baduser" before he is banned for - lets say - 15 mins....

:-)
I
Iridium

Post by Iridium »

Hmm. You can do it the easy way or the hard way.

easy: store the bad words in a global list variable. Bad words list gets reset every time the bot restarts unless it is in the eggdrop.conf

hard: store the bad words in a file and add/remove to it

option #2: Store them in an xtra for your user. Just a thought

I'm sorry but I don't have the time right now to do this.
v
valki

Post by valki »

k.. u got the idea :-)

Basically I think that this kind of script id already around... thats why i didnt ask around to write it for me but ask if anybody just knows one which has theese features...

I was looking through several script-archives ... but they all have the same problem: too many script and no descriptions!
:-)

So anybody else around who KNOWs such a script? :-)
I
Iridium

Post by Iridium »

I think I've seen a badwords.tcl that might do what you want to do.
Locked