Add health detection features

master
sigonasr2 2 years ago
parent ad679131e9
commit aa84432e20
  1. 43
      sig/App.java
  2. 74
      sig/Level 50 Scholar AI.txt

@ -6,8 +6,10 @@ import java.net.ServerSocket;
import java.net.Socket;
import java.util.Map.Entry;
import java.awt.AWTException;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.event.KeyEvent;
import java.awt.image.BufferedImage;
import lc.kra.system.keyboard.GlobalKeyboardHook;
import lc.kra.system.keyboard.event.GlobalKeyAdapter;
@ -36,7 +38,7 @@ class Client {
public void keyPressed(GlobalKeyEvent event) {
try {
switch (event.getVirtualKeyCode()){
case GlobalKeyEvent.VK_NUMPAD0:{
case GlobalKeyEvent.VK_NUMPAD7:{
out.writeUTF("FOLLOW");
}break;
case GlobalKeyEvent.VK_NUMPAD8:
@ -64,9 +66,13 @@ class Client {
}break;
case GlobalKeyEvent.VK_NUMPAD3:
case 110:
case GlobalKeyEvent.VK_DELETE:{
case GlobalKeyEvent.VK_DELETE:
case GlobalKeyEvent.VK_RETURN:{
out.writeUTF("CHILL");
}break;
case GlobalKeyEvent.VK_NUMPAD9:{
out.writeUTF("PASS");
}break;
}
} catch (IOException e) {
e.printStackTrace();
@ -146,6 +152,34 @@ class Server
r.keyRelease(modifier);
}
float GetMythraHealth(){
BufferedImage img=r.createScreenCapture(new Rectangle(105, 193, 107, 1));
for (int i=img.getWidth()-1;i>=0;i--){
if ((img.getRGB(i,0)&255)>100){
return i/(img.getWidth()-1)*100;
}
}
return 0;
}
float GetAyaHealth(){
BufferedImage img=r.createScreenCapture(new Rectangle(105, 243, 107, 1));
for (int i=img.getWidth()-1;i>=0;i--){
if ((img.getRGB(i,0)&255)>100){
return i/(img.getWidth()-1)*100;
}
}
return 0;
}
float GetTargetHealth(){
BufferedImage img=r.createScreenCapture(new Rectangle(704, 149, 539, 1));
for (int i=img.getWidth()-1;i>=0;i--){
if ((img.getRGB(i,0)&255)>100){
return i/(img.getWidth()-1)*100;
}
}
return 0;
}
// constructor with port
public Server(int port)
{
@ -210,6 +244,11 @@ class Server
fighting=false;
System.out.println("Fight mode: "+fighting);
}break;
case "PASS":{
System.out.println("Mythra's Health: "+GetMythraHealth()+"%");
System.out.println("Aya's Health: "+GetAyaHealth()+"%");
System.out.println("Target's Health: "+GetTargetHealth()+"%");
}break;
default:{
System.out.println("Unknown command: "+line);
}

@ -0,0 +1,74 @@
Command a Healer from the same PC.
Button to follow Aya.
Strafe Left/Right or move forward/backwards
Run
Pass on Loot
Broil Timer = 0
Lucid Dreaming Timer = 0
Next Action Timer = 0
Aetherflow Timer = 0
Aetherflow Stacks = 0
Whispering Dawn Timer = 0
Fey Illumination Timer = 0
Detect Mythra's Mana
Detect Aya's and Mythra's Health
Detect Target's Health
function Heal():
If Aetherflow Stacks > 0
Cast Lustrate
Aetherflow Stacks -= 1
Next Action Timer = 1
else If Aya has a shield:
Cast Physick
Next Action Timer = 2.5
else
Cast Succor
Next Action Timer = 2.5
If Mana<80% and Lucid Dreaming Timer==0:
Use Lucid Dreaming
Lucid Dreaming Timer=60
If Aetherflow Timer==0
Cast Aetherflow
Set Aetherflow stacks to 3
Next Action Timer = 1
Check healthbars, if both are above 40% we'll perform an attack.
Target the target of Aya
If there is one target,
If target is above 50% health, and Bio Timer==0
Use Bio, set Bio Timer to 30
Next Action Timer=2.5
else
Use Broil/Ruin I
Next Action Timer = 2.5
else
Use Art of War.
Next Action Timer = 2.5
else
If Aya health < 60%,
If Whispering Dawn Timer==0 && Fey Illumination Timer < 30
Cast Whispering Dawn
Whispering Dawn Timer = 60
Next Action Timer = 1
else
If Fey Illumination Timer==0 && Whispering Dawn Timer < 30
Cast Fey Illumination
Fey Illumination Timer = 60
Next Action Timer = 1
If Aya health < 40%,
Target Aya
Heal()
else
If Mythra health < 40%,
Target Mythra
Heal()
If chill mode is activated, broil timer = 0
Broil timer ticks down by 1 per second.
Lucid Dreaming timer ticks down by 1 per second.
Loading…
Cancel
Save