Page 1 of 1

ParseHyperlink - Error (Solutions?)

Posted: Thu Nov 24, 2016 11:16 am
by Buh
Hey

I want to program a bot for buying arcanium stats and read those items for its stats.
i got this code here, for reading the Items in the whole Bagpack

Code: Select all

	for i = 1,180 do
		local SlotID,_,ItemName = GetBagItemInfo(i)
		if ItemName ~= "" then
			local _, Data = ParseHyperlink(GetBagItemLink(SlotID,false))
			local List = {}
			for Number in Data:gmatch("%x+") do
				table.insert(List,tostring(Number))
			end
			DEFAULT_CHAT_FRAME:AddMessage("Suche nach Stats auf "..ItemName,0,1,0)
			for j = 4,6 do
				if #List[j] == 4 then
					DEFAULT_CHAT_FRAME:AddMessage("\t"..TEXT("Sys"..tonumber("7"..List[j],16).."_name"),1,1,0)
				elseif #List[j] == 8 then
					for k = 1,2 do
						local v = List[j]:sub((k-1)*4+1,k*4)
						DEFAULT_CHAT_FRAME:AddMessage("\t"..TEXT("Sys"..tonumber("7"..v,16).."_name"),1,1,0)
					end
				end
			end 
		end	
	end
I converted this ingame macro into a .lua script here (with a big RoMScript("..") inscruction xD ) but i get always the error, that "ParseHyperlink " is not supported / dont work

Can someone help me at this Point?

Thanks for all answers

Greetings

Buh

Re: ParseHyperlink - Error (Solutions?)

Posted: Thu Nov 24, 2016 11:23 am
by Bill D Cat
If you are going to rewrite it all in code the bot can execute, you may need to do a little extra work. Since the ParseHyperlink command is a RoM function, I think you need to use the command inside a RoMCode() call from the bot.
Give this a try and see if it works.

Code: Select all

local _, Data = RoMCode("ParseHyperlink(GetBagItemLink(SlotID,false))")
Does the command work from a RoM macro? If it works in the game macro, it should be usable from the bot with the right adjustments to the code.

Re: ParseHyperlink - Error (Solutions?)

Posted: Thu Nov 24, 2016 12:02 pm
by Buh
Hey

Thanks for your answer

I will try it, thanks!

Re: ParseHyperlink - Error (Solutions?)

Posted: Thu Nov 24, 2016 12:33 pm
by Buh
Hey

I tried it and it works but another error occurs..

The global function TEXT(...) is giving me this error: "attempt to call global TEXT a nil value..

Any ideas?

Greetings