egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

check from pool

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
raider2k
Op


Joined: 01 Jan 2008
Posts: 140

PostPosted: Sun Oct 24, 2010 4:07 pm    Post subject: check from pool Reply with quote

hi everyone Wink

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 Smile
Back to top
View user's profile Send private message
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Tue Nov 09, 2010 7:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
raider2k
Op


Joined: 01 Jan 2008
Posts: 140

PostPosted: Wed Nov 10, 2010 2:59 am    Post subject: Reply with quote

would you be so kind to help me out with a small explanation/introduction please? Very Happy
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Wed Nov 10, 2010 10:39 am    Post subject: Reply with quote

raider2k wrote:
would you be so kind to help me out with a small explanation/introduction please? Very Happy


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.
Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber