ULTIMATE GUIDE

LoG iN

Join the forum, it's quick and easy

ULTIMATE GUIDE

LoG iN

ULTIMATE GUIDE

Would you like to react to this message? Create an account in a few clicks or log in to continue.

ULTIMATE GUIDE


    White Knight Killer

    avatar
    Turk4life321
    Admin


    Posts : 41
    Join date : 2009-08-09
    Location : In Saims Room *cough*

    White Knight Killer Empty White Knight Killer

    Post  Turk4life321 Fri Jan 01, 2010 4:30 am

    import java.awt.Graphics;
    import java.util.Map;
    import java.awt.Color;
    import org.rsbot.bot.Bot;
    import org.rsbot.event.listeners.PaintListener;
    import org.rsbot.script.Calculations;
    import org.rsbot.script.Constants;
    import org.rsbot.script.Script;
    import org.rsbot.script.wrappers.RSCharacter;
    import org.rsbot.script.wrappers.RSTile;
    import org.rsbot.script.ScriptManifest;
    import org.rsbot.script.wrappers.RSNPC;
    import org.rsbot.script.Methods;
    @ScriptManifest(authors = { "IceCandle" }, category = "Combat", name = "White Knight killer", version = 1.0, description = "<html><body style='font-family: Arial; padding: 10px;'>Start at white knights, have Recruitiment drive quest finished<BR>and respawn point set in falador castle.<color='yellow'> Items to wield when found at inventory <br><input type='text' name='item1' value='1'><br><input type='text' name='item2' value='2'><br><input type='text' name='item3' value='3'><br></font></body></html>")


    public class WhiteKnightsKiller extends Script implements PaintListener {
    public boolean onStart(Map<String, String> args) {
    try {
    item1 = Integer.parseInt(args.get("item1"));
    item2 = Integer.parseInt(args.get("item2"));
    item3 = Integer.parseInt(args.get("item3"));
    }
    catch (Exception e) {
    }
    return true;
    }
    long startTime = System.currentTimeMillis();
    int item1, item2, item3, timesDied, xpGained, checkItems;
    int startexpR, startexpA, startexpS, startexpD, startexpH;

    public void onFinish() {
    log("Stopping IceCandle's knight killer!");
    Bot.getEventManager().removeListener(PaintListener.class, this);
    }
    public long StartTime;
    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;
    long minutes2 = minutes + (hours * 60);
    long RunTime = 0;
    RunTime = System.currentTimeMillis() - startTime;
    if (startexpH == 0) {
    startexpR = skills.getCurrentSkillExp(STAT_RANGE);
    startexpA = skills.getCurrentSkillExp(STAT_ATTACK);
    startexpS = skills.getCurrentSkillExp(STAT_STRENGTH);
    startexpD = skills.getCurrentSkillExp(STAT_DEFENSE);
    startexpH = skills.getCurrentSkillExp(STAT_HITPOINTS);
    }


    g.setColor(new Color(60, 140, 200, 50));
    g.fill3DRect(1, 219, 180, 100, true);
    g.setColor(new Color(255, 255, 255, 60));
    g.setColor(Color.green);
    g.drawString("Combat Experience Gained: " + xpGained , 9, 235);
    g.drawString("Times died: " + timesDied, 9, 251);
    g.drawString("Runtime:" + hours + ":" + minutes + ":" + seconds + "", 9, 267);
    g.drawString("WhiteKnights v1.3", 9, 283);
    g.draw3DRect(1, 219, 180, 100, true);
    xpGained = skills.getCurrentSkillExp(STAT_STRENGTH) + skills.getCurrentSkillExp(STAT_RANGE) + skills.getCurrentSkillExp(STAT_ATTACK) + skills.getCurrentSkillExp(STAT_DEFENSE) + skills.getCurrentSkillExp(STAT_HITPOINTS) - startexpR - startexpA - startexpS - startexpD - startexpH;
    }
    }
    public int loop() {
    if (isLoggedIn()) {
    if (!getMyPlayer().isInCombat() && getMyPlayer().getAnimation() == -1 && getObjectAt(2970, 3336) != null && getObjectAt(2964, 3339) != null) {
    RSNPC Knights = getNearestNPCByID(19, 3348);
    RSTile tile = Knights.getLocation();
    if (distanceTo(tile) > 4) {
    walkTileMM(tile);
    wait(random(1000,2000));
    }
    if (distanceTo(tile) < 5) {
    atNPC(Knights, "Attack");
    wait(random(1000,3000));
    }
    }
    if (getObjectAt(2964, 3339) == null) {
    RSTile DoorTile1 = new RSTile(2964, 3339);
    RSTile DoorTile2 = new RSTile(2965, 3339);
    RSTile tile1 = new RSTile(2966, 3339);
    if (distanceTo(tile1) > 4)
    walkTileMM(tile1);
    wait(random(1000,2000));
    atDoorTiles(DoorTile1, DoorTile2);
    }
    if (getObjectAt(2970, 3336) == null && getObjectAt(2964, 3339) != null) {
    RSTile DoorTile3 = new RSTile(2970, 3336);
    RSTile DoorTile4 = new RSTile(2970, 3337);
    RSTile tile2 = new RSTile(2970, 3338);
    if (distanceTo(tile2) > 4)
    walkTileMM(tile2);
    wait(random(1000,2000));
    atDoorTiles(DoorTile3, DoorTile4);
    }
    if (inventoryContainsOneOf(item1,item2,item3)) {
    timesDied++;
    }
    if (inventoryContains(item1)) {
    atInventoryItem(item1, "Wield");
    wait(random(1000,2000));
    }
    if (inventoryContains(item2)) {
    atInventoryItem(item2, "Wear");
    wait(random(1000,2000));
    }
    if (inventoryContains(item3)) {
    atInventoryItem(item3, "Wear");
    wait(random(1000,2000));
    }
    if (inventoryContains(item1) || inventoryContains(item2) || inventoryContains(item3))
    timesDied--;
    }
    return 100;
    }
    }

      Current date/time is Thu Mar 28, 2024 9:35 am