ParseHyperlink - Error (Solutions?)

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Post Reply
Message
Author
Buh
Posts: 45
Joined: Thu Dec 10, 2015 12:39 am

ParseHyperlink - Error (Solutions?)

#1 Post by Buh » Thu Nov 24, 2016 11:16 am

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

User avatar
Bill D Cat
Posts: 555
Joined: Sat Aug 10, 2013 8:13 pm
Location: Deep in the Heart of Texas

Re: ParseHyperlink - Error (Solutions?)

#2 Post by Bill D Cat » Thu Nov 24, 2016 11:23 am

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.

Buh
Posts: 45
Joined: Thu Dec 10, 2015 12:39 am

Re: ParseHyperlink - Error (Solutions?)

#3 Post by Buh » Thu Nov 24, 2016 12:02 pm

Hey

Thanks for your answer

I will try it, thanks!

Buh
Posts: 45
Joined: Thu Dec 10, 2015 12:39 am

Re: ParseHyperlink - Error (Solutions?)

#4 Post by Buh » Thu Nov 24, 2016 12:33 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests