Home
Sep 10
Friday
Error
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.
  • JHTMLicon not supported. File not found.

else

Runite Miner Recruit code 3 {Now With Manifest}
Thursday, 12 August 2010 15:43
// To find the thread goto powerbot.org and search "Runite miner recruit"


import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.lang.reflect.Method;
import java.util.Map;

import javax.swing.JOptionPane;

import org.rsbot.event.listeners.PaintListener;
import org.rsbot.script.Script;
import org.rsbot.script.methods.Skills;
//import org.rsbot.script.wrappers.RSInterfaceChild;
import org.rsbot.script.wrappers.RSObject;
import org.rsbot.script.wrappers.RSTile;
import org.rsbot.script.Script;
import org.rsbot.script.ScriptManifest;

@ScriptManifest(authors = {"BOOM BOOM"}, category = "Mining", name = "Wilder Miner", version = 1.0, description = ("Start where the runite ore is, with a pickaxe."))

public class WildyMiner extends Script implements
PaintListener {

int[] area_heroesguildfloor1 = new int[] { 2902, 3503, 2891, 3516 };
int[] area_stairs = new int[] { 2893, 9906, 2891, 9908 };
int[] area_stairsup = new int[] { 2894, 3506, 2892, 3509 };
//int[] area_runitemine = new int[] { 2940, 9883, 2936, 9886 };
int[] area_bank = new int[] { 2848, 3537, 2843, 3545 };
RSTile[][] path_tomine = new RSTile[][] { { new RSTile(2903, 9912),
new RSTile(2914, 9912), new RSTile(2928, 9911),
new RSTile(2936, 9901), new RSTile(2936, 9891),
new RSTile(2940, 9884) } };
RSTile[][] path_tomine1 = new RSTile[][] { { new RSTile(2940, 9884),
new RSTile(2935, 9893), new RSTile(2937, 9903),
new RSTile(2928, 9911), new RSTile(2915, 9911),
new RSTile(2901, 9911), new RSTile(2893, 9907) } };
RSTile[][] path_tostairs = new RSTile[][] { { new RSTile(2893, 3508), } };
RSTile doorTile = new RSTile(2901, 3511);
RSTile[][] path_todoor = new RSTile[][] { { new RSTile(2901, 3511), } };
RSTile[][] path_tobank3 = new RSTile[][] { { new RSTile(2843, 3543), } };
RSTile[][] path_tobank = new RSTile[][] { { new RSTile(2902, 3511),
new RSTile(2908, 3521), new RSTile(2898, 3531),
new RSTile(2889, 3542), new RSTile(2877, 3546), } };
RSTile[][] path_tobank2 = new RSTile[][] { { new RSTile(2876, 3546),
new RSTile(2865, 3546), new RSTile(2851, 3546),
new RSTile(2843, 3543), } };
RSTile[][] path_tobank9 = new RSTile[][] { { new RSTile(2843, 3543),
new RSTile(2853, 3546), new RSTile(2865, 3546),
new RSTile(2876, 3546), } };
RSTile[][] path_tobank8 = new RSTile[][] { { new RSTile(2877, 3546),
new RSTile(2890, 3543), new RSTile(2897, 3531),
new RSTile(2908, 3523), new RSTile(2902, 3511), } };

private AlphaComposite makeComposite(float alpha) {
int type = AlphaComposite.SRC_OVER;
return (AlphaComposite.getInstance(type, alpha));
}

int runenergy = 0;
int runepick = 1275;
boolean mineisok = false;
int jade = 4296;
int bankbooth = 2213;
int[] runitemine = { 33078, 33079 };
int[] usedrunitemine = { 33400, 33401 };
int runiteore = 451;
int ladder = 1754;
int ladder2 = 1757;
int door = 2625;
int warguilddoorin = 33439;
int warguilddoorout = 33438;
int profit = 0;
int miningXp = 0;
int runitebanked = 0;
String process;
double profitperminute = 0;
double profitperhour = 0;
double profitpersecond = 0;
long starttime = 0;
long time = 0;
long minutes = 0;
long hours = 0;
long seconds = 0;
boolean heroesguild = false;
boolean wilderness = false;

public double getVersion() {
return 1.8;
}

public String getScriptCategory() {
return "Logik Scripting Inc.";
}

public String getName() {
return "Vidal's Runite Miner EXTREME Free Version";
}

public String getAuthor() {
return "countvidal";
}

/*float avarageXpAHour(long timePassed, String skill, int startXp) {
long tempTime = timePassed / 60 / 60;
float avgTime = (float) tempTime
/ (skills.getCurrentSkillExp(Skills.getStatIndex("skill")) - startXp);
return 1000 / avgTime;
}*/

public String getScriptDescription() {
String html = "";

html += "";
html += "";
html += " Click Here © ";
html += "





Instructions:
";
html += "1. If mining in heroes' guild start inside heroes' guild. Have a rune pick equipped and inventory empty.
";
html += "3. Make sure you have no favorite worlds, all member worlds are first, and MAKE SURE ALL PVP WORLDS ARE NOT ON SCREEN.
";
html += "Where do you want to mine?
";
html += "Heroes' Guild
";

return (html);
}

public void onRepaint(Graphics g) {
double profitperhour;
double profitperminute;
double profitpersecond;
profit = (runitebanked * 15605);
// calc time.
if (starttime == 0) {
starttime = System.currentTimeMillis();
}
// hours, minutes and seconds.
time = System.currentTimeMillis() - starttime;
seconds = time / 1000;
if (seconds >= 60) {
minutes = seconds / 60;
seconds -= minutes * 60;
}
if (minutes >= 60) {
hours = minutes / 60;
minutes -= hours * 60;
}
Graphics2D g2d = (Graphics2D) g;
float alpha = 0.25f;
// int type = AlphaComposite.SRC_OVER;
// AlphaComposite composite = AlphaComposite.getInstance(type, alpha);
g2d.setComposite(makeComposite(alpha));
g2d.setColor(Color.BLACK);
g2d.fillRect(5, 190, 220, 150);
g2d.setColor(Color.YELLOW.darker());
g2d.fillRect(20, 205, 190, 120);
alpha = 1.0f;
// composite = AlphaComposite.getInstance(type, alpha);
g2d.setComposite(makeComposite(alpha));
g2d.setColor(Color.PINK);
g2d.drawString(getName() + " v" + getVersion(), 30, 220);
g2d.drawString("Runite Banked: " + runitebanked + ".", 30, 240);
g2d.drawString("Total Profit: " + profit + "Gp.", 30, 260);
g2d.drawString(hours + ":" + minutes + ":" + seconds, 30, 280);
g2d.drawString(
"Gained "
+ (skills.getCurrentExp(Skills.getIndex("mining")) - miningXp)
+ " mining xp", 30, 300);
// g2d.drawString("Average XP per hour: " + avarageXpAHour(startTime,
// "mining", miningXp), byte0, i1 += 15);
if (hours != 0) {
profitperhour = profit / ((int) hours);
g2d
.drawString("Profit per hour: " + profitperhour + "Gp.",
30, 320);
} else if (minutes != 0) {
profitperminute = profit / ((int) minutes);
g2d.drawString("Profit per minute: " + profitperminute + "Gp.", 30,
320);
} else if (seconds != 0) {
profitpersecond = profit / ((int) seconds);
g2d.drawString("Profit per second: " + profitpersecond + "Gp.", 30,
320);
}
}

public void onFinish() {
log("Thanks for using Vidal's Runite Miner EXTREME!");
log("http://logikscripting.com for more amazing scripts");
}

public boolean onStart(Map args) {
int welcome = JOptionPane
.showConfirmDialog(
null,
"Before using my script, would you like to thank me\nby clicking some adverts?",
"Welcome", JOptionPane.YES_NO_OPTION);
if (welcome == 0) {
String message = "

Thank you for your support!


"
+ "

You will now be redirected to my adverts page.
"
+ "Click the adverts on the page few times a day if you can, remember stay atleast 30 seconds in each page.

"
+ "";
JOptionPane.showMessageDialog(null, message);
//openURL("http://logikscripting.com/thanks/index.html");
}
int anti = JOptionPane
.showConfirmDialog(
null,
"Make sure autologin, and breakhandler anti random/ban are turned off",
"Have Fun!", JOptionPane.OK_OPTION);
if (anti == -1) {
stopScript();
}
int Buy = JOptionPane
.showConfirmDialog(
null,
"Would You Like to Buy the v2.0 Upgrade?\n\n* Added Neitiznot Runite Mining\n* State of The Art Methods\n* Integrated Chat Responder\n* World Hopping now selects ALL Member Worlds\n* Restructured script to make it EXTREMELY fast\n* New flashy paint\n* Checks for updates internally\n* MUCH faster, smoother and stable.",
"Upgrade!", JOptionPane.YES_NO_OPTION);
if (Buy == 0) {
String message = "

Payment


"
+ "

You will now be redirected to PayPal.
" + "

"
+ "";
JOptionPane.showMessageDialog(null, message);
//openURL("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5213062");
}
miningXp = skills.getCurrentExp(Skills.getIndex("mining"));
int choice = Integer.parseInt(args.get("doing"));
switch (choice) {
case 1:
heroesguild = true;
case 2:
wilderness = true;
break;
}
return true;

}

private void climbdownladder() {
sleep(random(600, 700));
RSObject ladder1 = objects.getNearest(ladder);
sleep(random(600, 700));
if (ladder1 == null) {
log("I cant Fucking Find that Damn Ladder! Give me a few seconds, you know bots get drunk too!");
} else {
tiles.doAction(ladder1.getLocation(), "Climb-down Ladder");
sleep(random(2000, 3000));
}
}

private void climbupladder() {
camera.setAltitude(true);
sleep(random(600, 700));
camera.setAngle(90);
RSObject ladder3 = objects.getNearest(ladder2);
if (ladder3 == null) {
log("I cant Fucking Find that Damn Ladder! Give me a few seconds, you know bots get drunk too!");
} else {
tiles.doAction(ladder3.getLocation(), "Climb-up Ladder");
sleep(random(600, 700));
}
}

private void walktoladder() {
walking.reversePath(path_tomine[0]);
}

private void walktodoor() {
walking.walkTileMM(doorTile);
}

private boolean isInBounds(int... bounds) {
boolean result = false;
int x = getMyPlayer().getLocation().getX();
int y = getMyPlayer().getLocation().getY();
if (y <= bounds[0] && y >= bounds[1] && x <= bounds[2]
&& x >= bounds[3]) {
result = true;
}
return result;
}

public boolean isInArea(int maxX, int minY, int minX, int maxY) {
int x = getMyPlayer().getLocation().getX();
int y = getMyPlayer().getLocation().getY();
if (x >= minX && x <= maxX && y >= minY && y <= maxY) {
return true;
}
return false;
}

private void opendwardoor() {
camera.setAngle(270);
RSObject door2 = objects.getNearest(warguilddoorout);
sleep(random(600, 700));
tiles.doAction(door2.getLocation(), "Open Door");
sleep(random(1800, 1900));
}

private void opendoor() {
camera.setAngle(270);
RSObject door1 = objects.getNearest(door);
sleep(random(600, 700));
if (door1 == null) {
log("Im too darn drunk to open the door, give me a sec");
} else {
tiles.doAction(door1.getLocation(), "Open Door");
sleep(random(1800, 1900));
}
}

public void openBank() {
boolean success = false;
RSObject booth = objects.getNearest(bankbooth);
if (calc.distanceTo(booth) > 5) {
//walkToBank();
sleep(random(800, 900));
}
success = booth.doAction("Use-quickly Bank booth");
sleep(random(600, 700));
if (menu.isOpen()) {
menu.doAction("Use-quickly Bank booth");
}
if (!success) {
//walkToBank();
}

}

public void deposit() {
bank.depositAllExcept(runepick);
}

public void walktowardoor() {
walking.walkPathMM(path_tobank9[0], 17);
}

public void walktoherodoor() {
walking.reversePath(path_tobank[0]);
}

public void pathtowardoor() {
walking.walkPathMM(path_tobank[0], 17);
}

public void pathtobank() {
walking.walkPathMM(path_tobank2[0], 17);
}

public boolean worldhop() {
log("Worldhopping, this may take 1-2 Minutes.");
//logout();
if (interfaces.getComponent(744, 580).isValid()) {
process = "World Hopping";
log("Process: " + process);
int x9 = random(345, 415);
int y9 = random(242, 250);
mouse.move(x9, y9);
int positionX = (mouse.getRandomX(1));
int positionY = (mouse.getRandomY(1));
boolean succsess = false;
sleep(random(400, 800));
if (positionX == x9 && positionY == y9) {
succsess = true;
}
if (!succsess) {
worldhop();
}
mouse.click(true);
sleep(random(4000, 6000));

int x10 = random(84, 296);
int y10 = random(148, 450);
mouse.move(x10, y10);
mouse.click(true);
sleep(random(4000, 6000));
boolean loggedin = true;
if (interfaces.getComponent(744, 631).isValid()) {
String text1 = interfaces.getComponent(744, 631)
.getText();
if (text1.equals("World 2")) {
log("This is a Heavily Populated World, Choosing another one");
loggedin = false;
} else if (text1.equals("World 6")) {
log("This is a Heavily Populated World, Choosing another one");
loggedin = false;
} else if (text1.equals("World 143")) {
log("This is a Heavily Populated World, Choosing another one");
loggedin = false;
} else if (text1.equals("World 144")) {
log("This is a Heavily Populated World, Choosing another one");
loggedin = false;
} else if (text1.equals("World 44")) {
log("This is a Heavily Populated World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 65")) {
log("This is a PvP World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 26")) {
log("This is a PvP World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 159")) {
log("This is a PvP World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 124")) {
log("This is a PvP World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 18")) {
log("This is a PvP World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 89")) {
log("This is a PvP World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 59")) {
log("This is a PvP World, Choosing another one");
loggedin = false;

if (!loggedin) {
worldhop();
}

} else if (loggedin && text1 != "World 2" && text1 != "World 6"
&& text1 != "World 143" && text1 != "World 144"
&& text1 != "World 44" && !text1.contains("World 65")
&& !text1.contains("World 26")
&& !text1.contains("World 159")
&& !text1.contains("World 124")
&& !text1.contains("World 18")
&& !text1.contains("World 89")
&& !text1.contains("World 59")) {
//login();
}

}
}
return false;//isLoggedIn();

}

private void checkprocess() {
if (isInArea(2893, 9905, 2891, 9909) && !inventory.isFull()) {
process = "Walking to Runite Mine";
return;
} else if (isInArea(2894, 3506, 2892, 3509) && !inventory.isFull()) {
process = "Going down the stairs";
return;
} else if (isInArea(2902, 3511, 2902, 3511) && !inventory.isFull()) {
process = "Opening Heroes Guild Door";
return;
} else if (isInArea(2877, 3546, 2877, 3546) && !inventory.isFull()) {
process = "Still Walking to Heroes Guild";
return;
} else if (isInArea(2901, 3503, 2891, 3516) && !inventory.isFull()) {
process = "Walking to Stairs";
return;
} else if (isInArea(2848, 3537, 2843, 3545) && !inventory.isFull()) {
process = "Walking to Heroes Guild";
return;
} else if (isInArea(2902, 3510, 2902, 3511) && inventory.isFull()) {
process = "Walking to Bank";
return;
} else if (isInArea(2901, 3503, 2891, 3516) && inventory.isFull()) {
process = "Walking to Heroes Guild Door";
return;
} else if (isInArea(2876, 3546, 2876, 3546) && inventory.isFull()) {
process = "Still Walking to Bank";
return;
} else if (isInArea(2845, 3541, 2843, 3545) && inventory.isFull()) {
process = "Banking Runite Ore";
return;
} else if (isInArea(2894, 9904, 2890, 9909) && inventory.isFull()) {
process = "Going up the stairs";
return;
} else if (isInArea(2940, 9883, 2936, 9886) && inventory.isFull()) {
process = "Inventory is full, Walking to Bank";
return;
} else if (isInArea(2940, 9883, 2936, 9886)) {
process = "Mining Runite Ore";
return;
}
}

public void bank() {
try {
int before = inventory.getCount(runiteore);
deposit();
sleep(500);
int after = inventory.getCount(runiteore);
if (after < before) {
runitebanked += before - after;
}
sleep(random(800, 1000));
bank.close();
checkprocess();
return;
} catch (Exception e) {
}
}

public int loop() {
int sleeplength = 800;
if (heroesguild) {
checkprocess();
if (process.equals("Walking to Stairs")) {
sleep(random(800, 1000));
if (!getMyPlayer().isMoving()) {
walking.walkPathMM(path_tostairs[0], 17);
}
} else if (process.equals("Walking to Heroes Guild Door")) {
if (!getMyPlayer().isMoving()) {
walktodoor();
}
sleep(random(5000, 10000));
if (!getMyPlayer().isMoving()) {
opendoor();
}
} else if (process.equals("Walking to Bank")) {
if (isInArea(2877, 3546, 2877, 3546)) {
if (!getMyPlayer().isMoving()) {
opendwardoor();
}
} else {
sleep(random(800, 1000));
if (!getMyPlayer().isMoving()) {
walking.walkPathMM(path_tobank[0], 17);
}
}
} else if (process.equals("Banking Runite Ore")) {
openBank();
if (bank.getInterface().isValid()) {
bank();
}

} else if (process.equals("Still Walking to Bank")) {
sleep(random(800, 1000));
if (!getMyPlayer().isMoving()) {
walking.walkPathMM(path_tobank2[0], 14);
}
} else if (process.equals("Opening Heroes Guild Door")) {
if (isInArea(2902, 3511, 2902, 3511)) {
if (!getMyPlayer().isMoving()) {
opendoor();
}
}
} else if (process.equals("Walking to Heroes Guild")) {
if (isInArea(2876, 3545, 2875, 3547)) {
if (!getMyPlayer().isMoving()) {
opendwardoor();
}
} else {
sleep(random(800, 1000));
if (!getMyPlayer().isMoving()) {
walking.walkPathMM(path_tobank9[0], 17);
}
}
} else if (process.equals("Still Walking to Heroes Guild")) {
if (isInArea(2902, 3511, 2902, 3511)) {
if (!getMyPlayer().isMoving()) {
opendoor();
}
} else {
sleep(random(800, 1000));
if (!getMyPlayer().isMoving()) {
walking.walkPathMM(path_tobank8[0], 17);
}
}
} else if (process.equals("Going down the stairs")) {
if (!getMyPlayer().isMoving()) {
climbdownladder();
}
} else if (process.equals("Walking to Runite Mine")) {
sleep(random(800, 1000));
if (!getMyPlayer().isMoving()) {
camera.setAngle(random(1, 359));
walking.reversePath(path_tomine1[0]);
}
} else if (process.equals("Going up the stairs")) {
if (!getMyPlayer().isMoving()) {
climbupladder();
}
} else if (process.equals("Inventory is full, Walking to Bank")) {
runenergy = random(30, 80);
run(runenergy);
sleep(random(800, 1000));
if (!getMyPlayer().isMoving()) {
camera.setAngle(random(1, 359));
walking.walkPathMM(path_tomine1[0], 14);
}
} else if (process.equals("Mining Runite Ore")) {
RSObject ore = objects.getNearest(runitemine);
if (ore == null)
worldhop();
else {
minerocks();
}
}
}
return sleeplength;

}

public boolean minerocks() {
int runiteOre[] = { 33078, 33079 };
final RSObject r = objects.getNearest(runiteOre);
try {
if (calc.distanceTo(r) <= 10) {
tiles.doAction(r.getLocation(), "Mine");
while (getMyPlayer().isMoving()) {
return false;
}
sleep(random(4000, 6000));
} else {
walking.walkTo(r.getLocation());
}
} catch (Exception e) {
}
return false;
}

/*public boolean onTile(RSObject tile, String search, String action) {
if (!tile.equals(tile)) {
return false;
}

//Point checkScreen = calc.tileToScreen(tile);
if (!tile.isOnScreen()) {
walking.walkTileMM(tile.getLocation());
sleep(random(340, 700));
}

try {
Point screenLoc = null;
for (int i = 0; i < 30; i++) {
screenLoc = Calculations.tileToScreen(tile);
if (!pointOnScreen(screenLoc)) {
return false;
}
if (getMenuItems().get(0).toLowerCase().contains(
search.toLowerCase())) {
break;
}
if (getMouseLocation().equals(screenLoc)) {
break;
}
moveMouse(screenLoc);
}
screenLoc = Calculations.tileToScreen(tile);
if (getMenuItems().size() <= 1) {
return false;
}
if (getMenuItems().get(0).toLowerCase().contains(
action.toLowerCase())) {
clickMouse(true);
return true;
} else {
clickMouse(false);
return atMenu(action);
}
} catch (Exception e) {
e.printStackTrace();
return false;
}
}*/

/*public void openURL(String url) { // Credits to Ruski who gave credits to
// Dave who gave credits to some guy who
// made this.

String osName = System.getProperty("os.name");

try {

if (osName.startsWith("Mac OS")) {

Class fileMgr = Class.forName("com.apple.eio.FileManager");

Method openURL = fileMgr.getDeclaredMethod("openURL",

new Class[] { String.class });

openURL.invoke(null, new Object[] { url });

} else if (osName.startsWith("Windows"))

Runtime.getRuntime()*****c(

"rundll32 url.dll,FileProtocolHandler " + url);

else {

String[] browsers = { "firefox", "opera", "konqueror",

"epiphany", "mozilla", "netscape" };

String browser = null;

for (int count = 0; count < browsers.length && browser == null; count++)

if (Runtime.getRuntime()*****c(

new String[] { "which", browsers[count] })

.waitFor() == 0)

browser = browsers[count];

if (browser == null)

throw new Exception("Could not find web browser");

else

Runtime.getRuntime()*****c(new String[] { browser, url });

}

} catch (Exception e) {

}

}*/

private void run(int minimum) {
if (walking.getEnergy() >= random(60, 80) && !walking.isRunEnabled()) {
walking.setRun(true);
}
}

private int distanceTo(int[] usedrunitemine2) {
return 0;
}

}

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/V1OY8pfmTTY/12037

 
Runite Miner Recruit code 2
Saturday, 07 August 2010 18:35
// To find the thread goto powerbot.org and search "Runite miner recruit"


