Merge pull request #1416 from Abextm/script-fixes

Fix scripts broken in 4/12/18 update
This commit is contained in:
Tomas Slusny
2018-04-12 15:32:37 +02:00
committed by GitHub
12 changed files with 126 additions and 43 deletions

View File

@@ -339,7 +339,7 @@ public class Hooks
}
}
public static void menuActionHook(int actionParam, int widgetId, int menuAction, int id, String menuOption, String menuTarget, int var6, int var7)
public static boolean menuActionHook(int actionParam, int widgetId, int menuAction, int id, String menuOption, String menuTarget, int var6, int var7)
{
/* Along the way, the RuneScape client may change a menuAction by incrementing it with 2000.
* I have no idea why, but it does. Their code contains the same conditional statement.
@@ -360,6 +360,8 @@ public class Hooks
log.debug("Menu action clicked: {}", menuOptionClicked);
eventBus.post(menuOptionClicked);
return menuOptionClicked.isConsumed();
}
public static void addChatMessage(int type, String name, String message, String sender)

View File

@@ -65,7 +65,7 @@ public class BankTagsPlugin extends Plugin
private static final String EDIT_TAGS_MENU_OPTION = "Edit-tags";
private static final int EDIT_TAGS_MENU_INDEX = 9;
private static final int EDIT_TAGS_MENU_INDEX = 8;
@Inject
private Client client;
@@ -203,6 +203,7 @@ public class BankTagsPlugin extends Plugin
&& event.getMenuAction() == MenuAction.EXAMINE_ITEM_BANK_EQ
&& event.getId() == EDIT_TAGS_MENU_INDEX)
{
event.consume();
int inventoryIndex = event.getActionParam();
ItemContainer bankContainer = client.getItemContainer(InventoryID.BANK);
if (bankContainer == null)