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.

Using an SQL script - need some help

Old posts that have not been replied to for several years.
Locked
s
shanks
Voice
Posts: 19
Joined: Mon Aug 18, 2003 7:03 am

Using an SQL script - need some help

Post by shanks »

I asked around on a couple of eggdrop / tcl channels for which script to use, and I was advised to use either fbsql or mysqltcl

- note : i don't want this entire thing written for me - i am trying to learn tcl, but i've got no experience with databases and some other bits needed to do this : i want guiding through it, not told the solution :x

I'm not sure which of the two to use, and having looked at the associated websites, it didn't really help. so thats first issue:

a) which one to use? fbsql, mysqltcl, or a different one?

What i want to happen:
1.When the proc is called (from a !post <some message here> in a channel), the bot adds the post to the database with an 'id' number: ie it assigns the post a number between 01-99, so in the database table it's added: id nick post (i'm assuming they would go in a column each for example)

2. every 30 seconds, the 'top row' of the table in the database (ie the oldest post) is copied from the database, processed (the processing bit i can sort myself) and then deleted from the database.
- would doing this just free up the top row, or would it 'bump' every thing up? ie what was in the second row is now in the first after the original first gets deleted?...

3. the user who makes the post, OR an admin, can remove posts from the database - this is why I used the ID number - eg !remove 12 would remove the post assigned ID 12 by the bot when it is intiially added

thats the main things - there are other bits i'd like to add, but they aren't as important and should be much easier when i'm more familiar with using the sql script.

Any help any one can offer on any of the three parts is greatly appreciated.
Thanks

[Edit]
some things i forget: if there is a better way of doing what this, then please offer ideas - this is how i imagined it would work most effectively but there is undoubtedly a better way

perhaps adding a column for "time added" to the database, and keeping it sorted in that order, so it always has the oldest posts at the top, so they
are always the ones that get processed before new ones get put in?

I forgot to put at the top: I have been writing TCL for eggdrop for about a month and a half - i know the basics, but complex things will need a bit more explaining :x
s
shanks
Voice
Posts: 19
Joined: Mon Aug 18, 2003 7:03 am

Post by shanks »

sorry for bump, but can no one help me with this one?
Locked