import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.lang.reflect.Method;
import java.util.Map;

import javax.swing.JOptionPane;

import org.rsbot.event.listeners.PaintListener;
import org.rsbot.script.Script;
import org.rsbot.script.methods.Skills;
//import org.rsbot.script.wrappers.RSInterfaceChild;
import org.rsbot.script.wrappers.RSObject;
import org.rsbot.script.wrappers.RSTile;

public class WildyMiner extends Script implements
PaintListener {

int[] area_heroesguildfloor1 = new int[] { 2902, 3503, 2891, 3516 };
int[] area_stairs = new int[] { 2893, 9906, 2891, 9908 };
int[] area_stairsup = new int[] { 2894, 3506, 2892, 3509 };
//int[] area_runitemine = new int[] { 2940, 9883, 2936, 9886 };
int[] area_bank = new int[] { 2848, 3537, 2843, 3545 };
RSTile[][] path_tomine = new RSTile[][] { { new RSTile(2903, 9912),
new RSTile(2914, 9912), new RSTile(2928, 9911),
new RSTile(2936, 9901), new RSTile(2936, 9891),
new RSTile(2940, 9884) } };
RSTile[][] path_tomine1 = new RSTile[][] { { new RSTile(2940, 9884),
new RSTile(2935, 9893), new RSTile(2937, 9903),
new RSTile(2928, 9911), new RSTile(2915, 9911),
new RSTile(2901, 9911), new RSTile(2893, 9907) } };
RSTile[][] path_tostairs = new RSTile[][] { { new RSTile(2893, 3508), } };
RSTile doorTile = new RSTile(2901, 3511);
RSTile[][] path_todoor = new RSTile[][] { { new RSTile(2901, 3511), } };
RSTile[][] path_tobank3 = new RSTile[][] { { new RSTile(2843, 3543), } };
RSTile[][] path_tobank = new RSTile[][] { { new RSTile(2902, 3511),
new RSTile(2908, 3521), new RSTile(2898, 3531),
new RSTile(2889, 3542), new RSTile(2877, 3546), } };
RSTile[][] path_tobank2 = new RSTile[][] { { new RSTile(2876, 3546),
new RSTile(2865, 3546), new RSTile(2851, 3546),
new RSTile(2843, 3543), } };
RSTile[][] path_tobank9 = new RSTile[][] { { new RSTile(2843, 3543),
new RSTile(2853, 3546), new RSTile(2865, 3546),
new RSTile(2876, 3546), } };
RSTile[][] path_tobank8 = new RSTile[][] { { new RSTile(2877, 3546),
new RSTile(2890, 3543), new RSTile(2897, 3531),
new RSTile(2908, 3523), new RSTile(2902, 3511), } };

private AlphaComposite makeComposite(float alpha) {
int type = AlphaComposite.SRC_OVER;
return (AlphaComposite.getInstance(type, alpha));
}

int runenergy = 0;
int runepick = 1275;
boolean mineisok = false;
int jade = 4296;
int bankbooth = 2213;
int[] runitemine = { 33078, 33079 };
int[] usedrunitemine = { 33400, 33401 };
int runiteore = 451;
int ladder = 1754;
int ladder2 = 1757;
int door = 2625;
int warguilddoorin = 33439;
int warguilddoorout = 33438;
int profit = 0;
int miningXp = 0;
int runitebanked = 0;
String process;
double profitperminute = 0;
double profitperhour = 0;
double profitpersecond = 0;
long starttime = 0;
long time = 0;
long minutes = 0;
long hours = 0;
long seconds = 0;
boolean heroesguild = false;
boolean wilderness = false;

public double getVersion() {
return 1.8;
}

public String getScriptCategory() {
return "Logik Scripting Inc.";
}

public String getName() {
return "Vidal's Runite Miner EXTREME Free Version";
}

public String getAuthor() {
return "countvidal";
}

/*float avarageXpAHour(long timePassed, String skill, int startXp) {
long tempTime = timePassed / 60 / 60;
float avgTime = (float) tempTime
/ (skills.getCurrentSkillExp(Skills.getStatIndex("skill")) - startXp);
return 1000 / avgTime;
}*/

public String getScriptDescription() {
String html = "";

html += "";
html += "";
html += " Click Here © ";
html += "





Instructions:
";
html += "1. If mining in heroes' guild start inside heroes' guild. Have a rune pick equipped and inventory empty.
";
html += "3. Make sure you have no favorite worlds, all member worlds are first, and MAKE SURE ALL PVP WORLDS ARE NOT ON SCREEN.
";
html += "Where do you want to mine?
";
html += "Heroes' Guild
";

return (html);
}

public void onRepaint(Graphics g) {
double profitperhour;
double profitperminute;
double profitpersecond;
profit = (runitebanked * 15605);
// calc time.
if (starttime == 0) {
starttime = System.currentTimeMillis();
}
// hours, minutes and seconds.
time = System.currentTimeMillis() - starttime;
seconds = time / 1000;
if (seconds >= 60) {
minutes = seconds / 60;
seconds -= minutes * 60;
}
if (minutes >= 60) {
hours = minutes / 60;
minutes -= hours * 60;
}
Graphics2D g2d = (Graphics2D) g;
float alpha = 0.25f;
// int type = AlphaComposite.SRC_OVER;
// AlphaComposite composite = AlphaComposite.getInstance(type, alpha);
g2d.setComposite(makeComposite(alpha));
g2d.setColor(Color.BLACK);
g2d.fillRect(5, 190, 220, 150);
g2d.setColor(Color.YELLOW.darker());
g2d.fillRect(20, 205, 190, 120);
alpha = 1.0f;
// composite = AlphaComposite.getInstance(type, alpha);
g2d.setComposite(makeComposite(alpha));
g2d.setColor(Color.PINK);
g2d.drawString(getName() + " v" + getVersion(), 30, 220);
g2d.drawString("Runite Banked: " + runitebanked + ".", 30, 240);
g2d.drawString("Total Profit: " + profit + "Gp.", 30, 260);
g2d.drawString(hours + ":" + minutes + ":" + seconds, 30, 280);
g2d.drawString(
"Gained "
+ (skills.getCurrentExp(Skills.getIndex("mining")) - miningXp)
+ " mining xp", 30, 300);
// g2d.drawString("Average XP per hour: " + avarageXpAHour(startTime,
// "mining", miningXp), byte0, i1 += 15);
if (hours != 0) {
profitperhour = profit / ((int) hours);
g2d
.drawString("Profit per hour: " + profitperhour + "Gp.",
30, 320);
} else if (minutes != 0) {
profitperminute = profit / ((int) minutes);
g2d.drawString("Profit per minute: " + profitperminute + "Gp.", 30,
320);
} else if (seconds != 0) {
profitpersecond = profit / ((int) seconds);
g2d.drawString("Profit per second: " + profitpersecond + "Gp.", 30,
320);
}
}

public void onFinish() {
log("Thanks for using Vidal's Runite Miner EXTREME!");
log("http://logikscripting.com for more amazing scripts");
}

public boolean onStart(Map args) {
int welcome = JOptionPane
.showConfirmDialog(
null,
"Before using my script, would you like to thank me\nby clicking some adverts?",
"Welcome", JOptionPane.YES_NO_OPTION);
if (welcome == 0) {
String message = "

Thank you for your support!


"
+ "

You will now be redirected to my adverts page.
"
+ "Click the adverts on the page few times a day if you can, remember stay atleast 30 seconds in each page.

"
+ "";
JOptionPane.showMessageDialog(null, message);
openURL("http://logikscripting.com/thanks/index.html");
}
int anti = JOptionPane
.showConfirmDialog(
null,
"Make sure autologin, and breakhandler anti random/ban are turned off",
"Have Fun!", JOptionPane.OK_OPTION);
if (anti == -1) {
stopScript();
}
int Buy = JOptionPane
.showConfirmDialog(
null,
"Would You Like to Buy the v2.0 Upgrade?\n\n* Added Neitiznot Runite Mining\n* State of The Art Methods\n* Integrated Chat Responder\n* World Hopping now selects ALL Member Worlds\n* Restructured script to make it EXTREMELY fast\n* New flashy paint\n* Checks for updates internally\n* MUCH faster, smoother and stable.",
"Upgrade!", JOptionPane.YES_NO_OPTION);
if (Buy == 0) {
String message = "

Payment


"
+ "

You will now be redirected to PayPal.
" + "

"
+ "";
JOptionPane.showMessageDialog(null, message);
openURL("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5213062");
}
miningXp = skills.getCurrentExp(Skills.getIndex("mining"));
int choice = Integer.parseInt(args.get("doing"));
switch (choice) {
case 1:
heroesguild = true;
case 2:
wilderness = true;
break;
}
return true;

}

private void climbdownladder() {
sleep(random(600, 700));
RSObject ladder1 = objects.getNearest(ladder);
sleep(random(600, 700));
if (ladder1 == null) {
log("I cant Fucking Find that Damn Ladder! Give me a few seconds, you know bots get drunk too!");
} else {
tiles.doAction(ladder1.getLocation(), "Climb-down Ladder");
sleep(random(2000, 3000));
}
}

private void climbupladder() {
camera.setAltitude(true);
sleep(random(600, 700));
camera.setAngle(90);
RSObject ladder3 = objects.getNearest(ladder2);
if (ladder3 == null) {
log("I cant Fucking Find that Damn Ladder! Give me a few seconds, you know bots get drunk too!");
} else {
tiles.doAction(ladder3.getLocation(), "Climb-up Ladder");
sleep(random(600, 700));
}
}

private void walktoladder() {
walking.reversePath(path_tomine[0]);
}

private void walktodoor() {
walking.walkTileMM(doorTile);
}

private boolean isInBounds(int... bounds) {
boolean result = false;
int x = getMyPlayer().getLocation().getX();
int y = getMyPlayer().getLocation().getY();
if (y <= bounds[0] && y >= bounds[1] && x <= bounds[2]
&& x >= bounds[3]) {
result = true;
}
return result;
}

public boolean isInArea(int maxX, int minY, int minX, int maxY) {
int x = getMyPlayer().getLocation().getX();
int y = getMyPlayer().getLocation().getY();
if (x >= minX && x <= maxX && y >= minY && y <= maxY) {
return true;
}
return false;
}

private void opendwardoor() {
camera.setAngle(270);
RSObject door2 = objects.getNearest(warguilddoorout);
sleep(random(600, 700));
tiles.doAction(door2.getLocation(), "Open Door");
sleep(random(1800, 1900));
}

private void opendoor() {
camera.setAngle(270);
RSObject door1 = objects.getNearest(door);
sleep(random(600, 700));
if (door1 == null) {
log("Im too darn drunk to open the door, give me a sec");
} else {
tiles.doAction(door1.getLocation(), "Open Door");
sleep(random(1800, 1900));
}
}

public void openBank() {
boolean success = false;
RSObject booth = objects.getNearest(bankbooth);
if (calc.distanceTo(booth) > 5) {
//walkToBank();
sleep(random(800, 900));
}
success = booth.doAction("Use-quickly Bank booth");
sleep(random(600, 700));
if (menu.isOpen()) {
menu.doAction("Use-quickly Bank booth");
}
if (!success) {
//walkToBank();
}

}

public void deposit() {
bank.depositAllExcept(runepick);
}

public void walktowardoor() {
walking.walkPathMM(path_tobank9[0], 17);
}

public void walktoherodoor() {
walking.reversePath(path_tobank[0]);
}

public void pathtowardoor() {
walking.walkPathMM(path_tobank[0], 17);
}

public void pathtobank() {
walking.walkPathMM(path_tobank2[0], 17);
}

public boolean worldhop() {
log("Worldhopping, this may take 1-2 Minutes.");
//logout();
if (interfaces.getComponent(744, 580).isValid()) {
process = "World Hopping";
log("Process: " + process);
int x9 = random(345, 415);
int y9 = random(242, 250);
mouse.move(x9, y9);
int positionX = (mouse.getRandomX(1));
int positionY = (mouse.getRandomY(1));
boolean succsess = false;
sleep(random(400, 800));
if (positionX == x9 && positionY == y9) {
succsess = true;
}
if (!succsess) {
worldhop();
}
mouse.click(true);
sleep(random(4000, 6000));

int x10 = random(84, 296);
int y10 = random(148, 450);
mouse.move(x10, y10);
mouse.click(true);
sleep(random(4000, 6000));
boolean loggedin = true;
if (interfaces.getComponent(744, 631).isValid()) {
String text1 = interfaces.getComponent(744, 631)
.getText();
if (text1.equals("World 2")) {
log("This is a Heavily Populated World, Choosing another one");
loggedin = false;
} else if (text1.equals("World 6")) {
log("This is a Heavily Populated World, Choosing another one");
loggedin = false;
} else if (text1.equals("World 143")) {
log("This is a Heavily Populated World, Choosing another one");
loggedin = false;
} else if (text1.equals("World 144")) {
log("This is a Heavily Populated World, Choosing another one");
loggedin = false;
} else if (text1.equals("World 44")) {
log("This is a Heavily Populated World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 65")) {
log("This is a PvP World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 26")) {
log("This is a PvP World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 159")) {
log("This is a PvP World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 124")) {
log("This is a PvP World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 18")) {
log("This is a PvP World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 89")) {
log("This is a PvP World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 59")) {
log("This is a PvP World, Choosing another one");
loggedin = false;

if (!loggedin) {
worldhop();
}

} else if (loggedin && text1 != "World 2" && text1 != "World 6"
&& text1 != "World 143" && text1 != "World 144"
&& text1 != "World 44" && !text1.contains("World 65")
&& !text1.contains("World 26")
&& !text1.contains("World 159")
&& !text1.contains("World 124")
&& !text1.contains("World 18")
&& !text1.contains("World 89")
&& !text1.contains("World 59")) {
//login();
}

}
}
return false;//isLoggedIn();

}

private void checkprocess() {
if (isInArea(2893, 9905, 2891, 9909) && !inventory.isFull()) {
process = "Walking to Runite Mine";
return;
} else if (isInArea(2894, 3506, 2892, 3509) && !inventory.isFull()) {
process = "Going down the stairs";
return;
} else if (isInArea(2902, 3511, 2902, 3511) && !inventory.isFull()) {
process = "Opening Heroes Guild Door";
return;
} else if (isInArea(2877, 3546, 2877, 3546) && !inventory.isFull()) {
process = "Still Walking to Heroes Guild";
return;
} else if (isInArea(2901, 3503, 2891, 3516) && !inventory.isFull()) {
process = "Walking to Stairs";
return;
} else if (isInArea(2848, 3537, 2843, 3545) && !inventory.isFull()) {
process = "Walking to Heroes Guild";
return;
} else if (isInArea(2902, 3510, 2902, 3511) && inventory.isFull()) {
process = "Walking to Bank";
return;
} else if (isInArea(2901, 3503, 2891, 3516) && inventory.isFull()) {
process = "Walking to Heroes Guild Door";
return;
} else if (isInArea(2876, 3546, 2876, 3546) && inventory.isFull()) {
process = "Still Walking to Bank";
return;
} else if (isInArea(2845, 3541, 2843, 3545) && inventory.isFull()) {
process = "Banking Runite Ore";
return;
} else if (isInArea(2894, 9904, 2890, 9909) && inventory.isFull()) {
process = "Going up the stairs";
return;
} else if (isInArea(2940, 9883, 2936, 9886) && inventory.isFull()) {
process = "Inventory is full, Walking to Bank";
return;
} else if (isInArea(2940, 9883, 2936, 9886)) {
process = "Mining Runite Ore";
return;
}
}

public void bank() {
try {
int before = inventory.getCount(runiteore);
deposit();
sleep(500);
int after = inventory.getCount(runiteore);
if (after < before) {
runitebanked += before - after;
}
sleep(random(800, 1000));
bank.close();
checkprocess();
return;
} catch (Exception e) {
}
}

public int loop() {
int sleeplength = 800;
if (heroesguild) {
checkprocess();
if (process.equals("Walking to Stairs")) {
sleep(random(800, 1000));
if (!getMyPlayer().isMoving()) {
walking.walkPathMM(path_tostairs[0], 17);
}
} else if (process.equals("Walking to Heroes Guild Door")) {
if (!getMyPlayer().isMoving()) {
walktodoor();
}
sleep(random(5000, 10000));
if (!getMyPlayer().isMoving()) {
opendoor();
}
} else if (process.equals("Walking to Bank")) {
if (isInArea(2877, 3546, 2877, 3546)) {
if (!getMyPlayer().isMoving()) {
opendwardoor();
}
} else {
sleep(random(800, 1000));
if (!getMyPlayer().isMoving()) {
walking.walkPathMM(path_tobank[0], 17);
}
}
} else if (process.equals("Banking Runite Ore")) {
openBank();
if (bank.getInterface().isValid()) {
bank();
}

} else if (process.equals("Still Walking to Bank")) {
sleep(random(800, 1000));
if (!getMyPlayer().isMoving()) {
walking.walkPathMM(path_tobank2[0], 14);
}
} else if (process.equals("Opening Heroes Guild Door")) {
if (isInArea(2902, 3511, 2902, 3511)) {
if (!getMyPlayer().isMoving()) {
opendoor();
}
}
} else if (process.equals("Walking to Heroes Guild")) {
if (isInArea(2876, 3545, 2875, 3547)) {
if (!getMyPlayer().isMoving()) {
opendwardoor();
}
} else {
sleep(random(800, 1000));
if (!getMyPlayer().isMoving()) {
walking.walkPathMM(path_tobank9[0], 17);
}
}
} else if (process.equals("Still Walking to Heroes Guild")) {
if (isInArea(2902, 3511, 2902, 3511)) {
if (!getMyPlayer().isMoving()) {
opendoor();
}
} else {
sleep(random(800, 1000));
if (!getMyPlayer().isMoving()) {
walking.walkPathMM(path_tobank8[0], 17);
}
}
} else if (process.equals("Going down the stairs")) {
if (!getMyPlayer().isMoving()) {
climbdownladder();
}
} else if (process.equals("Walking to Runite Mine")) {
sleep(random(800, 1000));
if (!getMyPlayer().isMoving()) {
camera.setAngle(random(1, 359));
walking.reversePath(path_tomine1[0]);
}
} else if (process.equals("Going up the stairs")) {
if (!getMyPlayer().isMoving()) {
climbupladder();
}
} else if (process.equals("Inventory is full, Walking to Bank")) {
runenergy = random(30, 80);
run(runenergy);
sleep(random(800, 1000));
if (!getMyPlayer().isMoving()) {
camera.setAngle(random(1, 359));
walking.walkPathMM(path_tomine1[0], 14);
}
} else if (process.equals("Mining Runite Ore")) {
RSObject ore = objects.getNearest(runitemine);
if (ore == null)
worldhop();
else {
minerocks();
}
}
}
return sleeplength;

}

public boolean minerocks() {
int runiteOre[] = { 33078, 33079 };
final RSObject r = objects.getNearest(runiteOre);
try {
if (calc.distanceTo(r) <= 10) {
tiles.doAction(r.getLocation(), "Mine");
while (getMyPlayer().isMoving()) {
return false;
}
sleep(random(4000, 6000));
} else {
walking.walkTo(r.getLocation());
}
} catch (Exception e) {
}
return false;
}

/*public boolean onTile(RSObject tile, String search, String action) {
if (!tile.equals(tile)) {
return false;
}

//Point checkScreen = calc.tileToScreen(tile);
if (!tile.isOnScreen()) {
walking.walkTileMM(tile.getLocation());
sleep(random(340, 700));
}

try {
Point screenLoc = null;
for (int i = 0; i < 30; i++) {
screenLoc = Calculations.tileToScreen(tile);
if (!pointOnScreen(screenLoc)) {
return false;
}
if (getMenuItems().get(0).toLowerCase().contains(
search.toLowerCase())) {
break;
}
if (getMouseLocation().equals(screenLoc)) {
break;
}
moveMouse(screenLoc);
}
screenLoc = Calculations.tileToScreen(tile);
if (getMenuItems().size() <= 1) {
return false;
}
if (getMenuItems().get(0).toLowerCase().contains(
action.toLowerCase())) {
clickMouse(true);
return true;
} else {
clickMouse(false);
return atMenu(action);
}
} catch (Exception e) {
e.printStackTrace();
return false;
}
}*/

public void openURL(String url) { // Credits to Ruski who gave credits to
// Dave who gave credits to some guy who
// made this.

String osName = System.getProperty("os.name");

try {

if (osName.startsWith("Mac OS")) {

Class fileMgr = Class.forName("com.apple.eio.FileManager");

Method openURL = fileMgr.getDeclaredMethod("openURL",

new Class[] { String.class });

openURL.invoke(null, new Object[] { url });

} else if (osName.startsWith("Windows"))

Runtime.getRuntime().exec(

"rundll32 url.dll,FileProtocolHandler " + url);

else {

String[] browsers = { "firefox", "opera", "konqueror",

"epiphany", "mozilla", "netscape" };

String browser = null;

for (int count = 0; count < browsers.length && browser == null; count++)

if (Runtime.getRuntime().exec(

new String[] { "which", browsers[count] })

.waitFor() == 0)

browser = browsers[count];

if (browser == null)

throw new Exception("Could not find web browser");

else

Runtime.getRuntime().exec(new String[] { browser, url });

}

} catch (Exception e) {

}

}

private void run(int minimum) {
if (walking.getEnergy() >= random(60, 80) && !walking.isRunEnabled()) {
walking.setRun(true);
}
}

private int distanceTo(int[] usedrunitemine2) {
return 0;
}

}

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/Ua11ZsQw9FA/11997

 
Runite Miner Recruit code 1
Saturday, 07 August 2010 18:29
// To find the thread goto powerbot.org and search "Runite miner recruit"


