Add sprint command

master
sigonasr2 2 years ago
parent fb07e64410
commit 7b43df3b6f
  1. 30
      sig/App.java

@ -29,6 +29,7 @@ class Client {
private DataOutputStream out = null;
private static boolean run = true;
boolean altHeld=false;
// constructor to put ip address and port
public Client(String address, int port)
{
@ -40,7 +41,6 @@ class Client {
}
keyboardHook.addKeyListener(new GlobalKeyAdapter() {
@Override
public void keyPressed(GlobalKeyEvent event) {
try {
@ -48,6 +48,9 @@ class Client {
case GlobalKeyEvent.VK_NUMPAD7:{
out.writeUTF("FOLLOW");
}break;
case 187:{
out.writeUTF("SPRINT");
}break;
case GlobalKeyEvent.VK_NUMPAD8:
case GlobalKeyEvent.VK_UP:{
out.writeUTF("FORWARD");
@ -66,10 +69,16 @@ class Client {
}break;
case GlobalKeyEvent.VK_NUMPAD1:
case GlobalKeyEvent.VK_1:
case GlobalKeyEvent.VK_2:
case GlobalKeyEvent.VK_3:{
case GlobalKeyEvent.VK_2:{
out.writeUTF("FIGHT");
}break;
case GlobalKeyEvent.VK_3:{
if (altHeld){
out.writeUTF("FIGHTAOE");
} else {
out.writeUTF("FIGHT");
}
}break;
case GlobalKeyEvent.VK_Z:
case GlobalKeyEvent.VK_X:{
out.writeUTF("FIGHTAOE");
@ -83,6 +92,12 @@ class Client {
case GlobalKeyEvent.VK_NUMPAD9:{
out.writeUTF("PASS");
}break;
case 18:{
altHeld=true;
}break;
default:{
//System.out.println(event.getVirtualKeyCode());
}
}
} catch (IOException e) {
e.printStackTrace();
@ -94,7 +109,11 @@ class Client {
@Override
public void keyReleased(GlobalKeyEvent event) {
System.out.println(event);
switch (event.getVirtualKeyCode()){
case 18:{
altHeld=false;
}break;
}
}
});
@ -349,6 +368,9 @@ class Server
System.out.println("Aya's Health: "+GetAyaHealth()+"%");
System.out.println("Target's Health: "+GetTargetHealth()+"%");
}break;
case "SPRINT":{
r.keyPress(KeyEvent.VK_N);
}break;
case "UPDATE":{
}break;

Loading…
Cancel
Save