Items name format

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Stionowl1943
Posts: 35
Joined: Thu Jun 04, 2015 11:57 am

Items name format

#1 Post by Stionowl1943 » Wed Jun 24, 2015 5:28 am

How to format name o LinkItem?
I receive
|Hitem:3185c|h|cffffffff[Mana Stone Tier 5]|r|h
but i want receive only 'Mana Stone Tier 5'
print(string.format( "|Hitem:%x|h|c%x[%s]|r|h", self.Id, self.Color or 0, self.Name ))
doesnt work because i receive errors.
Last edited by Stionowl1943 on Wed Jun 24, 2015 9:15 am, edited 1 time in total.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Items name format

#2 Post by lisa » Wed Jun 24, 2015 6:21 am

Rock will no doubt explain this better than I can.

Code: Select all

print(string.format( "|Hitem:%x|h|c%x[%s]|r|h", self.Id, self.Color or 0, self.Name ))
That code puts the bots information that it retrieved from memory into a link format, so no it won't remove the item name from a link, it does the entire opposite.

I am just going to assume from the little information you gave that you have the "link" from a log file or such that got it from the text in game.
If so then you will need to use some string.find and string.sub to be able to do what you want.
Some info on string stuff here http://lua-users.org/wiki/StringLibraryTutorial

If on the other hand you are just trying to print info from the bot then use item.Name instead of item.ItemLink
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

Stionowl1943
Posts: 35
Joined: Thu Jun 04, 2015 11:57 am

Re: Items name format

#3 Post by Stionowl1943 » Wed Jun 24, 2015 9:14 am

Ok, i found soultion!

Code: Select all

local type, data, text = RoMScript('ParseHyperlink("'..itemLink..'")')
http://runesofmagic.gamepedia.com/API:ParseHyperlink

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests