Losmy 1 Posted October 28, 2019 Share Posted October 28, 2019 Hi! I'm trying to create a plugin that automaticly needs on the rolled item if the bot needs it otherwise greeds/passes/DE. But I've got problem that I can't always find the ID from the item. Right now I'm getting the item's name from "GetLootRollItemInfo" and I then I use this code to get it as a WowItem. WoWItem item = ObjectManager.GetObjectWoWItem().FirstOrDefault(i => i.Entry == ItemsManager.GetIdByName(name)); This does not always work, I sometimes get the ID 0. This would also not work on items with random enchants because they all have same item ID but not same stats. I have seen there is itemlink aswell but I can't find much information about it, GetLootRollItemLink. If you have any piece of advice how to get the rolled item as a wowItem it would be great because then I don't have to change any of the other code. Best Regards A.Z Link to comment https://wrobot.eu/forums/topic/11681-how-to-get-rolled-item-as-wowitem/ Share on other sites More sharing options...
Droidz 2742 Posted October 29, 2019 Share Posted October 29, 2019 Hello, you play in what version? Link to comment https://wrobot.eu/forums/topic/11681-how-to-get-rolled-item-as-wowitem/#findComment-56063 Share on other sites More sharing options...
Losmy 1 Posted October 29, 2019 Author Share Posted October 29, 2019 Wrath, 3.3.5 Link to comment https://wrobot.eu/forums/topic/11681-how-to-get-rolled-item-as-wowitem/#findComment-56064 Share on other sites More sharing options...
Ordush 185 Posted October 29, 2019 Share Posted October 29, 2019 (edited) 17 hours ago, Losmy said: Hi! I'm trying to create a plugin that automaticly needs on the rolled item if the bot needs it otherwise greeds/passes/DE. But I've got problem that I can't always find the ID from the item. Right now I'm getting the item's name from "GetLootRollItemInfo" and I then I use this code to get it as a WowItem. WoWItem item = ObjectManager.GetObjectWoWItem().FirstOrDefault(i => i.Entry == ItemsManager.GetIdByName(name)); This does not always work, I sometimes get the ID 0. This would also not work on items with random enchants because they all have same item ID but not same stats. I have seen there is itemlink aswell but I can't find much information about it, GetLootRollItemLink. If you have any piece of advice how to get the rolled item as a wowItem it would be great because then I don't have to change any of the other code. Best Regards A.Z Do you need to roll based on ID? Sounds a bit like double work to first convert to ID? Can't you just make the roll based on item name? Another solution is to get itemlink from the frame itself. You can use framestack to figure out what frame it is, then you can both get stats as well as item id from that. ? Edit: I obviously didn't mean itemlink, I meant tooltip lol Edited October 29, 2019 by Ordush Link to comment https://wrobot.eu/forums/topic/11681-how-to-get-rolled-item-as-wowitem/#findComment-56065 Share on other sites More sharing options...
Losmy 1 Posted October 29, 2019 Author Share Posted October 29, 2019 I'm using weightstats in deciding if the item is needed or not before needing/passing on the item. Problem is when I get items such as "....of the hawk,bear,tiger " etc because they all have the same item ID but different "random enchants". It's surely an idea to get the stats from the frame itself, I'll have a look! Thanks! Edit: I missunderstood your first part I believe. The reason I want to make it into an WowItem class is because I can skip modifying parts of the code I already made. Link to comment https://wrobot.eu/forums/topic/11681-how-to-get-rolled-item-as-wowitem/#findComment-56066 Share on other sites More sharing options...
Ordush 185 Posted October 29, 2019 Share Posted October 29, 2019 (edited) 3 minutes ago, Losmy said: I'm using weightstats in deciding if the item is needed or not before needing/passing on the item. Problem is when I get items such as "....of the hawk,bear,tiger " etc because they all have the same item ID but different "random enchants". It's surely an idea to get the stats from the frame itself, I'll have a look! Thanks! I understand, are you only able to roll based on ID? Because if not, then the 0 ID bug, can be avoided simply by using name. ? You could make a table with the item name and stats, if the stats meets your satisfactory, then roll need on the item otherwise greed/disenchant. Edit: Tables (Lua) is about the same as 'arrays' in c#. ? Edited October 29, 2019 by Ordush Link to comment https://wrobot.eu/forums/topic/11681-how-to-get-rolled-item-as-wowitem/#findComment-56067 Share on other sites More sharing options...
Losmy 1 Posted October 29, 2019 Author Share Posted October 29, 2019 Where would I find/create these tables? It would require me to download the entire item database and keep in a table? Right now the code only takes the argument WowItem which is a problem since I don't know how to create a WowItem from the name or ID. Thank you, my lua knowledge is very limited to only the wow lua api right now, only been doing c#. Link to comment https://wrobot.eu/forums/topic/11681-how-to-get-rolled-item-as-wowitem/#findComment-56069 Share on other sites More sharing options...
Ordush 185 Posted October 29, 2019 Share Posted October 29, 2019 (edited) 25 minutes ago, Losmy said: Where would I find/create these tables? It would require me to download the entire item database and keep in a table? Right now the code only takes the argument WowItem which is a problem since I don't know how to create a WowItem from the name or ID. Thank you, my lua knowledge is very limited to only the wow lua api right now, only been doing c#. You create these tables yourself, and no you don't need to download anything. You actually might not even need to make a table, it was just some way for you to keep your stuff sorted. Get the stats from the tooltip, compare these stats with your weight, if the stats comes out as something you'd roll on, then roll on that item. Do you HAVE to make it an wow item? Can you not skip this alltogether? I personally haven't used wrobot to roll. Edited October 29, 2019 by Ordush Link to comment https://wrobot.eu/forums/topic/11681-how-to-get-rolled-item-as-wowitem/#findComment-56070 Share on other sites More sharing options...
happiness7 3 Posted October 11, 2021 Share Posted October 11, 2021 How i can create WoWItem from itemlink? GetLootRollItemLink. I need code like: WoWItem itemRollLink = Lua.LuaDoString<string>("local link = GetLootRollItemLink("+args[0]+"); return link"); Please Link to comment https://wrobot.eu/forums/topic/11681-how-to-get-rolled-item-as-wowitem/#findComment-63799 Share on other sites More sharing options...
happiness7 3 Posted October 12, 2021 Share Posted October 12, 2021 3 hours ago, Sye24 said: @happiness7 i went a head and pushed a update to the github of the AutoRoll code, i made it to where you can print out the main stats from the item. here whats done so far, ill work on it more when i get time. next update : ima clean it up, the code looks like crap but after work and packing etc. this is what i got done so far, Really good job, but i only needed wowitem from itemlink for modification "Butler" plugin. Thanks anyway 🙂 Link to comment https://wrobot.eu/forums/topic/11681-how-to-get-rolled-item-as-wowitem/#findComment-63812 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now