mirror of
https://github.com/2006-Scape/Parabot-317-API-Minified.git
synced 2026-07-05 00:37:51 +00:00
Added Messages debugging and moved to Maven
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package org.rev317.min.callback;
|
||||
|
||||
import org.rev317.min.Loader;
|
||||
import org.rev317.min.accessors.Client;
|
||||
import org.rev317.min.api.events.GameActionEvent;
|
||||
import org.rev317.min.api.methods.Game;
|
||||
import org.rev317.min.debug.DActions;
|
||||
import org.rev317.min.script.ScriptEngine;
|
||||
|
||||
/**
|
||||
* @author Everel
|
||||
* @author Matt123337
|
||||
*/
|
||||
public class MenuAction {
|
||||
|
||||
public static void intercept(int index) {
|
||||
Client client = Loader.getClient();
|
||||
int action1 = client.getMenuAction1()[index];
|
||||
int action2 = client.getMenuAction2()[index];
|
||||
int action3 = client.getMenuAction3()[index];
|
||||
int action4 = 0;
|
||||
int actionId = client.getMenuActionId()[index];
|
||||
if (DActions.debugActions()) {
|
||||
if (Game.hasAction4()) {
|
||||
action4 = client.getMenuAction4()[index];
|
||||
System.out.println(String.format("[index: %d, action1: %d, action2: %d, action3: %d, action4: %d, id: %d]", index, action1, action2, action3, action4, actionId));
|
||||
} else {
|
||||
System.out.println(String.format("[index: %d, action1: %d, action2: %d, action3: %d, id: %d]", index, action1, action2, action3, actionId));
|
||||
}
|
||||
}
|
||||
|
||||
final GameActionEvent actionEvent = new GameActionEvent(actionId, action1, action2, action3, action4, index);
|
||||
ScriptEngine.getInstance().dispatch(actionEvent);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.rev317.min.callback;
|
||||
|
||||
import org.rev317.min.api.events.MessageEvent;
|
||||
import org.rev317.min.script.ScriptEngine;
|
||||
|
||||
|
||||
public class MessageCallback {
|
||||
|
||||
public static final void messageListenerHook(int type, String name, String message) {
|
||||
final MessageEvent messageEvent = new MessageEvent(type, name, message);
|
||||
ScriptEngine.getInstance().dispatch(messageEvent);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user