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 

Text Help

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


Joined: 29 Aug 2006
Posts: 82

PostPosted: Tue May 15, 2007 10:51 pm    Post subject: Text Help Reply with quote

looking for some way for my code to strip the last words after -

so the bot says GAME.complete.by-WPI

so what i need to do is get it to take that PI and insert it into a table on my database

can this be achived through something like this

set player [lindex $result 0];

i know thats not gonna work above Wink

thx
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed May 16, 2007 10:10 am    Post subject: Reply with quote

If the piece of information is always at a given offset, you could use "string range"; if the string is a character-delimited list, you could use "split" to convert it to a tcl-list which then is suitable for commands such as lindex, lrange, and so forth. A third option would be to use regular expressions to use pattern-search to retrieve the value.

Once you've retreaved the piece of information, how you store it in your database would be a matter on what kind of data-storage you use, how you interface with it (any modules/plugins?), etc.
_________________
NML_375, idling at #eggdrop@IrcNET
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