import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.lang.reflect.Method;
import java.util.Map;

import javax.swing.JOptionPane;

import com.speljohan.rsbot.account.Account;
import com.speljohan.rsbot.bot.Bot;
import com.speljohan.rsbot.event.listeners.PaintListener;
import com.speljohan.rsbot.script.Calculations;
import com.speljohan.rsbot.script.Script;
import com.speljohan.rsbot.script.Skills;
import com.speljohan.rsbot.script.wrappers.RSInterface;
import com.speljohan.rsbot.script.wrappers.RSInterfaceChild;
import com.speljohan.rsbot.script.wrappers.RSObject;
import com.speljohan.rsbot.script.wrappers.RSTile;

public class VidalsRuniteMinerFreeVersion extends Script implements
PaintListener {

int[] area_heroesguildfloor1 = new int[] { 2902, 3503, 2891, 3516 };
int[] area_stairs = new int[] { 2893, 9906, 2891, 9908 };
int[] area_stairsup = new int[] { 2894, 3506, 2892, 3509 };
int[] area_runitemine = new int[] { 2940, 9883, 2936, 9886 };
int[] area_bank = new int[] { 2848, 3537, 2843, 3545 };
RSTile[][] path_tomine = new RSTile[][] { { new RSTile(2903, 9912),
new RSTile(2914, 9912), new RSTile(2928, 9911),
new RSTile(2936, 9901), new RSTile(2936, 9891),
new RSTile(2940, 9884) } };
RSTile[][] path_tomine1 = new RSTile[][] { { new RSTile(2940, 9884),
new RSTile(2935, 9893), new RSTile(2937, 9903),
new RSTile(2928, 9911), new RSTile(2915, 9911),
new RSTile(2901, 9911), new RSTile(2893, 9907) } };
RSTile[][] path_tostairs = new RSTile[][] { { new RSTile(2893, 3508), } };
RSTile doorTile = new RSTile(2901, 3511);
RSTile[][] path_todoor = new RSTile[][] { { new RSTile(2901, 3511), } };
RSTile[][] path_tobank3 = new RSTile[][] { { new RSTile(2843, 3543), } };
RSTile[][] path_tobank = new RSTile[][] { { new RSTile(2902, 3511),
new RSTile(2908, 3521), new RSTile(2898, 3531),
new RSTile(2889, 3542), new RSTile(2877, 3546), } };
RSTile[][] path_tobank2 = new RSTile[][] { { new RSTile(2876, 3546),
new RSTile(2865, 3546), new RSTile(2851, 3546),
new RSTile(2843, 3543), } };
RSTile[][] path_tobank9 = new RSTile[][] { { new RSTile(2843, 3543),
new RSTile(2853, 3546), new RSTile(2865, 3546),
new RSTile(2876, 3546), } };
RSTile[][] path_tobank8 = new RSTile[][] { { new RSTile(2877, 3546),
new RSTile(2890, 3543), new RSTile(2897, 3531),
new RSTile(2908, 3523), new RSTile(2902, 3511), } };

private AlphaComposite makeComposite(float alpha) {
int type = AlphaComposite.SRC_OVER;
return (AlphaComposite.getInstance(type, alpha));
}

int runenergy = 0;
int runepick = 1275;
boolean mineisok = false;
int jade = 4296;
int bankbooth = 2213;
int[] runitemine = { 33078, 33079 };
int[] usedrunitemine = { 33400, 33401 };
int runiteore = 451;
int ladder = 1754;
int ladder2 = 1757;
int door = 2625;
int warguilddoorin = 33439;
int warguilddoorout = 33438;
int profit = 0;
int miningXp = 0;
int runitebanked = 0;
String process;
double profitperminute = 0;
double profitperhour = 0;
double profitpersecond = 0;
long starttime = 0;
long time = 0;
long minutes = 0;
long hours = 0;
long seconds = 0;
boolean heroesguild = false;
boolean wilderness = false;

public double getVersion() {
return 1.8;
}

public String getScriptCategory() {
return "Logik Scripting Inc.";
}

public String getName() {
return "Vidal's Runite Miner EXTREME Free Version";
}

public String getAuthor() {
return "countvidal";
}

float avarageXpAHour(long timePassed, String skill, int startXp) {
long tempTime = timePassed / 60 / 60;
float avgTime = (float) tempTime
/ (skills.getCurrentSkillExp(Skills.getStatIndex("skill")) - startXp);
return 1000 / avgTime;
}

public String getScriptDescription() {
String html = "";

html += "";
html += "";
html += " Click Here © ";
html += "





Instructions:
";
html += "1. If mining in heroes' guild start inside heroes' guild. Have a rune pick equipped and inventory empty.
";
html += "3. Make sure you have no favorite worlds, all member worlds are first, and MAKE SURE ALL PVP WORLDS ARE NOT ON SCREEN.
";
html += "Where do you want to mine?
";
html += "Heroes' Guild
";

return (html);
}

public void onRepaint(Graphics g) {
double profitperhour;
double profitperminute;
double profitpersecond;
profit = (runitebanked * 15605);
// calc time.
if (starttime == 0) {
starttime = System.currentTimeMillis();
}
// hours, minutes and seconds.
time = System.currentTimeMillis() - starttime;
seconds = time / 1000;
if (seconds >= 60) {
minutes = seconds / 60;
seconds -= minutes * 60;
}
if (minutes >= 60) {
hours = minutes / 60;
minutes -= hours * 60;
}
Graphics2D g2d = (Graphics2D) g;
float alpha = 0.25f;
// int type = AlphaComposite.SRC_OVER;
// AlphaComposite composite = AlphaComposite.getInstance(type, alpha);
g2d.setComposite(makeComposite(alpha));
g2d.setColor(Color.BLACK);
g2d.fillRect(5, 190, 220, 150);
g2d.setColor(Color.YELLOW.darker());
g2d.fillRect(20, 205, 190, 120);
alpha = 1.0f;
// composite = AlphaComposite.getInstance(type, alpha);
g2d.setComposite(makeComposite(alpha));
g2d.setColor(Color.PINK);
g2d.drawString(getName() + " v" + getVersion(), 30, 220);
g2d.drawString("Runite Banked: " + runitebanked + ".", 30, 240);
g2d.drawString("Total Profit: " + profit + "Gp.", 30, 260);
g2d.drawString(hours + ":" + minutes + ":" + seconds, 30, 280);
g2d.drawString(
"Gained "
+ (skills.getCurrentSkillExp(Skills
.getStatIndex("mining")) - miningXp)
+ " mining xp", 30, 300);
// g2d.drawString("Average XP per hour: " + avarageXpAHour(startTime,
// "mining", miningXp), byte0, i1 += 15);
if (hours != 0) {
profitperhour = profit / ((int) hours);
g2d
.drawString("Profit per hour: " + profitperhour + "Gp.",
30, 320);
} else if (minutes != 0) {
profitperminute = profit / ((int) minutes);
g2d.drawString("Profit per minute: " + profitperminute + "Gp.", 30,
320);
} else if (seconds != 0) {
profitpersecond = profit / ((int) seconds);
g2d.drawString("Profit per second: " + profitpersecond + "Gp.", 30,
320);
}
}

public void onFinish() {
log("Thanks for using Vidal's Runite Miner EXTREME!");
log("http://logikscripting.com for more amazing scripts");
}

public boolean onStart(Map args) {
int welcome = JOptionPane
.showConfirmDialog(
null,
"Before using my script, would you like to thank me\nby clicking some adverts?",
"Welcome", JOptionPane.YES_NO_OPTION);
if (welcome == 0) {
String message = "

Thank you for your support!


"
+ "

You will now be redirected to my adverts page.
"
+ "Click the adverts on the page few times a day if you can, remember stay atleast 30 seconds in each page.

"
+ "";
JOptionPane.showMessageDialog(null, message);
openURL("http://logikscripting.com/thanks/index.html");
}
int anti = JOptionPane
.showConfirmDialog(
null,
"Make sure autologin, and breakhandler anti random/ban are turned off",
"Have Fun!", JOptionPane.OK_OPTION);
if (anti == -1) {
stopAllScripts();
}
int Buy = JOptionPane
.showConfirmDialog(
null,
"Would You Like to Buy the v2.0 Upgrade?\n\n* Added Neitiznot Runite Mining\n* State of The Art Methods\n* Integrated Chat Responder\n* World Hopping now selects ALL Member Worlds\n* Restructured script to make it EXTREMELY fast\n* New flashy paint\n* Checks for updates internally\n* MUCH faster, smoother and stable.",
"Upgrade!", JOptionPane.YES_NO_OPTION);
if (Buy == 0) {
String message = "

Payment


"
+ "

You will now be redirected to PayPal.
" + "

"
+ "";
JOptionPane.showMessageDialog(null, message);
openURL("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5213062");
}
miningXp = skills.getCurrentSkillExp(Skills.getStatIndex("mining"));
int choice = Integer.parseInt(args.get("doing"));
switch (choice) {
case 1:
heroesguild = true;
case 2:
wilderness = true;
break;
}
return true;

}

private void climbdownladder() {
wait(random(600, 700));
RSObject ladder1 = getNearestObjectByID(ladder);
wait(random(600, 700));
if (ladder1 == null) {
log("I cant Fucking Find that Damn Ladder! Give me a few seconds, you know bots get drunk too!");
} else {
atObject(ladder1, "Climb-down Ladder");
wait(random(2000, 3000));
}
}

private void climbupladder() {
setCameraAltitude(true);
wait(random(600, 700));
setCameraRotation(90);
RSObject ladder3 = getNearestObjectByID(ladder2);
if (ladder3 == null) {
log("I cant Fucking Find that Damn Ladder! Give me a few seconds, you know bots get drunk too!");
} else {
atObject(ladder3, "Climb-up Ladder");
wait(random(600, 700));
}
}

private void walktoladder() {
walkPathMM(reversePath(path_tomine[0]), 17);
}

private void walktodoor() {
walkTileMM(doorTile);
}

private boolean isInBounds(int... bounds) {
boolean result = false;
int x = getMyPlayer().getLocation().getX();
int y = getMyPlayer().getLocation().getY();
if (y <= bounds[0] && y >= bounds[1] && x <= bounds[2]
&& x >= bounds[3]) {
result = true;
}
return result;
}

public boolean isInArea(int maxX, int minY, int minX, int maxY) {
int x = getMyPlayer().getLocation().getX();
int y = getMyPlayer().getLocation().getY();
if (x >= minX && x <= maxX && y >= minY && y <= maxY) {
return true;
}
return false;
}

private void opendwardoor() {
setCameraRotation(270);
RSObject door2 = findObject(warguilddoorout);
wait(random(600, 700));
atObject(door2, "Open Door");
wait(random(1800, 1900));
}

private void opendoor() {
setCameraRotation(270);
RSObject door1 = findObject(door);
wait(random(600, 700));
if (door1 == null) {
log("Im too darn drunk to open the door, give me a sec");
} else {
atObject(door1, "Open Door");
wait(random(1800, 1900));
}
}

public void walkToBank() {

}

public void openBank() {
boolean success = false;
RSObject booth = getNearestObjectByID(bankbooth);
if (distanceTo(booth) > 5) {
walkToBank();
wait(random(800, 900));
}
success = atObject(booth, "Use-quickly Bank booth");
wait(random(600, 700));
if (isMenuOpen()) {
atMenu("Use-quickly Bank booth");
}
if (!success) {
walkToBank();
}

}

public void deposit() {
bank.depositAllExcept(runepick);
}

public void walktowardoor() {
walkPathMM(path_tobank9[0], 17);
}

public void walktoherodoor() {
walkPathMM(reversePath(path_tobank[0]), 17);
}

public void pathtowardoor() {
walkPathMM(path_tobank[0], 17);
}

public void pathtobank() {
walkPathMM(path_tobank2[0], 17);
}

public boolean worldhop() {
log("Worldhopping, this may take 1-2 Minutes.");
logout();
if (RSInterface.getInterface(744).getChild(580).isValid()) {
process = "World Hopping";
log("Process: " + process);
int x9 = random(345, 415);
int y9 = random(242, 250);
moveMouse(x9, y9);
int positionX = (input.getX());
int positionY = (input.getY());
boolean succsess = false;
wait(random(400, 800));
if (positionX == x9 && positionY == y9) {
succsess = true;
}
if (!succsess) {
worldhop();
}
clickMouse(true);
wait(random(4000, 6000));

int x10 = random(84, 296);
int y10 = random(148, 450);
moveMouse(x10, y10);
clickMouse(true);
wait(random(4000, 6000));
boolean loggedin = true;
if (RSInterface.getInterface(744).getChild(631).isValid()) {
String text1 = RSInterface.getInterface(744).getChild(631)
.getText();
if (text1.equals("World 2")) {
log("This is a Heavily Populated World, Choosing another one");
loggedin = false;
} else if (text1.equals("World 6")) {
log("This is a Heavily Populated World, Choosing another one");
loggedin = false;
} else if (text1.equals("World 143")) {
log("This is a Heavily Populated World, Choosing another one");
loggedin = false;
} else if (text1.equals("World 144")) {
log("This is a Heavily Populated World, Choosing another one");
loggedin = false;
} else if (text1.equals("World 44")) {
log("This is a Heavily Populated World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 65")) {
log("This is a PvP World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 26")) {
log("This is a PvP World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 159")) {
log("This is a PvP World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 124")) {
log("This is a PvP World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 18")) {
log("This is a PvP World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 89")) {
log("This is a PvP World, Choosing another one");
loggedin = false;
} else if (text1.contains("World 59")) {
log("This is a PvP World, Choosing another one");
loggedin = false;

if (!loggedin) {
worldhop();
}

} else if (loggedin && text1 != "World 2" && text1 != "World 6"
&& text1 != "World 143" && text1 != "World 144"
&& text1 != "World 44" && !text1.contains("World 65")
&& !text1.contains("World 26")
&& !text1.contains("World 159")
&& !text1.contains("World 124")
&& !text1.contains("World 18")
&& !text1.contains("World 89")
&& !text1.contains("World 59")) {
login();
}

}
}
return isLoggedIn();

}

private void checkprocess() {
if (isInArea(2893, 9905, 2891, 9909) && !isInventoryFull()) {
process = "Walking to Runite Mine";
return;
} else if (isInArea(2894, 3506, 2892, 3509) && !isInventoryFull()) {
process = "Going down the stairs";
return;
} else if (isInArea(2902, 3511, 2902, 3511) && !isInventoryFull()) {
process = "Opening Heroes Guild Door";
return;
} else if (isInArea(2877, 3546, 2877, 3546) && !isInventoryFull()) {
process = "Still Walking to Heroes Guild";
return;
} else if (isInArea(2901, 3503, 2891, 3516) && !isInventoryFull()) {
process = "Walking to Stairs";
return;
} else if (isInArea(2848, 3537, 2843, 3545) && !isInventoryFull()) {
process = "Walking to Heroes Guild";
return;
} else if (isInArea(2902, 3510, 2902, 3511) && isInventoryFull()) {
process = "Walking to Bank";
return;
} else if (isInArea(2901, 3503, 2891, 3516) && isInventoryFull()) {
process = "Walking to Heroes Guild Door";
return;
} else if (isInArea(2876, 3546, 2876, 3546) && isInventoryFull()) {
process = "Still Walking to Bank";
return;
} else if (isInArea(2845, 3541, 2843, 3545) && isInventoryFull()) {
process = "Banking Runite Ore";
return;
} else if (isInArea(2894, 9904, 2890, 9909) && isInventoryFull()) {
process = "Going up the stairs";
return;
} else if (isInArea(2940, 9883, 2936, 9886) && isInventoryFull()) {
process = "Inventory is full, Walking to Bank";
return;
} else if (isInArea(2940, 9883, 2936, 9886)) {
process = "Mining Runite Ore";
return;
}
}

public void bank() {
try {
int before = getInventoryCount(runiteore);
deposit();
wait(500);
int after = getInventoryCount(runiteore);
if (after < before) {
runitebanked += before - after;
}
wait(random(800, 1000));
bank.close();
checkprocess();
return;
} catch (Exception e) {
}
}

public int loop() {
int waitlength = 800;
if (heroesguild) {
checkprocess();
if (process.equals("Walking to Stairs")) {
wait(random(800, 1000));
if (!getMyPlayer().isMoving()) {
walkPathMM(path_tostairs[0], 17);
}
} else if (process.equals("Walking to Heroes Guild Door")) {
if (!getMyPlayer().isMoving()) {
walktodoor();
}
wait(random(5000, 10000));
if (!getMyPlayer().isMoving()) {
opendoor();
}
} else if (process.equals("Walking to Bank")) {
if (isInArea(2877, 3546, 2877, 3546)) {
if (!getMyPlayer().isMoving()) {
opendwardoor();
}
} else {
wait(random(800, 1000));
if (!getMyPlayer().isMoving()) {
walkPathMM(path_tobank[0], 17);
}
}
} else if (process.equals("Banking Runite Ore")) {
openBank();
if (bank.getInterface().isValid()) {
bank();
}

} else if (process.equals("Still Walking to Bank")) {
wait(random(800, 1000));
if (!getMyPlayer().isMoving()) {
walkPathMM(path_tobank2[0], 14);
}
} else if (process.equals("Opening Heroes Guild Door")) {
if (isInArea(2902, 3511, 2902, 3511)) {
if (!getMyPlayer().isMoving()) {
opendoor();
}
}
} else if (process.equals("Walking to Heroes Guild")) {
if (isInArea(2876, 3545, 2875, 3547)) {
if (!getMyPlayer().isMoving()) {
opendwardoor();
}
} else {
wait(random(800, 1000));
if (!getMyPlayer().isMoving()) {
walkPathMM(path_tobank9[0], 17);
}
}
} else if (process.equals("Still Walking to Heroes Guild")) {
if (isInArea(2902, 3511, 2902, 3511)) {
if (!getMyPlayer().isMoving()) {
opendoor();
}
} else {
wait(random(800, 1000));
if (!getMyPlayer().isMoving()) {
walkPathMM(path_tobank8[0], 17);
}
}
} else if (process.equals("Going down the stairs")) {
if (!getMyPlayer().isMoving()) {
climbdownladder();
}
} else if (process.equals("Walking to Runite Mine")) {
wait(random(800, 1000));
if (!getMyPlayer().isMoving()) {
setCameraRotation(random(1, 359));
walkPathMM(reversePath(path_tomine1[0]), 14);
}
} else if (process.equals("Going up the stairs")) {
if (!getMyPlayer().isMoving()) {
climbupladder();
}
} else if (process.equals("Inventory is full, Walking to Bank")) {
runenergy = random(30, 80);
run(runenergy);
wait(random(800, 1000));
if (!getMyPlayer().isMoving()) {
setCameraRotation(random(1, 359));
walkPathMM(path_tomine1[0], 14);
}
} else if (process.equals("Mining Runite Ore")) {
RSObject ore = getNearestObjectByID(runitemine);
if (ore == null)
worldhop();
else {
minerocks();
}
}
}
return waitlength;

}

public void minerocks() {
try {
if (onTile(getNearestObjectByID(runitemine).getLocation(), "Rocks",
"Mine")) {
wait(random(4000, 6000));
}
} catch (Exception e) {
}
}

public boolean onTile(RSTile tile, String search, String action) {
if (!tile.isValid()) {
return false;
}

Point checkScreen = Calculations.tileToScreen(tile);
if (!pointOnScreen(checkScreen)) {
walkTileMM(tile);
wait(random(340, 700));
}

try {
Point screenLoc = null;
for (int i = 0; i < 30; i++) {
screenLoc = Calculations.tileToScreen(tile);
if (!pointOnScreen(screenLoc)) {
return false;
}
if (getMenuItems().get(0).toLowerCase().contains(
search.toLowerCase())) {
break;
}
if (getMouseLocation().equals(screenLoc)) {
break;
}
moveMouse(screenLoc);
}
screenLoc = Calculations.tileToScreen(tile);
if (getMenuItems().size() <= 1) {
return false;
}
if (getMenuItems().get(0).toLowerCase().contains(
action.toLowerCase())) {
clickMouse(true);
return true;
} else {
clickMouse(false);
return atMenu(action);
}
} catch (Exception e) {
e.printStackTrace();
return false;
}
}

public void openURL(String url) { // Credits to Ruski who gave credits to
// Dave who gave credits to some guy who
// made this.

String osName = System.getProperty("os.name");

try {

if (osName.startsWith("Mac OS")) {

Class fileMgr = Class.forName("com.apple.eio.FileManager");

Method openURL = fileMgr.getDeclaredMethod("openURL",

new Class[] { String.class });

openURL.invoke(null, new Object[] { url });

} else if (osName.startsWith("Windows"))

Runtime.getRuntime().exec(

"rundll32 url.dll,FileProtocolHandler " + url);

else {

String[] browsers = { "firefox", "opera", "konqueror",

"epiphany", "mozilla", "netscape" };

String browser = null;

for (int count = 0; count < browsers.length && browser == null; count++)

if (Runtime.getRuntime().exec(

new String[] { "which", browsers[count] })

.waitFor() == 0)

browser = browsers[count];

if (browser == null)

throw new Exception("Could not find web browser");

else

Runtime.getRuntime().exec(new String[] { browser, url });

}

} catch (Exception e) {

}

}

private void run(int minimum) {
int current = getEnergy();
if (minimum <= current) {
setRun(true);
}
}

private int distanceTo(int[] usedrunitemine2) {
return 0;
}

}

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/Q4NsSdDk1QY/11995

 
KeyCodeAdapter
Friday, 18 June 2010 06:22
// description of your code here
the keycode class to get keystroke values

