Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to get Rolled item as WowItem?

Featured Replies

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

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 by Ordush

  • Author

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.

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 by Ordush

  • Author

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#.

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 by Ordush

  • 1 year later...

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

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, 

image.png.f50b4912e982c6d512da2dedfce6634c.png 

Really good job, but i only needed wowitem from itemlink for modification "Butler" plugin. Thanks anyway 🙂

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.