Ultimate VialFiller
Version 1.2
Supports:
varrock west (works perfectly as far as i know)
falador west (Money gained on paint doesn't work atm)
anti ban
fail safes
(please ask if you'd like a location or some features to be added into the script)
Script:
Please note version 1.2 has a few bugs so please tell me what bugs you get.
p.s i don't think varrock east works yet.
/* Made by limu for the UltimateBot.net range.
*
* SAVE AS UltimateVialFiller.java
* SAVE AS UltimateVialFiller.java
* SAVE AS UltimateVialFiller.java
*
* Enjoy the script :D
*/
import org.rsbot.script.Script;
import org.rsbot.script.ScriptManifest;
import org.rsbot.script.wrappers.*;
import java.awt.*;
import java.awt.event.*;
import org.rsbot.event.events.MessageEvent;
import org.rsbot.event.listeners.MessageListener;
import org.rsbot.event.listeners.PaintListener;
import javax.swing.*;
@ScriptManifest(authors = "limu", name = "UltimateVialFiller", version = 1.2, description = "")
public class UltimateVialFiller extends Script implements PaintListener,
MessageListener {
ScriptManifest props = getClass().getAnnotation(ScriptManifest.class);
int vialID = 229;
int[] waterID = { 24265, 11661 };
int[] boothID = { 11402, 11758 };
int wialID = 227;
int wialIDPrice;
private int profit;
private int vialsFilled = 0;
public long startTime = 0;
public long millis = 0;
public long hours = 0;
public long minutes = 0;
public long seconds = 0;
public long last = 0;
RSArea waterarea;
RSArea bankarea;
RSTile[] locToRun;
// varrock west
RSArea vww = new RSArea(3217, 3433, 3208, 3424);
RSArea vwb = new RSArea(3189, 3446, 3182, 3433);
RSTile[] vwpath = { new RSTile(3189, 3435), new RSTile(3246, 3429),
new RSTile(3240, 3433) };
// varrock east
RSArea vew = new RSArea(3246, 3438, 3234, 3428);
RSArea veb = new RSArea(3257, 3424, 3250, 3420);
RSTile[] vepath = { new RSTile(3209, 3427), new RSTile(3242, 3431),
new RSTile(3253, 3420)};
// falador west
RSArea fww = new RSArea(2946, 3384, 2949, 3381);
RSArea fwb = new RSArea(2947, 3371, 2943, 3368);
RSTile[] fwpath = { new RSTile(2946, 3368), new RSTile(2949, 3382) };
RSTilePath pathToBank;
gui g = new gui();
public boolean guiWait = true;
public boolean onStart() {
g.setVisible(true);
while (guiWait)
sleep(500);
pathToBank = walking.newTilePath(locToRun);
startTime = System.currentTimeMillis();
wialIDPrice = grandExchange.lookup(wialID).getGuidePrice();
return true;
}
public void onFinish() {
log(Color.BLACK, "Thank you for using" + props.name());
}
@Override
public int loop() {
if (inventory.containsAll(wialID)) {
if (atBank()) {
doBank();
} else {
walkR();
antiBan();
}
} else {
if (atWater()) {
fillVials();
antiBan();
sleep(16000, 17000);
} else {
walk();
antiBan();
}
}
return random(500, 800);
}
public void fillVials() {
RSItem Vial = inventory.getItem(vialID);
RSObject Fountain = objects.getNearest(waterID);
if (Vial != null) {
Vial.doAction("Use");
sleep(600);
if (Fountain.isOnScreen() && Fountain != null) {
Fountain.doClick();
}
}
}
private boolean atWater() {
RSObject fountain = objects.getNearest(waterID);
if (fountain != null) {
if (fountain.isOnScreen()) {
return true;
}
}
return false;
}
private boolean atBank() {
RSObject bank = objects.getNearest(boothID);
if (bank != null) {
if (bank.isOnScreen()) {
return true;
}
}
return false;
}
private void doBank() {
if (bank.isOpen()) {
bank.depositAll();
sleep(1000, 1300);
bank.withdraw(vialID, vialID);
} else {
bank.open();
sleep(1800, 2200);
}
}
private void walkR() {
pathToBank.reverse();
pathToBank.traverse();
pathToBank.reverse();
}
private void walk() {
pathToBank.traverse();
}
private void antiBan() {
int r = random(0, 25);
switch (r) {
case 4:
mouse.moveOffScreen();
sleep(3000, 5000);
break;
case 9:
mouse.moveRandomly(11, 67);
break;
case 13:
mouse.moveSlightly();
sleep(500, 800);
break;
case 19:
camera.moveRandomly(random(870, 2450));
break;
case 24:
camera.moveRandomly(random(100, 600));
break;
}
}
// GUI
class gui extends JFrame {
/**
*
*/
private static final long serialVersionUID = 1L;
public gui() {
initComponents();
}
private void button1ActionPerformed(ActionEvent e) {
String Loc = comboBox1.getSelectedItem().toString();
{
if (Loc.equals("Varrock West")) {
locToRun = vwpath;
waterarea = vww;
bankarea = vwb;
} else if (Loc.equals("Falador West")) {
locToRun = fwpath;
waterarea = fww;
bankarea = fwb;
} else if (Loc.equals("Varrock East")) {
locToRun = vepath;
waterarea = vew;
bankarea = veb;
}
guiWait = false;
g.dispose();
}
}
private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY
// //GEN-BEGIN:initComponents
// Generated using JFormDesigner Evaluation license - tom sharratt
label1 = new JLabel();
comboBox1 = new JComboBox();
label2 = new JLabel();
button1 = new JButton();
// ======== this ========
setResizable(false);
setForeground(Color.orange);
Container contentPane = getContentPane();
// ---- label1 ----
label1.setText("UltimateVialFiller");
label1.setFont(label1.getFont().deriveFont(
label1.getFont().getStyle() | Font.BOLD,
label1.getFont().getSize() + 10f));
label1.setForeground(Color.red);
// ---- comboBox1 ----
comboBox1.setModel(new DefaultComboBoxModel(new String[] {
"Varrock East", "Varrock West", "Falador West" }));
// ---- label2 ----
label2.setText("Location:");
// ---- button1 ----
button1.setText("Start!");
button1.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
button1ActionPerformed(e);
}
});
GroupLayout contentPaneLayout = new GroupLayout(contentPane);
contentPane.setLayout(contentPaneLayout);
contentPaneLayout
.setHorizontalGroup(contentPaneLayout
.createParallelGroup()
.addGroup(
contentPaneLayout
.createSequentialGroup()
.addContainerGap()
.addGroup(
contentPaneLayout
.createParallelGroup()
.addComponent(
label1)
.addGroup(
GroupLayout.Alignment.TRAILING,
contentPaneLayout
.createSequentialGroup()
.addGroup(
contentPaneLayout
.createParallelGroup(
GroupLayout.Alignment.TRAILING)
.addComponent(
button1,
GroupLayout.PREFERRED_SIZE,
94,
GroupLayout.PREFERRED_SIZE)
.addGroup(
contentPaneLayout
.createSequentialGroup()
.addComponent(
label2)
.addPreferredGap(
LayoutStyle.ComponentPlacement.RELATED,
GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(
comboBox1,
GroupLayout.PREFERRED_SIZE,
GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE)))
.addGap(15,
15,
15)))
.addGap(0, 0, 0)));
contentPaneLayout
.setVerticalGroup(contentPaneLayout
.createParallelGroup()
.addGroup(
contentPaneLayout
.createSequentialGroup()
.addContainerGap()
.addComponent(label1)
.addGap(18, 18, 18)
.addGroup(
contentPaneLayout
.createParallelGroup(
GroupLayout.Alignment.BASELINE)
.addComponent(
comboBox1,
GroupLayout.PREFERRED_SIZE,
GroupLayout.DEFAULT_SIZE,
GroupLayout.PREFERRED_SIZE)
.addComponent(
label2))
.addGap(17, 17, 17)
.addComponent(button1)
.addContainerGap()));
setSize(215, 155);
setLocationRelativeTo(getOwner());
// JFormDesigner - End of component initialization
// //GEN-END:initComponents
}
// JFormDesigner - Variables declaration - DO NOT MODIFY
// //GEN-BEGIN:variables
// Generated using JFormDesigner Evaluation license - tom sharratt
private JLabel label1;
private JComboBox comboBox1;
private JLabel label2;
private JButton button1;
// JFormDesigner - End of variables declaration //GEN-END:variables
}
private final Color color1 = new Color(0, 255, 102, 120);
private final Color color2 = new Color(0, 0, 0);
private final BasicStroke stroke1 = new BasicStroke(1);
private final Font font1 = new Font("Verdana", 0, 21);
private final Font font2 = new Font("Verdana", 0, 15);
private final Font font3 = new Font("Verdana", 1, 9);
public void onRepaint(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
millis = System.currentTimeMillis() - startTime;
hours = millis / (1000 * 60 * 60);
millis -= hours * (1000 * 60 * 60);
minutes = millis / (1000 * 60);
millis -= minutes * (1000 * 60);
seconds = millis / 1000;
profit = wialIDPrice * vialsFilled * 28;
g.setColor(color1);
g.fillRect(297, 248, 217, 87);
g.setColor(color2);
g.setStroke(stroke1);
g.drawRect(297, 248, 217, 87);
g.setFont(font1);
g.setColor(color2);
g.drawString("UltimateVialFiller", 301, 273);
g.setFont(font2);
g.drawString("Run time:" + hours + ":" + minutes + ":" + seconds, 301,
293);
g.drawString("Money Gained:" + profit, 301, 311);
g.drawString("Paint made by limu", 301, 330);
g.setFont(font3);
g.drawString("v1.2", 486, 273);
}
public void messageReceived1(MessageEvent e) {
String y = e.getMessage().toLowerCase();
if (y.contains("fill the vial.")) {
vialsFilled++;
}
}
@Override
public void messageReceived(MessageEvent e) {
String x = e.getMessage().toLowerCase();
if (x.contains("fill the vial from the fountain.")) {
vialsFilled++;
}
}
}
Save as: UltimateVialFiller.java
GUI:

Paint:

Proggys:
just to prove it works. (i will post a hour+ proggy after school)


© limu










Back to top
