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.

sending a shift+right-click to an inventory-item

Featured Replies

Hey i'm trying to write a plugin that will open crates and clams while fishing.
Sadly i have no idea how to send a shift+right-click to an item.
Does anyone have an idea how to do that ?

this does not work:

wManager.Wow.Helpers.ItemsManager.UseItem(item.Name);
Lua.LuaDoString("LootButton1:Click()");

this might work but i don't know how to continue:

foreach (WoWItem item in items) 
	{
		if (item.Name.Equals("Heavy Crate") || item.Name.Equals("Big-mouth Clam"))
		{
			wManager.Wow.Helpers.Bag.OpenAllBags();
			List<int> bagAndSlot = wManager.Wow.Helpers.Bag.GetItemContainerBagIdAndSlot(item.Name);
			...
			x=?
			y=?
			robotManager.Helpful.Keyboard.DownKey(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, System.Windows.Forms.Keys.Shift);
			robotManager.Helpful.Mouse.ClickRight();
			robotManager.Helpful.Keyboard.UpKey(wManager.Wow.Memory.WowMemory.Memory.WindowHandle, System.Windows.Forms.Keys.Shift);
			wManager.Wow.Helpers.Bag.CloseAllBags();
		}

	}

 

Hello, since you are using vanilla i assume the method doesn't work correctly but i'm not sure("DoString" is obfuscated).

You also can't use the "/use <item>" it wasn't implemented on vanilla. So you need to iterate the items in your bag with lua.

I tried this on 3.3.5a but since the used api functions is also present on vanilla, it should also work:

    public void UseItemByName(string name, bool lootItem = true)
    {
        if (lootItem)
        {
            Task.Run(async delegate
            {
                robotManager.Helpful.Keyboard.DownKey(wManager.Wow.Memory.WowMemory.Memory.WindowHandle,
                    System.Windows.Forms.Keys.ShiftKey);
                await Task.Delay(2000);
                robotManager.Helpful.Keyboard.UpKey(wManager.Wow.Memory.WowMemory.Memory.WindowHandle,
                    System.Windows.Forms.Keys.ShiftKey);
            });
        }
        wManager.Wow.Helpers.Lua.LuaDoString(
            @"
                            for b=0,4 do
                                for s=1,GetContainerNumSlots(b) do
                                    if (string.find(tostring(GetContainerItemLink(b,s) or """"), """+wManager.Wow.Helpers.ItemsManager.GetIdByName(name)+@""" )) then
                                        UseContainerItem(b,s, onSelf);
                                    end
                                end
                            end
                            "
        );
    }

Usage:

        UseItemByName("Hearthstone", false);

or

        UseItemByName("Heavy Crate", true);

 

Edited by reapler
altered method

  • Author

Hey thanks for the help.

I discovered 2 weird problems:
First the lua does not accept the item name "Big-mouth Clam", if you just write "Clam" or "Big" it will work. Seems to be a problem with the "-", but i don't know how to escape it :(
Second the keydown function seems to have no effect. Although if you hold down the shift key manually it works fine and will loot the clams.

edit:
hm weird. tried some things to get the item name with the "-" working but WoW itself seems to have a problem with it's own item name.

I've changed the keys to press & the string to search. It should work now. The requirements to use it successfully are:

Wow.exe on foreground(it can reset the key on window switch) and the item must be in cache.

Edited by reapler

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.