Java Code Examples for net.runelite.api.MenuEntry#setForceLeftClick()

The following examples show how to use net.runelite.api.MenuEntry#setForceLeftClick() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Healer.java    From ExternalPlugins with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void modifyEntry(OneClickPlugin plugin, MenuEntry event)
{
	if (plugin.getRoleText() == null ||
		plugin.getRoleText().isBlank() ||
		plugin.getRoleText().isEmpty() ||
		plugin.getRoleText().equals("- - -"))
	{
		return;
	}

	int id = ITEMS.getOrDefault(plugin.getRoleText(), -1);

	if (id == -1)
	{
		log.error("This shouldn't be possible, bad string: {}", plugin.getRoleText());
		return;
	}

	event.setOption("Use");
	event.setTarget("<col=ff9040>Food<col=ffffff> -> <col=ffff00>Penance Healer");
	event.setForceLeftClick(true);
}
 
Example 2
Source File: Runes.java    From ExternalPlugins with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void modifyEntry(OneClickPlugin plugin, MenuEntry event)
{
	if (plugin.findItem(id).getLeft() == -1)
	{
		return;
	}

	if (!plugin.isImbue() && plugin.isEnableImbue())
	{
		event.setOption("Use");
		event.setTarget("<col=ff9040>Magic Imbue<col=ffffff> -> <col=ffff>Yourself");
		event.setForceLeftClick(true);
		return;
	}
	event.setOption("Use");
	event.setTarget(rune);
	event.setForceLeftClick(true);
}
 
Example 3
Source File: Seeds.java    From ExternalPlugins with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void modifyEntry(OneClickPlugin plugin, MenuEntry event)
{
	if (plugin.findItem(SEED_SET).getLeft() == -1)
	{
		return;
	}

	event.setOption("Use");
	event.setTarget("<col=ff9040>Seed<col=ffffff> -> " + event.getTarget());
	event.setForceLeftClick(true);
}
 
Example 4
Source File: Spell.java    From ExternalPlugins with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void modifyEntry(OneClickPlugin plugin, MenuEntry event)
{
	if (plugin.getClickItem() == null)
	{
		return;
	}

	event.setOption("Cast");
	event.setTarget("<col=00ff00>" + spell + "</col>" + "<col=ffffff> -> " + plugin.getClickItem().getName());
	event.setForceLeftClick(true);
}
 
Example 5
Source File: DarkEssence.java    From ExternalPlugins with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void modifyEntry(OneClickPlugin plugin, MenuEntry event)
{
	if (plugin.findItem(ItemID.DARK_ESSENCE_BLOCK).getLeft() == -1)
	{
		return;
	}

	event.setTarget("<col=ff9040>Chisel<col=ffffff> -> <col=ff9040>Dark essence block");
	event.setForceLeftClick(true);
}
 
Example 6
Source File: Darts.java    From ExternalPlugins with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void modifyEntry(OneClickPlugin plugin, MenuEntry event)
{
	if (plugin.findItem(ItemID.FEATHER).getLeft() == -1)
	{
		return;
	}

	event.setTarget("<col=ff9040>Feather<col=ffffff> -> " + plugin.getTargetMap().get(event.getIdentifier()));
	event.setForceLeftClick(true);
}
 
Example 7
Source File: Herbtar.java    From ExternalPlugins with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void modifyEntry(OneClickPlugin plugin, MenuEntry event)
{
	if (plugin.findItem(ItemID.SWAMP_TAR).getLeft() == -1 ||
		plugin.findItem(ItemID.PESTLE_AND_MORTAR).getLeft() == -1
	)
	{
		return;
	}
	event.setTarget("<col=ff9040>Swamp tar<col=ffffff> -> " + plugin.getTargetMap().get(event.getIdentifier()));
	event.setForceLeftClick(true);
}
 
Example 8
Source File: Tiara.java    From ExternalPlugins with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void modifyEntry(OneClickPlugin plugin, MenuEntry event)
{
	if (plugin.findItem(ItemID.TIARA).getLeft() == -1)
	{
		return;
	}
	event.setOption("Use");
	event.setTarget("<col=ff9040>Tiara<col=ffffff> -> <col=ffff>Altar");
	event.setForceLeftClick(true);
}
 
Example 9
Source File: Birdhouses.java    From ExternalPlugins with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void modifyEntry(OneClickPlugin plugin, MenuEntry event)
{
	if (plugin.findItem(HOPS_SEED).getLeft() == -1)
	{
		return;
	}

	event.setOption("Use");
	event.setTarget("<col=ff9040>Hops seed<col=ffffff> -> " + plugin.getTargetMap().get(event.getIdentifier()));
	event.setOpcode(MenuOpcode.ITEM_USE_ON_GAME_OBJECT.getId());
	event.setForceLeftClick(true);
}
 
Example 10
Source File: Compost.java    From ExternalPlugins with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void modifyEntry(OneClickPlugin plugin, MenuEntry event)
{
	if (plugin.findItem(ItemID.COMPOST).getLeft() == -1)
	{
		return;
	}

	event.setTarget("<col=ff9040>Saltpetre<col=ffffff> -> " + plugin.getTargetMap().get(event.getIdentifier()));
	event.setForceLeftClick(true);
}
 
Example 11
Source File: Firemaking.java    From ExternalPlugins with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void modifyEntry(OneClickPlugin plugin, MenuEntry event)
{
	if (plugin.findItem(ItemID.TINDERBOX).getLeft() == -1)
	{
		return;
	}
	event.setTarget("<col=ff9040>Tinderbox<col=ffffff> -> " + plugin.getTargetMap().get(event.getIdentifier()));
	event.setForceLeftClick(true);
}
 
Example 12
Source File: Bones.java    From ExternalPlugins with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void modifyEntry(OneClickPlugin plugin, MenuEntry event)
{
	if (plugin.findItem(BONE_SET).getLeft() == -1)
	{
		return;
	}
	event.setOption("Use");
	event.setTarget("<col=ff9040>Bones<col=ffffff> -> " + event.getTarget());
	event.setForceLeftClick(true);
}
 
Example 13
Source File: Karambwans.java    From ExternalPlugins with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void modifyEntry(OneClickPlugin plugin, MenuEntry event)
{

	if (plugin.findItem(ItemID.RAW_KARAMBWAN).getLeft() == -1)
	{
		return;
	}
	event.setOption("Use");
	event.setTarget("<col=ff9040>Raw karambwan<col=ffffff> -> " + event.getTarget());
	event.setForceLeftClick(true);
}