Merge branch 'Dark98-master'

This commit is contained in:
RedSparr0w
2019-10-21 09:19:07 +13:00
9 changed files with 139 additions and 18 deletions
Generated
-1
View File
@@ -2,6 +2,5 @@
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/ParaScript" vcs="Git" />
</component>
</project>
+9 -1
View File
@@ -3,7 +3,9 @@
<component name="ChangeListManager">
<list default="true" id="3ab8e8a0-ccfd-4b0b-9547-98173085dc38" 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/strategies/Bank.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/strategies/Bank.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/Main.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/ParaScript/data/variables/Npcs.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ParaScript/data/variables/Npcs.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>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
@@ -39,6 +41,7 @@
<property name="GenerateAntBuildDialog.forceTargetJdk" value="true" />
<property name="GenerateAntBuildDialog.generateSingleFile" value="true" />
<property name="GenerateAntBuildDialog.outputFileNameProperty" value="parascript" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="project.structure.last.edited" value="Modules" />
<property name="project.structure.proportion" value="0.15" />
@@ -110,4 +113,9 @@
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<ignored-roots>
<path value="$PROJECT_DIR$/ParaScript" />
</ignored-roots>
</component>
</project>
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$USER_HOME$/OneDrive/Documents/Parabot/scripts/compiled" />
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+12 -8
View File
@@ -16,7 +16,7 @@ import org.rev317.min.api.methods.Skill;
import java.awt.*;
import java.util.ArrayList;
@ScriptManifest(author = "RedSparr0w", category = Category.OTHER, description = "ParaScript", name = "ParaScript", servers = { "2006rebotted" }, version = 1)
@ScriptManifest(author = "RedSparr0w & Dark98", category = Category.OTHER, description = "2006 AIO Script", name = "2006 AIO", servers = { "2006rebotted" }, version = 1)
public class Main extends Script implements MessageListener, Paintable {
private final ArrayList<Strategy> strategies = new ArrayList<Strategy>();
@@ -41,6 +41,9 @@ public class Main extends Script implements MessageListener, Paintable {
strategies.add(new Bank());
strategies.add(new Walk());
}
if(Variables.skill_to_train == Skill.THIEVING) {
strategies.add(new Thieving());
}
if(Variables.skill_to_train == null) {
strategies.add(new Bank());
strategies.add(new Walk());
@@ -72,9 +75,9 @@ public class Main extends Script implements MessageListener, Paintable {
g.fillRect(355, 252, 160, 85);
g.setColor(Color.WHITE);
g.setFont(new Font("Arial", 1, 14));
g.drawString("ParaScript", 360, 247);
g.setFont(new Font("Arial", 1, 11));
g.setFont(new Font("Arial", Font.BOLD, 14));
g.drawString("2006AIO", 360, 247);
g.setFont(new Font("Arial", Font.BOLD, 11));
g.drawString("Status: " + Variables.getStatus(), 360, 270);
g.drawString("Items(P/H): " + Methods.formatNumber(Variables.itemsGained) + "(" + Methods.formatNumber(Variables.SCRIPT_TIMER.getPerHour(Variables.itemsGained)) + ")", 360, 290);
g.drawString("EXP(P/H): " + Methods.formatNumber((int) Variables.expGained) + "(" + Methods.formatNumber(Variables.SCRIPT_TIMER.getPerHour((int) Variables.expGained)) + ")", 360, 310);
@@ -85,11 +88,12 @@ public class Main extends Script implements MessageListener, Paintable {
public void messageReceived(MessageEvent message) {
switch (message.getType()) {
case 0:
if (message.getMessage().startsWith("You manage to ")) {
Variables.addItemGained(1);
Variables.updateExpGained();
if (message.getMessage().startsWith("You manage to ") || // woodcutting, mining
message.getMessage().startsWith("You pick the ")) { // pickpockets
Variables.addItemGained(1);
Variables.updateExpGained();
}
if (message.getMessage().contains("Congratulations, you advanced a woodcutting level.")) {
if (message.getMessage().startsWith("Congratulations, you advanced a")) {
// add in level up to paint
}
break;
@@ -1,5 +1,6 @@
package ParaScript.data;
import ParaScript.data.variables.Npcs;
import ParaScript.data.variables.Ores;
import ParaScript.data.variables.Trees;
import ParaScript.data.variables.Zone;
@@ -34,6 +35,11 @@ public class Variables {
public static Ores mining_ore_selected = Ores.COPPER_TIN;
public static String mining_method = "Bank";
//Thieving
public static Npcs thieving_npc_selected = Npcs.MAN;
public static String thieving_method = "None";
// Used for slave accounts
public static String slaveMaster = "";
@@ -81,7 +87,35 @@ public class Variables {
new Tile(3287, 3370),
};
//mining lumbridge
public final static Zone LUMBRIDGE_BANK_ZONE = new Zone(new Tile(3205, 3225), new Tile(3211, 3214));
public final static Zone LUMBRIDGE_MINE_ZONE = new Zone(new Tile(3276, 3375), new Tile(3298, 3354));
public final static Tile[] LUMBRIDGE_EAST_MINE_PATH_TO_BANK = new Tile[]{
new Tile(3289, 3373),
new Tile(3289, 3373),
new Tile(3290, 3384),
new Tile(3290, 3395),
new Tile(3289, 3406),
new Tile(3281, 3416),
new Tile(3275, 3425),
new Tile(3264, 3426),
new Tile(3253, 3425),
new Tile(3253, 3420),
};
public final static Tile[] LUMBRIDGE_BANK_PATH_TO_MINE = new Tile[] {
new Tile(3253, 3423),
new Tile(3253, 3423),
new Tile(3262, 3427),
new Tile(3273, 3427),
new Tile(3280, 3418),
new Tile(3288, 3408),
new Tile(3290, 3397),
new Tile(3290, 3386),
new Tile(3288, 3375),
new Tile(3287, 3370),
};
public static String getAccountUsername() { return username; }
public static void setAccountUsername(String i) { username = i; }
@@ -0,0 +1,37 @@
package ParaScript.data.variables;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public enum Npcs {
MAN_WOMAN("Man & Woman", new int[]{1,2,3,4}, 8); // Man and Woman
private String name;
private int[] ids;
private double xp;
Npcs(String name, int[] ids, double xp) {
this.name = name;
this.ids = ids;
this.xp = xp;
}
public static String[] toStringArray() {
List<Npcs> enumList = Arrays.asList(Npcs.values());
List<String> locationsArray = new ArrayList<>();
for (Npcs npc : enumList) {
locationsArray.add(npc.name);
}
String[] simpleArray = new String[ locationsArray.size() ];
locationsArray.toArray( simpleArray );
return(simpleArray);
}
public String getName() { return this.name; }
public int[] getIDs() { return this.ids; }
public double getXP() { return this.xp; }
}
@@ -4,12 +4,14 @@ import ParaScript.data.Variables;
import org.parabot.environment.api.utils.Time;
import org.parabot.environment.scripts.framework.Strategy;
import org.rev317.min.api.methods.Inventory;
import org.rev317.min.api.methods.Npcs;
import org.rev317.min.api.methods.Players;
import org.rev317.min.api.methods.SceneObjects;
import org.rev317.min.api.wrappers.Npc;
import org.rev317.min.api.wrappers.SceneObject;
public class Thieving implements Strategy {
private SceneObject victim;
private Npc victim;
@Override
public boolean activate() {
@@ -19,21 +21,24 @@ public class Thieving implements Strategy {
&& !Players.getMyPlayer().isInCombat()
&& Players.getMyPlayer().getAnimation() == -1
&& !Inventory.isFull()) {
Variables.setStatus("thieving");
return true;
}
Variables.setStatus("none");
return false;
}
@Override
public void execute() {
victim.interact(SceneObjects.Option.STEAL_FROM);
victim.interact(Npcs.Option.PICKPOCKET);
Time.sleep(1000);
//Wait for the Player to finish pickpocketing
Time.sleep(() -> Players.getMyPlayer().getAnimation() == -1, 500);
}
private SceneObject victim(){
for(SceneObject victim : SceneObjects.getNearest(1, 2, 3, 4)){
private Npc victim(){
int[] npc_to_thieve = Variables.thieving_npc_selected.getIDs();
for(Npc victim : Npcs.getNearest(npc_to_thieve)){
if(victim != null){
return victim;
}
+36 -2
View File
@@ -1,5 +1,6 @@
package ParaScript.ui;
import ParaScript.data.variables.Npcs;
import ParaScript.data.variables.Ores;
import ParaScript.data.variables.Trees;
import ParaScript.data.Variables;
@@ -36,6 +37,10 @@ public class UI extends JFrame {
private JComboBox oreSelect = new JComboBox();
private JComboBox miningMethod = new JComboBox();
//Thieving
private JComboBox npcSelect = new JComboBox();
private JComboBox thievingMethod = new JComboBox();
// Our colors
private Color Color_MidnightBlue = new Color(44, 62, 80);
private Color Color_WetAsphalt = new Color(52, 73, 94);
@@ -44,7 +49,7 @@ public class UI extends JFrame {
private Color Color_Alizarin = new Color(231, 76, 60);
public UI() {
setTitle("src/ParaScript");
setTitle("2006AIO");
setResizable(false);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setBounds(100, 100, 400, 300);
@@ -113,6 +118,7 @@ public class UI extends JFrame {
skillSelect.setModel(new DefaultComboBoxModel(new String[]{
Skill.WOODCUTTING.getName(),
Skill.MINING.getName(),
Skill.THIEVING.getName(),
"Bank Runner",
}));
skillSelect.setBounds(20, 40, 150, 20);
@@ -255,6 +261,34 @@ public class UI extends JFrame {
});
miningPanel.add(miningMethod);
/*
* Thieving Panel
*/
JPanel thievingPanel = new JPanel();
thievingPanel.setForeground(Color_WhiteSmoke);
thievingPanel.setBackground(Color_WetAsphalt);
tabbedPane.addTab("Thieving", null, thievingPanel, null);
thievingPanel.setLayout(null);
// Select which npc should be our victim
JLabel lblNpc = new JLabel("NPC");
lblOre.setForeground(Color_WhiteSmoke);
lblOre.setBounds(20, 20, 73, 20);
thievingPanel.add(lblNpc);
npcSelect.setModel(new DefaultComboBoxModel(Npcs.toStringArray()));
npcSelect.setBounds(20, 40, 150, 20);
npcSelect.addActionListener (new ActionListener () {
public void actionPerformed(ActionEvent e) {
for (Npcs npc : Npcs.values()) {
if (npc.getName().equalsIgnoreCase(npcSelect.getSelectedItem().toString())) {
Variables.thieving_npc_selected = npc;
}
}
}
});
thievingPanel.add(npcSelect);
/*
* Slave Panel
*/
@@ -264,7 +298,7 @@ public class UI extends JFrame {
tabbedPane.addTab("Bank Runner", null, slavePanel, null);
slavePanel.setLayout(null);
// Which skill are we training
// Name of the Master account
JLabel lblSlaveMaster = new JLabel("Slave Master");
lblSlaveMaster.setForeground(Color_WhiteSmoke);
lblSlaveMaster.setBounds(20, 20, 73, 20);
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<config>
<jars basedir="C:/Users/Dan-j/IdeaProjects/ParaScript/target/">
<jars basedir="C:\\Users\\DarkA\\Desktop\\ParaScript/target/">
<jar in="1000204.jar" out="/home/ci/jars/1000204.jar"/>
</jars>