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.

Text Help

Help for those learning Tcl or writing their own scripts.
Post Reply
A
Ace-T
Halfop
Posts: 82
Joined: Tue Aug 29, 2006 7:25 am

Text Help

Post by Ace-T »

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 ;)

thx
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
Post Reply