Created
December 22, 2015 11:07
-
-
Save lordgmage/087735d2cd53a0dc8530 to your computer and use it in GitHub Desktop.
For Caps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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_7" inherit-compiler-output="false"> | |
<output url="file://$USER_HOME$/Parabot/scripts/compiled" /> | |
<output-test url="file://$USER_HOME$/Parabot/scripts/compiled" /> | |
<content url="file://$MODULE_DIR$"> | |
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> | |
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> | |
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> | |
<excludeFolder url="file://$MODULE_DIR$/target" /> | |
</content> | |
<orderEntry type="inheritedJdk" /> | |
<orderEntry type="sourceFolder" forTests="false" /> | |
<orderEntry type="library" name="Maven: org.parabot:client:2.4.1" level="project" /> | |
<orderEntry type="library" name="Maven: org.parabot:317-api-minified:1.13" level="project" /> | |
</component> | |
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>LordSmithing</groupId> | |
<artifactId>LordSmithing</artifactId> | |
<version>1.0</version> | |
<properties> | |
<jdk.version>1.7</jdk.version> | |
</properties> | |
<repositories> | |
<repository> | |
<id>git-parabot</id> | |
<name>Parabot's Git based repo</name> | |
<url>https://github.com/parabot/Maven-Repository/raw/master/</url> | |
</repository> | |
</repositories> | |
<dependencies> | |
<dependency> | |
<groupId>org.parabot</groupId> | |
<artifactId>client</artifactId> | |
<version>2.4.1</version> | |
</dependency> | |
<dependency> | |
<groupId>org.parabot</groupId> | |
<artifactId>317-api-minified</artifactId> | |
<version>1.13</version> | |
</dependency> | |
</dependencies> | |
<build> | |
<finalName>98</finalName> | |
<resources> | |
<resource> | |
<directory>src/main/resources</directory> | |
<filtering>true</filtering> | |
<includes> | |
<include>config.xml</include> | |
</includes> | |
</resource> | |
<resource> | |
<directory>src/main/resources</directory> | |
<filtering>false</filtering> | |
<excludes> | |
<exclude>config.xml</exclude> | |
</excludes> | |
</resource> | |
</resources> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<version>2.3.2</version> | |
<configuration> | |
<source>1.7</source> | |
<target>1.7</target> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-jar-plugin</artifactId> | |
<configuration> | |
<excludes> | |
<exclude>src/org.main/resources/config.xml</exclude> | |
</excludes> | |
</configuration> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.lord.data; | |
public class Constants { | |
public static final int IRON_ORE_ID = 441 ; | |
public static final int COPPER_ORE_ID = 4412 ; | |
public static final int MITHRIL_ORE_ID = 4412 ; // TO GET | |
public static final int GOLD_ORE_ID = 4412 ;// TO GET | |
public static final int COAL_ORE_ID = 454 ;// TO GET | |
public static final int TIN_ORE_ID = 454 ;// TO GET | |
public static final int RUNE_ORE_ID = 454 ;// TO GET | |
public static final int ADAMANTITE_ORE_ID = 454 ;// TO GET | |
public static final int BRONZE_BAR_ID = 3987 ; | |
public static final int IRON_BAR_ID = 3991 ; | |
public static final int STEEL_BAR_ID = 3999 ; | |
public static final int GOLD_BAR_ID = 4003 ; | |
public static final int ADAMANTITE_BAR_ID = 7446 ; | |
public static final int MITHRIL_BAR_ID = 7441 ; | |
public static final int RUNE_BAR_ID = 7450 ; | |
public static final int FURNACE = 2781 ; | |
public final static int DEPOSIT = 9398; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.lord.data; | |
import org.rev317.min.Loader; | |
/** | |
* Created by G on 20/12/2015. | |
*/ | |
public class Methods { | |
public static int getBankSlot(int id) { | |
int[] bankIds = Loader.getClient().getInterfaceCache()[5382].getItems(); | |
for (int i = 0; i < bankIds.length; i++) { | |
if (bankIds[i] == id) { | |
return i; | |
} | |
} | |
return 0; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.lord.data; | |
public class Variables { | |
public static int ore; | |
public static int ore2; | |
public static int bar; | |
public static boolean bank; | |
public static int getOre() {return ore; } | |
public static int getOre2() {return ore2; } | |
public static int getBar() {return bar; } | |
public static boolean getBank() {return bank; } | |
public static void setBanking(boolean bank) {Variables.bank = bank; } | |
public static int setOre(int ore) {Variables.ore = ore; | |
return ore; | |
} | |
public static int setOre2(int ore2) {Variables.ore2 = ore2; | |
return ore2; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.lord.main; | |
import org.lord.strategies.Banking; | |
import org.parabot.environment.scripts.Category; | |
import org.parabot.environment.scripts.Script; | |
import org.parabot.environment.scripts.ScriptManifest; | |
import org.parabot.environment.scripts.framework.Strategy; | |
import org.lord.strategies.Smithing; | |
import java.util.ArrayList; | |
@ScriptManifest(author = "Lord", | |
category = Category.SMITHING, | |
description = "Smithes Many things", | |
name = "Lord Smithing", | |
servers = { "PKHonor" }, | |
version = 1.0) | |
public class core extends Script { | |
private final ArrayList<Strategy> strategies = new ArrayList<Strategy>(); | |
@Override | |
public boolean onExecute() { | |
GUI UI = new GUI(); | |
UI.setVisible(true); | |
while (UI.isVisible()) { | |
sleep(20); | |
} | |
strategies.add(new Smithing()); | |
strategies.add(new Banking()); | |
provide(strategies); | |
return true; | |
} | |
@Override | |
public void onFinish() { | |
super.onFinish(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.lord.main; | |
import com.sun.org.apache.xpath.internal.operations.Variable; | |
import org.lord.data.Constants; | |
import org.lord.data.Variables; | |
import org.rev317.min.api.methods.Bank; | |
import java.awt.EventQueue; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; | |
import javax.imageio.ImageIO; | |
import javax.swing.*; | |
import javax.swing.border.EmptyBorder; | |
public class GUI extends JFrame { | |
private JPanel contentPane; | |
/** | |
* Launch the application. | |
*/ | |
public static void main(String[] args) { | |
EventQueue.invokeLater(new Runnable() { | |
public void run() { | |
try { | |
GUI frame = new GUI(); | |
frame.setVisible(true); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
} | |
}); | |
} | |
/** | |
* Create the frame. | |
*/ | |
public GUI() { | |
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); | |
setBounds(100, 100, 450, 300); | |
contentPane = new JPanel(); | |
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); | |
setContentPane(contentPane); | |
contentPane.setLayout(null); | |
BufferedImage myBufferedImage = null; | |
try { | |
for (File f : new File("./LordSmithing/src/main/resources/").listFiles()){ | |
System.out.println(f.getName()); | |
} | |
myBufferedImage = ImageIO.read(new File("./LordSmithing/src/main/resources/image.png")); //set to icon.png when releasing | |
} catch (IOException r) { | |
r.printStackTrace(); | |
} | |
JLabel lblNewLabel = new JLabel(new ImageIcon(myBufferedImage)); | |
lblNewLabel.setBounds(0, 0, 450, 278); | |
contentPane.add(lblNewLabel); | |
final JComboBox comboBox = new JComboBox(); | |
comboBox.setModel(new DefaultComboBoxModel(new String[] {"Bronze", "Iron", "Steel", "Gold","Mithril", "Adamantite", "Rune"})); | |
comboBox.setBounds(113, 127, 221, 27); | |
contentPane.add(comboBox); | |
final JButton Start = new JButton("Start"); | |
Start.addActionListener(new ActionListener() { | |
public void actionPerformed(ActionEvent e) { | |
String selection = (String) comboBox.getModel().getSelectedItem(); | |
switch (selection) { | |
case "Bronze": | |
Variables.ore = Constants.COPPER_ORE_ID ; | |
Variables.ore2 = Constants.TIN_ORE_ID; | |
Variables.bar = Constants.BRONZE_BAR_ID; | |
Variables.bank = false; | |
break; | |
case "Iron": | |
Variables.ore = Constants.IRON_ORE_ID; | |
Variables.bar = Constants.IRON_BAR_ID; | |
Variables.bank = true; | |
break; | |
case "Steel": | |
Variables.ore = Constants.IRON_ORE_ID; | |
Variables.ore2 = Constants.COAL_ORE_ID; | |
Variables.bar = Constants.STEEL_BAR_ID; | |
Variables.bank = false; | |
break; | |
case "Gold": | |
Variables.ore = Constants.GOLD_ORE_ID; | |
Variables.bank = true; | |
break; | |
case "Mithril": | |
Variables.ore = Constants.MITHRIL_ORE_ID; | |
Variables.ore2 = Constants.COAL_ORE_ID; | |
Variables.bar = Constants.MITHRIL_BAR_ID; | |
Variables.bank = false; | |
break; | |
case "Adamantite": | |
Variables.ore = Constants.ADAMANTITE_ORE_ID; | |
Variables.ore2 = Constants.COAL_ORE_ID; | |
Variables.bar = Constants.ADAMANTITE_BAR_ID; | |
Variables.bank = false; | |
break; | |
case "Rune": | |
Variables.ore = Constants.RUNE_ORE_ID; | |
Variables.ore2 = Constants.COAL_ORE_ID; | |
Variables.bar = Constants.RUNE_BAR_ID; | |
Variables.bank = false; | |
break; | |
default: | |
System.out.println("Something wrong as happened please contact the script writers."); | |
break; | |
} | |
setVisible(false); | |
} | |
}); | |
Start.setBounds(0, 249, 450, 29); | |
contentPane.add(Start); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.lord.strategies; | |
import org.lord.data.Constants; | |
import org.lord.data.Methods; | |
import org.lord.data.Variables; | |
import org.parabot.environment.api.utils.Time; | |
import org.parabot.environment.scripts.framework.SleepCondition; | |
import org.parabot.environment.scripts.framework.Strategy; | |
import org.rev317.min.api.methods.Bank; | |
import org.rev317.min.api.methods.Inventory; | |
import org.rev317.min.api.methods.Menu; | |
import org.rev317.min.api.methods.Players; | |
public class Banking implements Strategy{ | |
@Override | |
public boolean activate() { | |
return !Inventory.contains(Variables.getOre()) && Players.getMyPlayer().getAnimation() == -1; | |
} | |
@Override | |
public void execute() { | |
if (Variables.bank = true) { | |
Bank.open(); | |
Time.sleep(new SleepCondition() { | |
@Override | |
public boolean isValid() { | |
return Bank.isOpen(); | |
} | |
}, 6000); | |
Menu.clickButton(Constants.DEPOSIT); | |
Time.sleep(new SleepCondition() { | |
@Override | |
public boolean isValid() { | |
return Inventory.isEmpty(); | |
} | |
}, 3000); | |
Menu.sendAction(53, Variables.ore, Methods.getBankSlot(Variables.ore), 5382, 3); | |
Time.sleep(new SleepCondition() { | |
@Override | |
public boolean isValid() { | |
return Inventory.isFull(); | |
} | |
}, 3000); | |
Menu.clickButton(200); | |
} | |
if (Variables.bank = false){ | |
Bank.open(); | |
Time.sleep(new SleepCondition() { | |
@Override | |
public boolean isValid() { | |
return Bank.isOpen(); | |
} | |
}, 6000); | |
Menu.clickButton(Constants.DEPOSIT); | |
Time.sleep(new SleepCondition() { | |
@Override | |
public boolean isValid() { | |
return Inventory.isEmpty(); | |
} | |
}, 3000); | |
Menu.sendAction(867, Variables.ore, Methods.getBankSlot(Variables.ore), 5382, 3);// Get code for withdrawing 14 | |
Time.sleep(new SleepCondition() { | |
@Override | |
public boolean isValid() { | |
return Inventory.getCount(Variables.ore) == 14; | |
} | |
},3000); | |
Menu.sendAction(867, Variables.ore2, Methods.getBankSlot(Variables.ore2), 5382, 3);// Get code for withdrawing 14 | |
Time.sleep(new SleepCondition() { | |
@Override | |
public boolean isValid() { | |
return Inventory.isFull(); | |
} | |
}, 3000); | |
Menu.clickButton(200); | |
} | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.lord.strategies; | |
import org.lord.data.Constants; | |
import org.lord.data.Variables; | |
import org.parabot.environment.api.utils.Time; | |
import org.parabot.environment.scripts.framework.SleepCondition; | |
import org.parabot.environment.scripts.framework.Strategy; | |
import org.rev317.min.api.methods.*; | |
import org.rev317.min.api.wrappers.SceneObject; | |
public class Smithing implements Strategy{ | |
private SceneObject[] FURNACE; | |
@Override | |
public boolean activate() { | |
FURNACE = SceneObjects.getNearest(Constants.FURNACE); | |
return FURNACE !=null && FURNACE.length > 0 && Inventory.contains(Variables.getOre()) ; | |
} | |
@Override | |
public void execute() { | |
FURNACE[0].interact(SceneObjects.Option.SMELT); | |
Time.sleep(new SleepCondition() { | |
@Override | |
public boolean isValid() { | |
return Game.getOpenBackDialogId() == 2400; | |
} | |
},2400); | |
Menu.clickButton(Variables.bar); // Need ID of bars | |
Time.sleep(new SleepCondition() { | |
@Override | |
public boolean isValid() { | |
return Players.getMyPlayer().getAnimation() == -1; | |
} | |
},2500); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<config> | |
<jars basedir="${project.basedir}/target/"> | |
<jar in="${project.build.finalName}.jar" out="/home/ci/jars/${project.build.finalName}.jar"/> | |
</jars> | |
<classpath basedir="/home/ci/allatori/libs"> | |
<jar name="./*.jar"/> | |
</classpath> | |
<!-- String encryption --> | |
<property name="string-encryption" value="enable"/> | |
<property name="string-encryption-type" value="fast"/> | |
<property name="string-encryption-version" value="v4"/> | |
<!-- Control flow obfuscation --> | |
<property name="control-flow-obfuscation" value="enable"/> | |
<property name="extensive-flow-obfuscation" value="normal"/> | |
<!-- Renaming --> | |
<property name="default-package" value=""/> | |
<property name="force-default-package" value="disable"/> | |
<property name="classes-naming" value="unique"/> | |
<property name="methods-naming" value="iii"/> | |
<property name="fields-naming" value="iii"/> | |
<property name="local-variables-naming" value="abc"/> | |
<!-- Other --> | |
<property name="line-numbers" value="keep"/> | |
<property name="generics" value="keep"/> | |
<property name="member-reorder" value="enable"/> | |
<property name="finalize" value="disable"/> | |
<property name="synthetize-methods" value="private"/> | |
<property name="synthetize-fields" value="private"/> | |
<property name="remove-toString" value="disable"/> | |
</config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
�PNG | |