| View previous topic :: View next topic |
| Author |
Message |
raider2k Op
Joined: 01 Jan 2008 Posts: 140
|
Posted: Sun Oct 24, 2010 4:07 pm Post subject: check from pool |
|
|
hi everyone
what Im after this time is some kind of pool containing the last 50 news titles I gathered from webpages, ordered by time, including their source website (and so on but those things are only details). so if a new title has been read from a website that it is matched against the last 50 entries of that pool to avoid duplicates on announcement bots in channels.
Im not so sure about how to build such things except for arrays (which are mysteries to me :/) and how to initiate such a list at bot startup etc.
Help and guidance appreciated  |
|
| Back to top |
|
 |
arfer Master

Joined: 26 Nov 2004 Posts: 436 Location: Manchester, UK
|
Posted: Tue Nov 09, 2010 7:55 pm Post subject: |
|
|
You won't get very far with your Tcl projects without mastering arrays, so I suggest you make an effort to understand them.
The only way you can initialise a list or array on startup is to use a text file to save the data. The data, should any exist, is read on startup and saved after any changes. _________________ I must have had nothing to do |
|
| Back to top |
|
 |
raider2k Op
Joined: 01 Jan 2008 Posts: 140
|
Posted: Wed Nov 10, 2010 2:59 am Post subject: |
|
|
would you be so kind to help me out with a small explanation/introduction please?  |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Wed Nov 10, 2010 10:39 am Post subject: |
|
|
| raider2k wrote: | would you be so kind to help me out with a small explanation/introduction please?  |
Until arfer replies, here are a few things you might like to read. They'll help to get you started.
Go here:
http://suninet.the-demon.de/
That whole site is very helpful.
But if you wish, you can scroll down to the section titled Variables, and find a sub-section there, - Using Arrays. .. and more.
You'll see, when you get there.
Go here:
http://www.tcl.tk/man/tcl8.5/TclCmd/array.htm
for the tcl array specific commands.
I wouldn't start here. Just have it bookmarked, because you will need it eventually.
You can do a lot with the info stored in arrays, with these commands.
For the part about reading from a file, the basics are here:
http://forum.egghelp.org/viewtopic.php?t=6885
Bear in mind, that the examples there are for reading from a file, into a list. But it is still good reading, and gives you the idea of how it is done.
(If you need to look up some of the commands used, to understand them - go back to: http://www.tcl.tk/man/tcl8.5/TclCmd/contents.htm
as that is the main page there )
I hope this little bit of background info, after you read it, gets you primed, so that you can take right off, with whatever comments arfer returns with.
 |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|