// insert code here..
package mobilePackage;


import javax.microedition.lcdui.Canvas;

/**
* Class redefines codes of mobile phone to our constant values.
* Class can give to developers following information:
*

    *
  • defined platform name

    * In case if device vendor not defined we'll recieve PLATFORM_NOT_DEFINED like platform name.
    * Same in this case keyCodes will be setted like for Nokia and SE. It's done for work on emulators,
    * because on some of them it's impossible to define platform name.
    *
  • adopted to our constants key code value
    *
  • for test returns defined real code of left softkey
    *

*/
public final class KeyCodeAdaptor {

/**
* instance on this class
*/
private static final KeyCodeAdaptor instance = new KeyCodeAdaptor();
/**
* canvas used for definig codes
*/
private final Canvas adaptorCanvas;
/**
* constants for platforms names
*/
public static final String PLATFORM_MOTOROLA = "motorola";
public static final String PLATFORM_NOKIA = "nokia";
public static final String PLATFORM_SONY_ERICSSON = "SE";
public static final String PLATFORM_SIEMENS = "siemens";
public static final String PLATFORM_SAMSUNG = "samsung";
public static final String PLATFORM_LG = "LG";
public static final String PLATFORM_NOT_DEFINED = "NA";
/**
* constants for keycodes
*/
public static final int SOFT_KEY_LEFT = -201;
public static final int SOFT_KEY_RIGHT = -202;
public static final int SOFT_KEY_MIDDLE_INTERNET = -203;
/**
* this key is present on Nokia s60
*/
public static final int PENCIL_KEY = -207;
public static final int DELETE_KEY = -204;
public static final int BACK_KEY = -205;
// public static final int SEND_KEY = -206; //constant will be used in future for green key start dialling
public static final int KEY_1 = 201;
public static final int KEY_2 = 202;
public static final int KEY_3 = 203;
public static final int KEY_4 = 204;
public static final int KEY_5 = 205;
public static final int KEY_6 = 206;
public static final int KEY_7 = 207;
public static final int KEY_8 = 208;
public static final int KEY_9 = 209;
public static final int KEY_0 = 200;
public static final int KEY__POUND = 211;
public static final int KEY__STAR = 212;
/**
* KEYS on JOISTICK
*/
public static final int UP_KEY = 221;
public static final int DOWN_KEY = 222;
public static final int LEFT_KEY = 223;
public static final int RIGHT_KEY = 224;
public static final int CENTER_KEY = 225;

public static final int NOT_DEFINED_KEY = 254;

// QWERTY NUMERIC
public static final int QKEY_1 = 49;
public static final int QKEY_2 = 50;
public static final int QKEY_3 = 51;
public static final int QKEY_4 = 52;
public static final int QKEY_5 = 53;
public static final int QKEY_6 = 54;
public static final int QKEY_7 = 55;
public static final int QKEY_8 = 56;
public static final int QKEY_9 = 57;
public static final int QKEY_0 = 48;





/**
* current platform name
*/
private final String PLATFORM_NAME;
/**
* current platform codeofSoftkey
*/
private final int SOFTKEY_LEFT;
private final int SOFTKEY_RIGHT;
private final int SOFTKEY_MIDDLE_INTERNET;
private final int SOFTKEY_DELETE;
private final int SOFTKEY_BACK;

/**
* standart values for softkeys of different platforms
* used only in predefining
*/
private static final int SOFT_KEY_LEFT_SE = -6;
private static final int SOFT_KEY_RIGHT_SE = -7;
private static final int DELETE_KEY_SE = -8;
private static final int INTERNET_KEY_SE = -10;
private static final int BACK_KEY_SE = -11;
private static final int SOFT_KEY_LEFT_SAMSUNG = -6;
private static final int SOFT_KEY_RIGHT_SAMSUNG = -7;
private static final int DELETE_KEY_SAMSUNG = -8;
private static final int SOFT_KEY_LEFT_SIEMENS = -1;
private static final int SOFT_KEY_RIGHT_SIEMENS = -4;
private static final int SOFT_KEY_LEFT_NOKIA = -6;
private static final int SOFT_KEY_RIGHT_NOKIA = -7;
private static final int DELETE_KEY_NOKIA = -8;
private static final int PENCIL_KEY_NOKIA = -50;
private static final int SOFT_KEY_LEFT_MOTOROLA = -21;
private static final int SOFT_KEY_RIGHT_MOTOROLA = -22;
private static final int SOFT_KEY_LEFT_MOTOROLA2 = -20;
private static final int SOFT_KEY_LEFT_MOTOROLA1 = 21;
private static final int SOFT_KEY_RIGHT_MOTOROLA1 = 22;
private static final int SOFT_KEY_MIDLE_MOTOROLA = -23;
private static final int SOFT_KEY_MIDLE_NOKIA = -5;

private static final String SOFT_WORD = "SOFT";

/**
* constructor.
* here is predefining of special keys and platform made
*/
private KeyCodeAdaptor() {
adaptorCanvas = MobileOrder.canvas;
PLATFORM_NAME = getPlatform();
SOFTKEY_LEFT = getLeftSoftkeyCode();
SOFTKEY_RIGHT = getRightSoftkeyCode();
SOFTKEY_MIDDLE_INTERNET = getMidleORInternetSoftkeyCode();
SOFTKEY_DELETE = getDeleteKeyCode();
SOFTKEY_BACK = getBackKeyCode();
}

/**
* return platform keycode of left softkey
* if it's defined
* default value -6
*
* @return SOFTKEY_LEFT
*/
public int getPlatformSoftkeyLeftCode() {
return SOFTKEY_LEFT;
}

/**
* Returns mobile phone platform
*
* @return name mobile phone platform
*/
private String getPlatform() {
// detecting NOKIA or SonyEricsson
try {
final String currentPlatform = System.getProperty("microedition.platform");
if (currentPlatform.indexOf("Nokia") != -1) {
return PLATFORM_NOKIA;
} else if (currentPlatform.indexOf("SonyEricsson") != -1) {
return PLATFORM_SONY_ERICSSON;
}
} catch (Throwable ex) {
}
// detecting SAMSUNG
try {
Class.forName("com.samsung.util.Vibration");
return PLATFORM_SAMSUNG;
} catch (Throwable ex) {
}
// detecting MOTOROLA
try {
Class.forName("com.motorola.multimedia.Vibrator");
return PLATFORM_MOTOROLA;
} catch (Throwable ex) {
try {
Class.forName("com.motorola.graphics.j3d.Effect3D");
return PLATFORM_MOTOROLA;
} catch (Throwable ex2) {
try {
Class.forName("com.motorola.multimedia.Lighting");
return PLATFORM_MOTOROLA;
} catch (Throwable ex3) {
try {
Class.forName("com.motorola.multimedia.FunLight");
return PLATFORM_MOTOROLA;
} catch (Throwable ex4) {
}
}
}
}
try {
if (adaptorCanvas.getKeyName(SOFT_KEY_LEFT_MOTOROLA).toUpperCase().indexOf(SOFT_WORD) > -1) {
return PLATFORM_MOTOROLA;
}
} catch (Throwable e) {
try {
if (adaptorCanvas.getKeyName(SOFT_KEY_LEFT_MOTOROLA1).toUpperCase().indexOf(SOFT_WORD) > -1) {
return PLATFORM_MOTOROLA;
}
} catch (Throwable e1) {
try {
if (adaptorCanvas.getKeyName(SOFT_KEY_LEFT_MOTOROLA2).toUpperCase().indexOf(SOFT_WORD) > -1) {
return PLATFORM_MOTOROLA;
}
} catch (Throwable e2) {
}
}
}
// detecting SIEMENS
try {
Class.forName("com.siemens.mp.io.File");
return PLATFORM_SIEMENS;
} catch (Throwable ex) {
}
// detecting LG
try {
Class.forName("mmpp.media.MediaPlayer");
return PLATFORM_LG;
} catch (Throwable ex) {
try {
Class.forName("mmpp.phone.Phone");
return PLATFORM_LG;
} catch (Throwable ex1) {
try {
Class.forName("mmpp.lang.MathFP");
return PLATFORM_LG;
} catch (Throwable ex2) {
try {
Class.forName("mmpp.media.BackLight");
return PLATFORM_LG;
} catch (Throwable ex3) {
}
}
}
}
return PLATFORM_NOT_DEFINED;
}

/**
* define real left soft key code by platform
*
* @return code
*/
private int getLeftSoftkeyCode() {
int keyCode = 0;
try {
if (PLATFORM_NAME.equals(PLATFORM_MOTOROLA)) {
String softkeyLeftMoto = "";
try {
softkeyLeftMoto = adaptorCanvas.getKeyName(SOFT_KEY_LEFT_MOTOROLA).toUpperCase();
} catch (IllegalArgumentException ilae) {
// ilae.printStackTrace();
}
String softkeyLeftMoto1 = "";
try {
softkeyLeftMoto1 = adaptorCanvas.getKeyName(SOFT_KEY_LEFT_MOTOROLA1).toUpperCase();
} catch (IllegalArgumentException ilae) {
// ilae.printStackTrace();
}
String softkeyLeftMoto2 = "";
try {
softkeyLeftMoto2 = adaptorCanvas.getKeyName(SOFT_KEY_LEFT_MOTOROLA2).toUpperCase();
} catch (IllegalArgumentException ilae) {
// ilae.printStackTrace();
}
if (softkeyLeftMoto.indexOf(SOFT_WORD) >= 0 && softkeyLeftMoto.indexOf("1") >= 0) {
return SOFT_KEY_LEFT_MOTOROLA;
} else if (softkeyLeftMoto1.indexOf(SOFT_WORD) >= 0 && softkeyLeftMoto1.indexOf("1") >= 0) {
return SOFT_KEY_LEFT_MOTOROLA1;
} else if (softkeyLeftMoto2.indexOf(SOFT_WORD) >= 0 && softkeyLeftMoto2.indexOf("1") >= 0) {
return SOFT_KEY_LEFT_MOTOROLA2;
} else if (softkeyLeftMoto.indexOf(SOFT_WORD) >= 0 && softkeyLeftMoto.indexOf("LEFT") >= 0) {
return SOFT_KEY_LEFT_MOTOROLA;
} else if (softkeyLeftMoto1.indexOf(SOFT_WORD) >= 0 && softkeyLeftMoto1.indexOf("LEFT") >= 0) {
return SOFT_KEY_LEFT_MOTOROLA1;
} else if (softkeyLeftMoto2.indexOf(SOFT_WORD) >= 0 && softkeyLeftMoto2.indexOf("LEFT") >= 0) {
return SOFT_KEY_LEFT_MOTOROLA2;
}

} else if (PLATFORM_NAME.equals(PLATFORM_NOKIA)) {
return SOFT_KEY_LEFT_NOKIA;
} else if (PLATFORM_NAME.equals(PLATFORM_SAMSUNG)) {
// String leftkeySamsungName = adaptorCanvas.getKeyName(SOFT_KEY_LEFT_SAMSUNG).toUpperCase();
// if (leftkeySamsungName.indexOf(SOFT_WORD) >= 0) {
// if (leftkeySamsungName.indexOf("1") >= 0) {
return SOFT_KEY_LEFT_SAMSUNG;
// } else if (leftkeySamsungName.indexOf("LEFT") >= 0) {
// return SOFT_KEY_LEFT_SAMSUNG;
// }
// }
} else if (PLATFORM_NAME.equals(PLATFORM_SIEMENS)) {
String leftKeySiemensName = adaptorCanvas.getKeyName(SOFT_KEY_LEFT_SIEMENS).toUpperCase();
if (leftKeySiemensName.indexOf(SOFT_WORD) >= 0) {
if (leftKeySiemensName.indexOf("1") >= 0) {
return SOFT_KEY_LEFT_SIEMENS;
} else if (leftKeySiemensName.indexOf("LEFT") >= 0) {
return SOFT_KEY_LEFT_SIEMENS;
}
}
} else if (PLATFORM_NAME.equals(PLATFORM_SONY_ERICSSON)) {
return SOFT_KEY_LEFT_SE;
} else if (PLATFORM_NAME.equals(PLATFORM_NOT_DEFINED)) {
//
for (int i = -125; i <= 125; i++) {
if (i == 0) {
i++;
}
// System.out.println(getKeyName(i).toUpperCase());
final String s = adaptorCanvas.getKeyName(i).toUpperCase();
if (s.indexOf(SOFT_WORD) >= 0) {
if (s.indexOf("1") >= 0) {
keyCode = i;
break;
}
if (s.indexOf("LEFT") >= 0) {
keyCode = i;
break;
}
}
}
}
if (keyCode == 0) {
//#if emulator
//# return SOFT_KEY_LEFT_NOKIA;
//#endif
}
} catch (Throwable iaEx) {
//#if emulator
//# return SOFT_KEY_LEFT_NOKIA;
//#endif
}
return keyCode;
}

/**
* define real right soft key code for current platform
*
* @return code
*/
private int getRightSoftkeyCode() {
int keyCode = 0;
try {
if (PLATFORM_NAME.equals(PLATFORM_MOTOROLA)) {

String rightSoftMoto1 = "";
try {
rightSoftMoto1 = adaptorCanvas.getKeyName(SOFT_KEY_LEFT_MOTOROLA1).toUpperCase();
} catch (IllegalArgumentException ilae) {
// ilae.printStackTrace();
}
String rightSoftMoto = "";
try {
rightSoftMoto = adaptorCanvas.getKeyName(SOFT_KEY_RIGHT_MOTOROLA).toUpperCase();
} catch (IllegalArgumentException ilae) {
// ilae.printStackTrace();
}
String rightSoftMoto2 = "";
try {
rightSoftMoto2 = adaptorCanvas.getKeyName(SOFT_KEY_RIGHT_MOTOROLA1).toUpperCase();
} catch (IllegalArgumentException ilae) {
// ilae.printStackTrace();
}
if (rightSoftMoto.indexOf(SOFT_WORD) >= 0 && rightSoftMoto.indexOf("2") >= 0) {
return SOFT_KEY_RIGHT_MOTOROLA;
} else if (rightSoftMoto1.indexOf(SOFT_WORD) >= 0 && rightSoftMoto1.indexOf("2") >= 0) {
return SOFT_KEY_RIGHT_MOTOROLA;
} else if (rightSoftMoto2.indexOf(SOFT_WORD) >= 0 && rightSoftMoto2.indexOf("2") >= 0) {
return SOFT_KEY_RIGHT_MOTOROLA1;
} else if (rightSoftMoto.indexOf(SOFT_WORD) >= 0 && rightSoftMoto.indexOf("RIGHT") >= 0) {
return SOFT_KEY_LEFT_MOTOROLA;
} else if (rightSoftMoto1.indexOf(SOFT_WORD) >= 0 && rightSoftMoto1.indexOf("RIGHT") >= 0) {
return SOFT_KEY_RIGHT_MOTOROLA1;
} else if (rightSoftMoto2.indexOf(SOFT_WORD) >= 0 && rightSoftMoto2.indexOf("RIGHT") >= 0) {
return SOFT_KEY_RIGHT_MOTOROLA;
}

} else if (PLATFORM_NAME.equals(PLATFORM_NOKIA)) {
return SOFT_KEY_RIGHT_NOKIA;
} else if (PLATFORM_NAME.equals(PLATFORM_SAMSUNG)) {
// String rightSoftSamsung = adaptorCanvas.getKeyName(SOFT_KEY_RIGHT_SAMSUNG).toUpperCase();
// if (rightSoftSamsung.indexOf(SOFT_WORD) >= 0) {
// if (rightSoftSamsung.indexOf("2") >= 0) {
return SOFT_KEY_RIGHT_SAMSUNG;
// } else if (rightSoftSamsung.indexOf("RIGHT") >= 0) {
// return SOFT_KEY_RIGHT_SAMSUNG;
// }
// }
} else if (PLATFORM_NAME.equals(PLATFORM_SIEMENS)) {
String rightSoftSiemens = adaptorCanvas.getKeyName(SOFT_KEY_RIGHT_SIEMENS).toUpperCase();
if (rightSoftSiemens.indexOf(SOFT_WORD) >= 0) {
if (rightSoftSiemens.indexOf("4") >= 0) {
return SOFT_KEY_RIGHT_SIEMENS;
} else if (rightSoftSiemens.indexOf("RIGHT") >= 0) {
return SOFT_KEY_RIGHT_SIEMENS;
}
}
} else if (PLATFORM_NAME.equals(PLATFORM_SONY_ERICSSON)) {
return SOFT_KEY_RIGHT_SE;
} else if (PLATFORM_NAME.equals(PLATFORM_NOT_DEFINED)) {
for (int i = -125; i <= 125; i++) {
if (i == 0) {
i++;
}
String keyName = adaptorCanvas.getKeyName(i).toUpperCase();
if (keyName.indexOf(SOFT_WORD) >= 0) {
if (keyName.indexOf("2") >= 0) {
keyCode = i;
break;
} else if (keyName.indexOf("4") >= 0) {
keyCode = i;
break;
} else if (keyName.indexOf("RIGHT") >= 0) {
keyCode = i;
break;
}
}
}
}
} catch (Throwable iaEx) {
//#if emulator
//# return SOFT_KEY_RIGHT_NOKIA;
//#endif
}
return keyCode;
}

/**
* define real middle soft key code for current platform
*
* @return code
*/
private int getMidleORInternetSoftkeyCode() {
try {
if (PLATFORM_NAME.equals(PLATFORM_MOTOROLA)) {
if (adaptorCanvas.getKeyName(SOFT_KEY_MIDLE_MOTOROLA).toUpperCase().indexOf("SOFT") >= 0) {
return SOFT_KEY_MIDLE_MOTOROLA;
}
} else if (PLATFORM_NAME.equals(PLATFORM_NOKIA)) {
if (adaptorCanvas.getKeyName(SOFT_KEY_MIDLE_NOKIA).toUpperCase().indexOf("SOFT") >= 0) {
return SOFT_KEY_MIDLE_NOKIA;
}
} else if (PLATFORM_NAME.equals(PLATFORM_SAMSUNG)) {
} else if (PLATFORM_NAME.equals(PLATFORM_SIEMENS)) {
} else if (PLATFORM_NAME.equals(PLATFORM_SONY_ERICSSON)) {
return INTERNET_KEY_SE;
}
} catch (Throwable e) {
}
return 0;
}

/**
* define real key's C or DELETE code for current platform
*
* @return code
*/
private int getDeleteKeyCode() {
try {
if (PLATFORM_NAME.equals(PLATFORM_MOTOROLA)) {

} else if (PLATFORM_NAME.equals(PLATFORM_NOKIA)) {
if (adaptorCanvas.getKeyName(DELETE_KEY_SE).toUpperCase().indexOf("CLEAR") >= 0) {
return DELETE_KEY_NOKIA;
} else {
return DELETE_KEY_NOKIA;
}
} else if (PLATFORM_NAME.equals(PLATFORM_SAMSUNG)) {
if (adaptorCanvas.getKeyName(DELETE_KEY_SAMSUNG).toUpperCase().indexOf("CLEAR") >= 0) {
return DELETE_KEY_SAMSUNG;
}
} else if (PLATFORM_NAME.equals(PLATFORM_SIEMENS)) {
} else if (PLATFORM_NAME.equals(PLATFORM_SONY_ERICSSON)) {
if (adaptorCanvas.getKeyName(DELETE_KEY_SE).toUpperCase().indexOf("CLEAR") >= 0) {
return DELETE_KEY_SE;
} else if (adaptorCanvas.getKeyName(DELETE_KEY_SE).toUpperCase().indexOf("C") >= 0) {
return DELETE_KEY_SE;
} else {
return DELETE_KEY_SE;
}
}
} catch (Throwable e) {
return DELETE_KEY_SE;
}
return 0;
}


/**
* define real key's BACK code for current platform
*
* @return code
*/
private int getBackKeyCode() {
try {
if (PLATFORM_NAME.equals(PLATFORM_MOTOROLA)) {

} else if (PLATFORM_NAME.equals(PLATFORM_NOKIA)) {

} else if (PLATFORM_NAME.equals(PLATFORM_SAMSUNG)) {
} else if (PLATFORM_NAME.equals(PLATFORM_SIEMENS)) {
} else if (PLATFORM_NAME.equals(PLATFORM_SONY_ERICSSON)) {
return BACK_KEY_SE;
}
} catch (Throwable e) {
}
return 0;
}

/**
* name of curent platform
*
* @return PLATFORM_NAME
*/
public String getPlatformName() {
return PLATFORM_NAME;
}

/**
* Used to adopt key kode to predefined constances, which are platform independent.
*


* You can use this method in any kind of canvas, but better at first time to call
* getInstance() method at the beginning of midlet work, because initialisation takes time.
*


* Best variant for usage is calling adoptKeyCode() to use keyPressed() method in Canvas:
*

 

* protected void keyPressed(int keyCode) {
* keyCode = KeyCodeAdaptor.getInstance().adoptKeyCode(keyCode);
* }
*

* and then you can use it:
*
 

* switch (keyCode) {
* case KeyCodeAdaptor.UP_KEY:
* break;
* case KeyCodeAdaptor.SOFT_KEY_LEFT:
* break;
* }

* or send this code to any other clesses.
*
* @param keycode This code is sent by platform to canvas and redirected here
* @return this keycode is equal to one of our constants declared in this class
*/
public int adoptKeyCode(int keycode, boolean isNumeric) {

switch (keycode) {
case Canvas.KEY_NUM0:
return KEY_0;
case Canvas.KEY_NUM1:
return KEY_1;
case Canvas.KEY_NUM2:
return KEY_2;
case Canvas.KEY_NUM3:
return KEY_3;
case Canvas.KEY_NUM4:
return KEY_4;
case Canvas.KEY_NUM5:
return KEY_5;
case Canvas.KEY_NUM6:
return KEY_6;
case Canvas.KEY_NUM7:
return KEY_7;
case Canvas.KEY_NUM8:
return KEY_8;
case Canvas.KEY_NUM9:
return KEY_9;
case Canvas.KEY_STAR:
return KEY__STAR;
case Canvas.KEY_POUND:
return KEY__POUND;
default:
if (keycode == SOFTKEY_LEFT) {
return SOFT_KEY_LEFT;
} else if (keycode == SOFTKEY_RIGHT) {
return SOFT_KEY_RIGHT;
} else if (keycode == SOFTKEY_DELETE) {
return DELETE_KEY;
} else if (keycode == SOFTKEY_BACK) {
return BACK_KEY;
} else if (keycode == SOFTKEY_MIDDLE_INTERNET) {
return SOFT_KEY_MIDDLE_INTERNET;
} else if (keycode == PENCIL_KEY_NOKIA) {
return PENCIL_KEY;
} else {
try {
final int gameAction;
gameAction = adaptorCanvas.getGameAction(keycode);
if (gameAction == Canvas.UP) {
return UP_KEY;
} else if (gameAction == Canvas.DOWN) {
return DOWN_KEY;
} else if (gameAction == Canvas.LEFT) {
return LEFT_KEY;
} else if (gameAction == Canvas.RIGHT) {
return RIGHT_KEY;
} else if (gameAction == Canvas.FIRE) {
return CENTER_KEY;
}
} catch (IllegalArgumentException e) {
// e.printStackTrace();
}
}
break;
}
if (isNumeric)
{
if (keycode == QKEY_0){
return KEY_0;
} else if (keycode == QKEY_1){
return KEY_1;
} else if (keycode == QKEY_2){
return KEY_2;
} else if (keycode == QKEY_3){
return KEY_3;
} else if (keycode == QKEY_4){
return KEY_4;
} else if (keycode == QKEY_5){
return KEY_5;
} else if (keycode == QKEY_6){
return KEY_6;
} else if (keycode == QKEY_7){
return KEY_7;
} else if (keycode == QKEY_8){
return KEY_8;
} else if (keycode == QKEY_9){
return KEY_9;
}
}

//#if debug
//# return keycode;
//#else
return NOT_DEFINED_KEY;
//#endif
}

/**
* return instance of class
*
* @return instance
*/
public static KeyCodeAdaptor getInstance() {
return instance;
}
}

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/z-I7wC2kTDo/11669

 
Script to check slave replication
Friday, 28 May 2010 12:49
#!/usr/bin/env bash

