BeBot - An Anarchy Online and Age Of Conan chat automaton

Development => Coding and development discussion => Topic started by: onekman on May 16, 2008, 05:31:42 pm

Title: Conversion from link to text
Post by: onekman on May 16, 2008, 05:31:42 pm
Hi :)

small ?, in a custom module of mine, I'm using a parameter after a command. This parameter is the text of an item, which I use in a SQL query in a later process. But if I take the item from inventory and drops it right after the command, it show the text of the item as a link offcourse.

The big ? is then, is it possible to convert the link into pure text, cause when I use the linktext it wont find the item when I run the SQL query.

Weird thing is, if I save the linktext into the sql db, it looks like pure text, but if I choose to print out the parameter which are holding the linktext, it will show up as a link again.

this is probably a small problem, but I havent seen to figure out a solution yet.

thx in advance.

1k
Title: Re: Conversion from link to text
Post by: Blueeagle on May 17, 2008, 06:46:43 pm
The item references in AO are in the form '<a href="itemref://lowid/highid/ql">name of item</a>'

In the latest svn version of core('tools') (http://'http://svn.shadow-realm.org/index.py/BeBot/trunk/main/14_Tools.php?revision=1574') you will find two functions; parse_item() and is_item(). parse_item takes a sing itemreference and returns an associative array with both IDs, the ql and the name. is_item() checks to see if the argument passed to it is an item. There is also a make_item() that takes lowid, highid, ql and name and returns an item string.

I hope that helps.
Title: Re: Conversion from link to text
Post by: onekman on May 17, 2008, 07:43:39 pm
exactly what I needed :) thx alot


SimplePortal 2.3.7 © 2008-2024, SimplePortal