mirror of
https://github.com/2006Scape-Scripts/ParaScript.git
synced 2026-07-02 16:49:02 +00:00
add min hp to fighting
This commit is contained in:
Generated
+8
-2
@@ -1,8 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="3ab8e8a0-ccfd-4b0b-9547-98173085dc38" name="Default Changelist" comment="">
|
<list default="true" id="14d0b690-21f2-4a9c-b8cf-803e9cc87ab5" name="Default Changelist" comment="">
|
||||||
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/data/Variables.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/data/Variables.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/data/variables/Ores.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/data/variables/Ores.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/data/variables/Ores.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/data/variables/Ores.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/strategies/Fighting.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/strategies/Fighting.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/strategies/MakeArrowShafts.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/strategies/MakeArrowShafts.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/strategies/Mine.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/strategies/Mine.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/ui/UI.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/ui/UI.java" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
@@ -90,7 +96,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="TaskManager">
|
<component name="TaskManager">
|
||||||
<task active="true" id="Default" summary="Default task">
|
<task active="true" id="Default" summary="Default task">
|
||||||
<changelist id="3ab8e8a0-ccfd-4b0b-9547-98173085dc38" name="Default Changelist" comment="" />
|
<changelist id="14d0b690-21f2-4a9c-b8cf-803e9cc87ab5" name="Default Changelist" comment="" />
|
||||||
<created>1570572301532</created>
|
<created>1570572301532</created>
|
||||||
<option name="number" value="Default" />
|
<option name="number" value="Default" />
|
||||||
<option name="presentableId" value="Default" />
|
<option name="presentableId" value="Default" />
|
||||||
|
|||||||
@@ -29,13 +29,14 @@ public class Variables {
|
|||||||
public static String woodcutting_method = "Fletch";
|
public static String woodcutting_method = "Fletch";
|
||||||
|
|
||||||
// Mining
|
// Mining
|
||||||
public static Ores mining_ore_selected = Ores.COPPER_TIN;
|
public static Ores mining_ore_selected = Ores.ESSENCE;
|
||||||
public static String mining_method = "Bank";
|
public static String mining_method = "Bank";
|
||||||
|
|
||||||
// Fighting
|
// Fighting
|
||||||
public static FightingNpcs fighting_npc_selected = FightingNpcs.CHICKEN;
|
public static FightingNpcs fighting_npc_selected = FightingNpcs.CHICKEN;
|
||||||
public static boolean fighting_bury_bones = true;
|
public static boolean fighting_bury_bones = true;
|
||||||
public static int[] fighting_item_ids = new int[]{};
|
public static int[] fighting_item_ids = new int[]{};
|
||||||
|
public static int fighting_minimum_hitpoints = 0;
|
||||||
|
|
||||||
// Thieving
|
// Thieving
|
||||||
public static ThievingNpcs thieving_npc_selected = ThievingNpcs.MAN_WOMAN;
|
public static ThievingNpcs thieving_npc_selected = ThievingNpcs.MAN_WOMAN;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import org.rev317.min.api.methods.Inventory;
|
|||||||
import org.rev317.min.api.methods.Npcs;
|
import org.rev317.min.api.methods.Npcs;
|
||||||
import org.rev317.min.api.methods.Players;
|
import org.rev317.min.api.methods.Players;
|
||||||
import org.rev317.min.api.wrappers.Npc;
|
import org.rev317.min.api.wrappers.Npc;
|
||||||
|
import org.rev317.min.api.wrappers.Player;
|
||||||
|
|
||||||
public class Fighting implements Strategy {
|
public class Fighting implements Strategy {
|
||||||
private Npc victim;
|
private Npc victim;
|
||||||
@@ -14,11 +15,13 @@ public class Fighting implements Strategy {
|
|||||||
@Override
|
@Override
|
||||||
public boolean activate() {
|
public boolean activate() {
|
||||||
victim = victim(); // set the local Variable
|
victim = victim(); // set the local Variable
|
||||||
|
Player myPlayer = Players.getMyPlayer();
|
||||||
if (Variables.running
|
if (Variables.running
|
||||||
&& victim != null
|
&& victim != null
|
||||||
&& !Players.getMyPlayer().isInCombat()
|
&& !myPlayer.isInCombat()
|
||||||
&& Players.getMyPlayer().getAnimation() == -1
|
&& myPlayer.getAnimation() == -1
|
||||||
&& !Inventory.isFull()) {
|
&& !Inventory.isFull()
|
||||||
|
&& myPlayer.getHealth() > Variables.fighting_minimum_hitpoints) {
|
||||||
Variables.setStatus("fighting");
|
Variables.setStatus("fighting");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ public class UI extends JFrame {
|
|||||||
private JLabel lblFightingNpcCustomID = new JLabel("Custom NPC IDs");
|
private JLabel lblFightingNpcCustomID = new JLabel("Custom NPC IDs");
|
||||||
private JTextField fightingNpcCustomID = new JTextField();
|
private JTextField fightingNpcCustomID = new JTextField();
|
||||||
private JCheckBox fightingBuryBones = new JCheckBox();
|
private JCheckBox fightingBuryBones = new JCheckBox();
|
||||||
private JLabel lblFightingItemCustomID = new JLabel("Pickup Item IDs");
|
|
||||||
private JTextField fightingItemCustomID = new JTextField();
|
private JTextField fightingItemCustomID = new JTextField();
|
||||||
|
private JTextField fightingMinimumHitpoints = new JTextField();
|
||||||
|
|
||||||
// Thieving
|
// Thieving
|
||||||
private JComboBox thievingNpcSelect = new JComboBox();
|
private JComboBox thievingNpcSelect = new JComboBox();
|
||||||
@@ -350,6 +350,7 @@ public class UI extends JFrame {
|
|||||||
fightingPanel.add(fightingBuryBones);
|
fightingPanel.add(fightingBuryBones);
|
||||||
|
|
||||||
// Custom items to pickup
|
// Custom items to pickup
|
||||||
|
JLabel lblFightingItemCustomID = new JLabel("Pickup Item IDs");
|
||||||
lblFightingItemCustomID.setForeground(Color_WhiteSmoke);
|
lblFightingItemCustomID.setForeground(Color_WhiteSmoke);
|
||||||
lblFightingItemCustomID.setBounds(20, 120, 150, 20);
|
lblFightingItemCustomID.setBounds(20, 120, 150, 20);
|
||||||
fightingPanel.add(lblFightingItemCustomID);
|
fightingPanel.add(lblFightingItemCustomID);
|
||||||
@@ -376,6 +377,29 @@ public class UI extends JFrame {
|
|||||||
});
|
});
|
||||||
fightingPanel.add(fightingItemCustomID);
|
fightingPanel.add(fightingItemCustomID);
|
||||||
|
|
||||||
|
// Minimum hitpoints to start fighting
|
||||||
|
JLabel lblFightingMinimumHitpoints = new JLabel("Minimum hitpoints");
|
||||||
|
lblFightingMinimumHitpoints.setForeground(Color_WhiteSmoke);
|
||||||
|
lblFightingMinimumHitpoints.setBounds(200, 120, 150, 20);
|
||||||
|
fightingPanel.add(lblFightingMinimumHitpoints);
|
||||||
|
fightingMinimumHitpoints.setBounds(200, 140, 150, 20);
|
||||||
|
fightingMinimumHitpoints.addFocusListener(new FocusListener() {
|
||||||
|
@Override
|
||||||
|
public void focusGained(FocusEvent e) {
|
||||||
|
// we don't need to do anything here
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void focusLost(FocusEvent e) {
|
||||||
|
try {
|
||||||
|
Variables.fighting_minimum_hitpoints = Integer.parseInt(fightingMinimumHitpoints.getText());
|
||||||
|
} catch (Exception ಠ_ಠ) {
|
||||||
|
Variables.fighting_minimum_hitpoints = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
fightingPanel.add(fightingMinimumHitpoints);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Thieving Panel
|
* Thieving Panel
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user