repeat_alert_interval=15 # minutes
lock_file=/tmp/slave_alert.lck
active=yes

## Check if alert is already sent ##

function check_alert_lock () {
if [ -f $lock_file ] ; then
current_file=`find $lock_file -cmin -$repeat_alert_interval`
if [ -n "$current_file" ] ; then
# echo "Current lock file found"
return 1
else
# echo "Expired lock file found"
return 2
fi
else
return 0
fi
}

## Find the location of the mysql.sock file ##

function check_for_socket () {
if [ -z $socket ] ; then
if [ -S /var/lib/mysql/mysql.sock ] ; then
socket=/var/lib/mysql/mysql.sock
elif [ -S /tmp/mysql.sock ] ; then
socket=/tmp/mysql.sock
else
ps_socket=`netstat -ln | egrep "mysql(d)?\.sock" | awk '{ print $9 }'`
if [ "$ps_socket" ] ; then
socket=$ps_socket
fi
fi
fi
if [ -S "$socket" ] ; then
echo UP > /dev/null
else
echo "No valid socket file "$socket" found!"
echo "mysqld is not running or it is installed in a custom location"
echo "Please set the $socket variable at the top of this script."
exit 1
fi
}


check_for_socket

Slave_IO_Running=`mysql -Bse "show slave status\G" | grep Slave_IO_Running | awk '{ print $2 }'`
Slave_SQL_Running=`mysql -Bse "show slave status\G" | grep Slave_SQL_Running | awk '{ print $2 }'`
Last_error=`mysql -Bse "show slave status\G" | grep Last_error | awk -F \: '{ print $2 }'`


