mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-11 17:10:24 -07:00
Add API call for dispatching commands
Add Plugin for tab-to-reply command
This commit is contained in:
parent
b073365cd4
commit
7a7be2a54b
3 changed files with 33 additions and 2 deletions
|
|
@ -253,4 +253,8 @@ public class API {
|
||||||
public static void SetVarbit(int varbitId, int value) {
|
public static void SetVarbit(int varbitId, int value) {
|
||||||
VarpDomain.setVarbitClient(varbitId, value);
|
VarpDomain.setVarbitClient(varbitId, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void DispatchCommand(String command) {
|
||||||
|
Cheat.sendCheatPacket(JagString.of(command));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -235,9 +235,13 @@ public class Cheat {
|
||||||
PluginRepository.reloadPlugins();
|
PluginRepository.reloadPlugins();
|
||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
|
sendCheatPacket(arg0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void sendCheatPacket(JagString commandLine) {
|
||||||
Protocol.outboundBuffer.p1isaac(44);
|
Protocol.outboundBuffer.p1isaac(44);
|
||||||
Protocol.outboundBuffer.p1(arg0.length() - 1);
|
Protocol.outboundBuffer.p1(commandLine.length() - 1);
|
||||||
Protocol.outboundBuffer.pjstr(arg0.substring(2));
|
Protocol.outboundBuffer.pjstr(commandLine.substring(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
23
plugin-playground/src/main/kotlin/TabReply/plugin.kt
Normal file
23
plugin-playground/src/main/kotlin/TabReply/plugin.kt
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
package TabReply
|
||||||
|
|
||||||
|
import plugin.Plugin
|
||||||
|
import plugin.annotations.PluginMeta
|
||||||
|
import plugin.api.API
|
||||||
|
import java.awt.event.KeyAdapter
|
||||||
|
import java.awt.event.KeyEvent
|
||||||
|
|
||||||
|
@PluginMeta (
|
||||||
|
author = "Ceikry",
|
||||||
|
description = "Allows you to press tab to reply to DMs.",
|
||||||
|
version = 1.0
|
||||||
|
)
|
||||||
|
class plugin : Plugin() {
|
||||||
|
override fun Init() {
|
||||||
|
API.AddKeyboardListener(object : KeyAdapter() {
|
||||||
|
override fun keyPressed(e: KeyEvent) {
|
||||||
|
if (e.keyCode == KeyEvent.VK_TAB)
|
||||||
|
API.DispatchCommand("::reply")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue