Mine sisusse
Otsi siit
  • Rohkem valikuid...
Otsi tulemusi mis sisaldab...
Otsi tulemusi...
Jälgi teemat sisse logides  

Abi runecrafting scrptiga.

Soovitatud postitused

import java.awt.Color;

import java.awt.Graphics;

import java.util.Map;

 

import com.speljohan.rsbot.bot.Bot;

import com.speljohan.rsbot.event.events.ServerMessageEvent;

import com.speljohan.rsbot.event.listeners.PaintListener;

import com.speljohan.rsbot.event.listeners.ServerMessageListener;

import com.speljohan.rsbot.script.Script;

import com.speljohan.rsbot.script.wrappers.RSInterface;

import com.speljohan.rsbot.script.wrappers.RSItem;

import com.speljohan.rsbot.script.wrappers.RSObject;

import com.speljohan.rsbot.script.wrappers.RSTile;

 

public class EveryRuneCrafter extends Script implements ServerMessageListener,

PaintListener {

 

private final int Rock = 2452, Altar = 2478, Exit = 2465, essence = 1436,

wait1 = 100, wait2 = 300;

private int[] tiara = {5527, 5529, 5531, 5535, 5537, 5533};

private boolean tally, inAltar = false;

private RSTile[] path;

private final long startTime = System.currentTimeMillis();

private RSTile bank_Tile, altar_Tile;

private int type, talisman, bankID, used=0, tries = 0, curCount, made = 0;

private final int air_Bank = 11758, mind_Bank = 11758, water_Bank = 2213,

earth_Bank = 11402, fire_Bank = 27663, body_Bank = 26972;

 

private String doing = "";

 

public String getName() {

return "Every Rune Crafter";

}

 

public String getAuthor() {

return "Fusion89k";

}

 

public double getVersion() {

return 1.1;

}

 

public String getScriptCategory() {

return "Runecrafting";

}

 

public String getScriptDescription() {

return "\n"

+ "

\n"

+ "

\n"

+ "

"

+ "

"

+ getName()

+ ""

+ "

\n"

+ "Author: "

+ getAuthor()

+ "

"

+ "Version: "

+ getVersion()

+ "

 

 

"

+ "

Rune Type: Air "

+ " Mind"

+ " Water "

+ " Earth "

+ " Fire "

+ " Body "

+ "

"

+ "

Talisman:"

+ "Tiara:

"

+ "\n" + "";

 

}

 

public boolean onStart(Map args) {

type = Integer.parseInt(args.get("type"));

switch (type) {

case 1:

talisman = 1438;

bankID = air_Bank;

path = new RSTile[] { new RSTile(3013, 3356),

new RSTile(3008, 3346), new RSTile(3008, 3332),

new RSTile(3006, 3318), new RSTile(2995, 3310),

new RSTile(2996, 3296), new RSTile(2987, 3294) };

break;

case 2:

talisman = 1448;

bankID = mind_Bank;

path = new RSTile[] { new RSTile(2945, 3370),

new RSTile(2955, 3382), new RSTile(2965, 3391),

new RSTile(2969, 3405), new RSTile(2980, 3415),

new RSTile(2987, 3426), new RSTile(2980, 3441),

new RSTile(2971, 3454), new RSTile(2974, 3464),

new RSTile(2971, 3478), new RSTile(2976, 3491),

new RSTile(2979, 3501), new RSTile(2980, 3512) };

break;

case 3:

talisman = 1444;

bankID = water_Bank;

path = new RSTile[] { new RSTile(3093, 3243),

new RSTile(3100, 3232), new RSTile(3112, 3225),

new RSTile(3121, 3213), new RSTile(3134, 3209),

new RSTile(3139, 3196), new RSTile(3151, 3189),

new RSTile(3156, 3178), new RSTile(3159, 3165),

new RSTile(3173, 3162), new RSTile(3183, 3165) };

break;

case 4:

talisman = 1440;

bankID = earth_Bank;

path = new RSTile[] { new RSTile(3253, 3421),

new RSTile(3264, 3429), new RSTile(3279, 3429),

new RSTile(3284, 3443), new RSTile(3289, 3457),

new RSTile(3298, 3465), new RSTile(3304, 3473) };

break;

case 5:

talisman = 1442;

bankID = fire_Bank;

path = new RSTile[] { new RSTile(3383, 3267),

new RSTile(3369, 3268), new RSTile(3354, 3264),

new RSTile(3338, 3265), new RSTile(3328, 3262),

new RSTile(3324, 3245), new RSTile(3318, 3234),

new RSTile(3307, 3243), new RSTile(3315, 3254) };

break;

case 6:

talisman = 1446;

bankID = body_Bank;

path = new RSTile[] { new RSTile(3092, 3491),

new RSTile(3082, 3483), new RSTile(3081, 3471),

new RSTile(3073, 3460), new RSTile(3067, 3447),

new RSTile(3055, 3444) };

break;

default:

return false;

}

bank_Tile = path[0];

altar_Tile = path[path.length - 1];

if (args.get("tally").equals("tiara"))

tally = false;

else

tally = true;

Bot.getEventManager().addListener(PaintListener.class, this);

return true;

}

 

public void onFinish() {

Bot.getEventManager().removeListener(PaintListener.class, this);

}

 

public int loop() {

setCompass('s');

setCameraAltitude(true);

if((getInventoryCount(talisman)==0&&tally)&&(!isCarryingItem(tiara)&&!tally)){

log("No Talisman or Tiara");

stopAllScripts();

}

if(!isRunning()){

if(getEnergy()>=random(20,70))

setRun(true);

}

if (getMyPlayer().isMoving())

return random(0, 200);

if (needBank()) {

if (tries >= 5) {

log("Bank Fail");

stopAllScripts();

}

if(distanceTo(findObject(Altar+type-1))

inAltar = true;

return random(wait1, wait2);

}

if (inAltar) {

doing = "Exiting";

RSObject ext = findObject(Exit + type - 1);

if (distanceTo(ext) > 7) {

walkTileMM(randomTile(ext.getLocation()));

return random(wait1, wait2);

}

atObject(ext, "Use");

return random(wait1, wait2);

}

if (distanceTo(bank_Tile) > 4) {

doing = "Walking to Bank";

walk(true);

return random(wait1, wait2);

}

if (!RSInterface.getInterface(INTERFACE_BANK).isValid()) {

doing = "Finding Bank";

RSObject booth = findObject(bankID);

if (booth == null)

return random(wait1, wait2);

if(type ==5)

atObject(booth,"Bank");

else atObject(booth, "Use-Quickly");

return random(wait1, wait2);

}

if (RSInterface.getInterface(INTERFACE_BANK).isValid()) {

doing = "Depositing";

bank.depositAllExcept(essence, talisman);

doing = "Withdrawing";

clickMouse(random(38, 73), random(92, 123), false);

pause();

atMenu("but");

bank.close();

tries++;

}

return random(wait1, wait2);

} else {

tries = 0;

curCount = getInventoryCount(essence);

if(distanceTo(findObject(Altar+type-1))

inAltar = true;

return random(wait1, wait2);

}

if (distanceTo(altar_Tile) > 4&& !inAltar) {

doing = "Walking to Rock";

walk(false);

return random(wait1, wait2);

}

if (!inAltar) {

doing = "Entering Rock";

if (tally) {

useItem(new RSItem(talisman, 1),

findObject(Rock + type - 1));

} else {

atObject(findObject(Rock + type - 1), "Enter");

}

return random(wait1, wait2);

} else {

doing = "Finding Altar";

RSObject alt = findObject(Altar + type - 1);

if (distanceTo(alt) > 7) {

doing = "Walking to Altar";

walkTileMM(randomTile(alt.getLocation()));

return random(wait1, wait2);

}

doing = "Crafting";

atObject(alt, "Craft");

return random(wait1, wait2);

}

}

}

 

private RSTile randomTile(RSTile location) {

int x = location.getX(), y = location.getY();

return new RSTile(random(x-2,x+2), random(y-2,y+2));

}

 

private void pause() {

wait(random(wait1, wait2));

}

 

private boolean needBank() {

if (getInventoryCount(essence)

return true;

return false;

}

 

private void walk(boolean toBank) {

RSTile start = locate();

int loc = 0;

for (int i = 0; i

if (start.equals(path)) {

loc = i;

break;

}

}

if (toBank) {

if (loc == 0)

return;

walkTileMM(path[loc - 1]);

} else {

if (loc == path.length - 1)

return;

walkTileMM(path[loc + 1]);

}

}

 

private RSTile locate() {

RSTile min = path[0];

for (int i = 1; i

if (distanceTo(path)

min = path;

}

return min;

}

 

public void onRepaint(Graphics g) {

if (isLoggedIn()) {

long millis = System.currentTimeMillis() - startTime;

long hours = millis / (1000 * 60 * 60);

millis -= hours * (1000 * 60 * 60);

long minutes = millis / (1000 * 60);

millis -= minutes * (1000 * 60);

long seconds = millis / 1000;

// 173 and 80 decide width and height respectively

int topX = 515 - 190, topY = 337 - 80, x = topX + 5, y = topY + 5;

g.setColor(new Color(0, 100, 0, 100));

g.fill3DRect(topX, topY, 515 - topX, 337 - topY, true);

g.setColor(Color.green);

g.drawString("Runtime: " + hours + "h " + minutes + "min "

+ seconds + "sec.", x, y += 15);

g.drawString("Crafted: "+made+" Runes.",x,y+=15);

g.drawString("Used: "+used+" essence.", x, y+=15);

g.drawString("Status: " + doing, x, y += 15);

}

}

 

public void serverMessageRecieved(ServerMessageEvent e) {

String word = e.getMessage().toLowerCase();

if (word.contains("bind")) {

used+=curCount;

curCount=0;

} else if (word.contains("portal")){

made += Math.max(getInventoryCount(getInventoryArray()[0]), getInventoryCount(getInventoryArray()[1]));

inAltar = false;

}

else if (word.contains("force take"))

inAltar = true;

else if (word.contains("only have one")) {

log("Only one essence left - Logging out");

stopAllScripts();

}

}

 

 

}


Jep

Jaga seda postitust


Postituse link
Share on other sites

Kommentaari lisamiseks loo konto või logi sisse

Kommenteerimiseks peate olema liige

Loo konto

Liituge meie kommuuni uue kontoga. See on lihtne!

Loo uus konto

Logi sisse

On juba konto? Logi sisse siit.

Logi sisse nüüd
Jälgi teemat sisse logides  

×
×
  • Loo uus...

Oluline informatsioon

Selle veebisaidi paremaks muutmiseks oleme teie seadmesse paigutanud küpsised . Võite kohandada oma küpsiste seadeid , vastasel juhul eeldame, et te olete küpsiste kasutamisega nõus kui jätkate veebisaidil sirvimist.. Palun lugege läbi Kasutustingimused ja Privaatsuspoliitika.