iutils: initial push, fixes some changes due to latest update. plugins that don't use inventory items should work.

This commit is contained in:
illumineawake 2022-04-21 17:26:25 +10:00
parent 56c36374e4
commit d6f1667955
17 changed files with 17 additions and 17 deletions

View File

@ -25,7 +25,7 @@
*/
object ProjectVersions {
const val openosrsVersion = "4.23.0"
const val openosrsVersion = "4.24.1"
const val apiVersion = "^1.0.0"
}

View File

@ -239,7 +239,7 @@ public class iMagicCasterPlugin extends Plugin {
private void castSpell() {
switch (castType.getName()) {
case "Single cast":
targetMenu = new LegacyMenuEntry("Cast", "", targetNPC.getIndex(), MenuAction.SPELL_CAST_ON_NPC.getId(),
targetMenu = new LegacyMenuEntry("Cast", "", targetNPC.getIndex(), MenuAction.WIDGET_TARGET_ON_NPC.getId(),
0, 0, false);
utils.oneClickCastSpell(selectedSpell.getSpell(), targetMenu, targetNPC.getConvexHull().getBounds(), sleepDelay());
timeout = 4 + tickDelay();
@ -251,12 +251,12 @@ public class iMagicCasterPlugin extends Plugin {
timeout = 10 + tickDelay();
return;
case "High Alchemy":
targetMenu = new LegacyMenuEntry("Cast", "", targetItem.getId(), MenuAction.ITEM_USE_ON_WIDGET.getId(), targetItem.getIndex(), 9764864, true);
targetMenu = new LegacyMenuEntry("Cast", "", targetItem.getId(), MenuAction.WIDGET_USE_ON_ITEM.getId(), targetItem.getIndex(), 9764864, true);
timeout = 5 + tickDelay();
utils.oneClickCastSpell(WidgetInfo.SPELL_HIGH_LEVEL_ALCHEMY, targetMenu, targetItem.getCanvasBounds().getBounds(), sleepDelay());
return;
case "Tele Grab":
targetMenu = new LegacyMenuEntry("Cast", "", groundItem.getId(), MenuAction.SPELL_CAST_ON_GROUND_ITEM.getId(), groundItem.getTile().getSceneLocation().getX(), groundItem.getTile().getSceneLocation().getY(), true);
targetMenu = new LegacyMenuEntry("Cast", "", groundItem.getId(), MenuAction.WIDGET_TARGET_ON_GROUND_ITEM.getId(), groundItem.getTile().getSceneLocation().getX(), groundItem.getTile().getSceneLocation().getY(), true);
timeout = 5 + tickDelay();
utils.oneClickCastSpell(WidgetInfo.SPELL_TELEKINETIC_GRAB, targetMenu, new Rectangle(0, 0, 0, 0), sleepDelay());
return;

View File

@ -96,7 +96,7 @@ public class iMenuDebuggerPlugin extends Plugin {
utils.sendGameMessage("MenuAction value: " + event.getMenuAction());
utils.sendGameMessage("ActionParam value: " + event.getActionParam());
utils.sendGameMessage("WidgetId value: " + event.getWidgetId());
utils.sendGameMessage("selectedItemIndex value: " + event.getSelectedItemIndex());
// utils.sendGameMessage("selectedItemIndex value: " + event.getSelectedItemIndex());
}
}

View File

@ -328,7 +328,7 @@ public class iPowerFighterPlugin extends Plugin {
log.debug("Alching item: {}", alchItem.getId());
targetMenu = new LegacyMenuEntry("", "",
alchItem.getId(),
MenuAction.ITEM_USE_ON_WIDGET.getId(),
MenuAction.WIDGET_USE_ON_ITEM.getId(),
alchItem.getIndex(), WidgetInfo.INVENTORY.getId(),
false);
utils.oneClickCastSpell(WidgetInfo.SPELL_HIGH_LEVEL_ALCHEMY, targetMenu, alchItem.getCanvasBounds().getBounds(), sleepDelay());

View File

@ -184,7 +184,7 @@ public class iRandomHandlerPlugin extends Plugin {
genie = true;
if (client.getWidget(231, 3) != null) {
log.debug("Genie click here to continue found, progressing...");
targetMenu = new LegacyMenuEntry("Continue", "", 0, MenuAction.WIDGET_TYPE_6.getId(),
targetMenu = new LegacyMenuEntry("Continue", "", 0, MenuAction.WIDGET_CONTINUE.getId(),
-1, 15138820, false);
menu.setEntry(targetMenu);
mouse.delayMouseClick(randomToDismiss.getConvexHull().getBounds(), sleepDelay());

View File

@ -261,7 +261,7 @@ public class iRooftopAgilityPlugin extends Plugin {
private void highAlchItem() {
if (!setHighAlch) {
targetMenu = new LegacyMenuEntry("Cast", "<col=00ff00>High Level Alchemy</col>", 0,
MenuAction.WIDGET_TYPE_2.getId(), -1, 14286887, false);
MenuAction.WIDGET_TARGET.getId(), -1, 14286887, false);
Widget spellWidget = client.getWidget(WidgetInfo.SPELL_HIGH_LEVEL_ALCHEMY);
if (spellWidget != null) {
menu.setEntry(targetMenu);
@ -275,7 +275,7 @@ public class iRooftopAgilityPlugin extends Plugin {
alchItem = inventory.getWidgetItem(List.of(config.alchItemID(), (config.alchItemID() + 1)));
targetMenu = new LegacyMenuEntry("Cast", "<col=00ff00>High Level Alchemy</col><col=ffffff> ->",
alchItem.getId(),
MenuAction.ITEM_USE_ON_WIDGET.getId(),
MenuAction.WIDGET_USE_ON_ITEM.getId(),
alchItem.getIndex(), 9764864,
false);
menu.setEntry(targetMenu);

View File

@ -23,7 +23,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
version = "4.9.1"
version = "4.9.2"
project.extra["PluginName"] = "iUtils"
project.extra["PluginDescription"] = "Illumine - Utils required for plugins to function with added automation"

View File

@ -478,7 +478,7 @@ public class InventoryUtils {
log.info("interacting inventory item: {}", item.getId());
sleep(minDelayBetween, maxDelayBetween);
menu.setModifiedEntry(new LegacyMenuEntry("", "", item1.getId(), opcode, item1.getIndex(), WidgetInfo.INVENTORY.getId(),
false), item.getId(), item.getIndex(), MenuAction.ITEM_USE_ON_WIDGET_ITEM.getId());
false), item.getId(), item.getIndex(), MenuAction.ITEM_USE_ON_ITEM.getId());
mouse.click(item1.getCanvasBounds());
if (!interactAll) {
break;

View File

@ -103,7 +103,7 @@ public class InventoryItem implements Interactable, Useable {
game.client.setSelectedItemSlot(item.slot());
game.client.setSelectedItemID(item.id());
game.client.invokeMenuAction("", "", id(),
MenuAction.ITEM_USE_ON_WIDGET_ITEM.getId(), slot(), WidgetInfo.INVENTORY.getId());
MenuAction.ITEM_USE_ON_ITEM.getId(), slot(), WidgetInfo.INVENTORY.getId());
});
});
}

View File

@ -149,7 +149,7 @@ public class iWidget implements Interactable, Useable {
game().clientThread.invoke(() ->
client().invokeMenuAction("", "",
0,
MenuAction.WIDGET_TYPE_6.getId(),
MenuAction.WIDGET_CONTINUE.getId(),
index(),
id()
)
@ -172,7 +172,7 @@ public class iWidget implements Interactable, Useable {
game.client.setSelectedSpellWidget(id());
game.client.setSelectedSpellChildIndex(-1);
game.client.invokeMenuAction("", "", item.id(),
MenuAction.ITEM_USE_ON_WIDGET.getId(), item.slot(), WidgetInfo.INVENTORY.getId());
MenuAction.WIDGET_USE_ON_ITEM.getId(), item.slot(), WidgetInfo.INVENTORY.getId());
}));
}
@ -182,7 +182,7 @@ public class iWidget implements Interactable, Useable {
game.client.setSelectedSpellWidget(id());
game.client.setSelectedSpellChildIndex(-1);
game.client.invokeMenuAction("", "", npc.index(),
MenuAction.SPELL_CAST_ON_NPC.getId(), 0, 0);
MenuAction.WIDGET_TARGET_ON_NPC.getId(), 0, 0);
}));
}
@ -192,7 +192,7 @@ public class iWidget implements Interactable, Useable {
game.client.setSelectedSpellWidget(id());
game.client.setSelectedSpellChildIndex(-1);
game.client.invokeMenuAction("", "", object.id(),
MenuAction.SPELL_CAST_ON_GAME_OBJECT.getId(), object.menuPoint().getX(), object.menuPoint().getY());
MenuAction.WIDGET_TARGET_ON_GAME_OBJECT.getId(), object.menuPoint().getX(), object.menuPoint().getY());
}));
}
}

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.