if [ -z $Slave_IO_Running -o -z $Slave_SQL_Running ] ; then
echo "Replication is not configured or you do not have the required access to MySQL"
exit
fi

if [ $Slave_IO_Running == 'Yes' ] && [ $Slave_SQL_Running == 'Yes' ] ; then
if [ -f $lock_file ] ; then
rm $lock_file
echo "Replication slave is running"
echo "Removed Alert Lock"
fi
exit 0
elif [ $Slave_SQL_Running == 'No' ] ; then
if [ $active == 'yes' ] ; then
check_alert_lock
if [ $? = 1 ] ; then
## Current Lock ##
echo "up" > /dev/null
else
## Stale/No Lock ##
touch $lock_file
echo "SQL thread not running on server `hostname -s`!"
echo "Last Error:" $Last_error
fi
fi
exit 1
elif [ $Slave_IO_Running == 'No' ] ; then
if [ $active == 'yes' ] ; then
check_alert_lock
if [ $? = 1 ] ; then
## Current Lock ##
echo "up" > /dev/null
else
## Stale/No Lock ##
touch $lock_file
echo "LOG IO thread not running on server `hostname -s`!"
echo "Last Error:" $Last_error
fi
fi
exit 1
else
if [ $active == 'yes' ] ; then
check_alert_lock
if [ $? = 1 ] ; then
## Current Lock ##
echo "up" > /dev/null
else
## Stale/No Lock ##
touch $lock_file
echo "Unexpected Error!"
echo "Check Your permissions!"
fi
fi
exit 2
fi

Read more: http://feeds.dzone.com/~r/dzone/snippets/~3/514o2vSt-ok/11491

 


Taxonomy by Zaragoza Online
Home