Peecs auofighter

Discussion in 'RuneScape 3 Cheating' started by apolamalufan, Jan 2, 2009.

Peecs auofighter
  1. Unread #1 - Jan 2, 2009 at 4:08 PM
  2. apolamalufan
    Joined:
    Dec 13, 2008
    Posts:
    20
    Referrals:
    0
    Sythe Gold:
    0

    apolamalufan Newcomer

    Peecs auofighter

    where can i get this ive heard about it but i cant find it i searched on here and on rsbot.org
     
  3. Unread #2 - Jan 2, 2009 at 4:13 PM
  4. Xane
    Joined:
    Dec 14, 2008
    Posts:
    45
    Referrals:
    0
    Sythe Gold:
    0

    Xane Member

    Peecs auofighter

    People say it's pretty buggy but here it is:

    // .. Remember to have food in first bank slot if you want to live forever.
    // .. Start near the Alkahir mobs.


    /* @News
    * http://svn2.assembla.com/svn/rsbotscripts/news/Peecsautofighter.news.html
    */


    // Imports:

    import java.awt.*;
    import java.util.Map;
    import com.speljohan.rsbot.script.Script;
    import com.speljohan.rsbot.script.wrappers.*;
    import com.speljohan.rsbot.bot.Bot;
    import java.awt.event.KeyEvent;


    public class Peecsautofighter extends Script {
    int MONSTERS_TO_ATTACK = 18;

    // Generic initalizers
    boolean Dologout=false;
    public boolean dobankget=false;

    // player spesific
    int eat_health = 30;
    int foodtotalcount = 0;
    private int anti = 1;

    public int DEFENCE = 1;
    public int ATTACK = 0;
    public int STRENGTH = 2;
    public int RANGE = 4;
    public int style = 2;
    public String style2 = "Strength";
    public int selectStyle = 0;
    public boolean quickAttack = true;

    // @ Food ids from stronghold. Thnx.
    public final int[] FOOD_ID = { 1895,1893,1891, 4293, 2142, 4291, 2140, 3228, 9980, 7223, 6297, 6293, 6295, 6299, 7521, 9988, 7228, 2878, 7568, 2343, 1861, 13433, 315, 325, 319, 3144, 347, 355, 333, 339, 351, 329, 3381, 361, 10136, 5003, 379, 365, 373, 7946, 385, 397, 391, 3369, 3371, 3373, 2309, 2325, 2333, 2327, 2331, 2323, 2335, 7178, 7180, 7188, 7190, 7198, 7200, 7208, 7210, 7218, 7220, 2003, 2011, 2289, 2291, 2293, 2295, 2297, 2299, 2301, 2303, 1891, 1893, 1895, 1897, 1899, 1901, 7072, 7062, 7078, 7064, 7084, 7082, 7066, 7068, 1942, 6701, 6703, 7054, 6705, 7056, 7060, 2130, 1985, 1993, 1989, 1978, 5763, 5765, 1913, 5747, 1905, 5739, 1909, 5743, 1907, 1911, 5745, 2955, 5749, 5751, 5753, 5755, 5757, 5759, 5761, 2084, 2034, 2048, 2036, 2217, 2213, 2205, 2209, 2054, 2040, 2080, 2277, 2225, 2255, 2221, 2253, 2219, 2281, 2227, 2223, 2191, 2233, 2092, 2032, 2074, 2030, 2281, 2235, 2064, 2028, 2187, 2185, 2229 }; //Has almost every food cookable in runescape, members and non!

    // @ Bank Window ID
    public static final int[] bankWindows = new int[] { 35647 };
    // @ Bank Tile Path
    RSTile[] BankTiles = new RSTile[]{new RSTile(3293,3175),new RSTile(3279,3180),new RSTile(3274,3167),new RSTile(3269,3167)};

    // @ create Bank Path
    RSTilePath BankPath = new RSTilePath(BankTiles,this);

    public double getVersion() {
    return 0.4;
    }

    public String getName() {
    return "Peecsautofighter";
    }

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

    public boolean onStart(Map<String, String> args) {
    log(getName()+" v."+getVersion()+". Created by "+getAuthor());
    log("Thanks for using my autofighter. I hope you just enjoy it!");
    get_food_count();

    if (args.get("style").equals("attack")){
    style2 = "Attack";
    style = ATTACK;
    }
    if (args.get("style").equals("defence")) {
    style2 = "Defence";
    style = DEFENCE;
    }
    if (args.get("style").equals("strength")) {
    style2 = "Strength";
    style = STRENGTH;
    }
    if (args.get("style").equals("range")) {
    style2 = "Range";
    style = RANGE;
    }
    eat_health = Integer.parseInt(args.get("eat_at_hp"));

    return true;
    }

    // @ Main LOOP
    public int loop() {
    if (isLoggedIn()){
    if (selectStyle == 0 ){
    wait(random(1000,2000));
    styleSelecter();
    }
    // @ Logout?
    int logout_status = logout_check();
    if (logout_status==2){
    return random(750, 1500);
    }else if(logout_status==1){
    return -1;
    }

    if (skills.getCurrentSkillLevel(3) <= eat_health ){
    if (eat_check()==true)return random(700, 1600);
    }
    bankIfLowFood();

    // Go bank get food
    if (this.dobankget==true){
    if(bankget()==true)return random(700, 1600);
    }

    // Is player in combat?
    if (getMyPlayer().isInCombat()) {
    return random(1500, 2250);
    }
    if (getMyPlayer().getInteracting() != null && !getMyPlayer().isMoving() ) {
    antiban();
    }
    // @Fight system
    if (!getMyPlayer().isInCombat()) {
    RSNPC Mobs = getNearestNPCByID(MONSTERS_TO_ATTACK);
    if (Mobs != null){
    log("Attacking mob");
    atNPC(Mobs, "Attack");
    return random(1000, 2000);//Its abit messy in alkha.. So we just wait for some.
    }else{
    log("I found no mobs, trying again soon.");
    return random(500, 2000);
    }
    }


    return random(500, 1000);
    }else{ random(500, 1000); }
    log("Some error encourted, please inform Peec on rsvids.com on this matter, he will _SURELY_ correct it.");
    return -1;
    }
    // @@ End Main Loop


    public String getScriptDescription() {
    String html = "";
    html += "<html>";
    html += "<head>";
    html += "<style type=\"text/css\">div.main { margin-top: 115px; } div.leftcol { float: left; } div.rightcol { float: right; } div.floatclear { clear: both; } p {margin-left: 15px} body { font-family: Tahoma; color: #000000; background-color:#FFFFFF }</style>";
    html += "</head>";
    html += "<body>";
    html += "<center>";
    html += "<div>Welcome to Peecsautofighter. This will fight the warriors in alkahir, you will need to have food in bag and in first bank slot, when its empty for food in bag, it will go to bank and get food.";
    html += "<p><a href=\"http://svn2.assembla.com/svn/rsbotscripts/news/Peecsautofighter.news.html\"> Click here for news...</a></p>";
    html += "<br /><b>Follow simple steps:</b>";
    html += "<ul><li>1. Start left of alkahir bank, with the warriors ( Its those you are going to fight. )</li><li>2. Remember to have food in FIRST bank slot and food in bag.. </li><li>3. Set the HP to eat at ... in script setup. </li></ul>";
    html += "</div><div class=\"main\"";
    html += "<span class=\"style1\">";
    html += "<table width=\"200\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>";
    html += "<td width=\"123\">When to eat (HP)</td>";
    html += "<td width=\"77\"><input type=\"text\" name=\"eat_at_hp\"2 value=\"30\"></td>";
    html += "</tr><tr>";
    html += "<td width=\"123\">Fighting style:</td>";
    html += "<td width=\"77\">Strength<input type=\"radio\" name=\"style\" value=\"strength\" checked >Attack<input type=\"radio\" name=\"style\" value=\"attack\">Deffence<input type=\"radio\" name=\"style\" value=\"deffence\">Range<input type=\"radio\" name=\"style\" value=\"range\"> </td>";
    html += "</tr><tr>";
    html += "</tr></table><br /><br /><br /><br /><br />";
    html += "</div>";
    html += "</span>";
    html += "</center>";
    html += "</body>";
    html += "</html>";
    return (html);
    }

    private void get_food_count(){
    this.foodtotalcount=0;
    for(int I = 0; I<FOOD_ID.length; I++) {
    if(getInventoryCount(FOOD_ID) >= 1) {
    this.foodtotalcount += getInventoryCount(FOOD_ID);
    }
    }
    }
    private boolean bankIfLowFood(){
    if (this.foodtotalcount <= 2){
    log("I must go to bank because i only got "+foodtotalcount+" food left...");
    this.dobankget=true;
    return true;
    }else{
    return false;
    }
    }

    // @ Eats and checks if it needs to go bank
    private boolean eat_check(){
    log("Im low on HP, going to check if i have somthing to eat...");

    if (this.foodtotalcount > 0){
    for(int I = 0; I<FOOD_ID.length; I++) {
    if(getInventoryCount(FOOD_ID) >= 1) {
    eat(FOOD_ID);
    this.foodtotalcount--;
    }
    }
    }else{
    return false;
    }
    return true;
    }
    // @ Eats spesific food id
    private boolean eat(int id){
    log("Eating. (#Food ID "+id+"). ");
    atInventoryItem(id, "Eat");
    wait(random(1500,4000));
    return true;
    }

    // @ Goes to bank, gets first bank inventory item , withraw all food...
    private boolean bankget(){
    setRun(true);
    try{
    BankPath.walkToEnd();
    }catch (Exception e){
    log("An error occured whilst walking");
    }

    wait(random(5000,9000));
    RSObject bankWindow = findObject(bankWindows);
    if (!bank.getInterface().isValid()) {
    atObject(bankWindow, "Use-quickly");
    wait(random(1500, 1750));
    }
    clickMouse(random(38, 74), random(92, 124), false);
    wait(random(200, 700));
    atMenu("Withdraw-All");
    bank.close(); // close bank window

    get_food_count();

    this.dobankget=false;

    if (this.foodtotalcount <= 2){
    log("You had no food left in bank slot 1 :( so we exit (sorry)... ");
    //Dologout=true;
    return true;
    }
    try{
    BankPath.walkToStart();
    }catch (Exception e){
    log("An error occured whilst walking");
    }
    return true;
    }


    // Logout if this::logout = true and player is not in combat.
    private int logout_check(){
    if (Dologout==true && !getMyPlayer().isInCombat()){
    log("Logging out... ");
    logout();
    return 1;
    }else if (Dologout==true && getMyPlayer().isInCombat()){
    log("I can not logout, i am in combat, waiting for next round, maybe I can then.");
    return 2;
    }
    return 0;
    }

    // @Functions from Stronghold.
    public void styleSelecter() {
    for(int j=70; j<101 ; j++) {
    for(int i=27; i<37 ; i++) {
    if (RSInterface.getChildInterface(j, i).containsText(style2)) {
    openTab(TAB_ATTACK);
    wait(random(500,1000));
    atInterface(j,i);
    log("Style Set, Training "+ style2);
    selectStyle = 1;
    }

    }
    }
    if (selectStyle == 0) {
    log("Setting Style Failed.");
    selectStyle = 1;
    }

    }
    public void antiban() {

    anti = random(0,110);

    if (anti <= 35){
    moveMouse(random(0,764),random(0,501));

    }

    if (anti >= 36 && anti <= 41 ){
    if(random(0,1)==1) {
    myOpenTab(random(0,12));
    }else{
    openTab(random(0,12));
    }
    }

    if (anti >= 42 && anti <= 52){
    if(random(0,1)==1) myOpenTab(TAB_STATS);
    openTab(TAB_STATS);
    wait( random(250,700));
    moveMouse(random(556,707),random(230,442));
    wait( random(750,1500));
    }

    if (anti >= 53 && anti <= 63){
    if (!isRunning()){
    setRun(true);
    }else {
    if(random(0,1)==1) myOpenTab(TAB_STATS);
    openTab(TAB_STATS);
    wait( random(350,800));
    moveMouse(random(556,648),random(230,281));
    wait( random(550,1300));

    }
    }
    if (anti >= 64 && anti <= 90){
    rotate();
    }



    }
    public void myOpenTab(int tab) { // Credit goes to nebule for this!
    if (tab == getCurrentTab()) {
    return;
    }
    switch(tab) {
    case TAB_ATTACK: input.holdKey((char) KeyEvent.VK_F1, random(300, 700)); break;
    case TAB_STATS: input.holdKey((char) KeyEvent.VK_F2, random(300, 700)); break;
    case TAB_QUESTS: input.holdKey((char) KeyEvent.VK_F3, random(300, 700)); break;
    case TAB_INVENTORY: input.holdKey((char) KeyEvent.VK_F4, random(300, 700)); break;
    case TAB_EQUIPMENT: input.holdKey((char) KeyEvent.VK_F5, random(300, 700)); break;
    case TAB_PRAYER: input.holdKey((char) KeyEvent.VK_F6, random(300, 700)); break;
    case TAB_MAGIC: input.holdKey((char) KeyEvent.VK_F7, random(300, 700)); break;
    case TAB_FRIENDS: input.holdKey((char) KeyEvent.VK_F8, random(300, 700)); break;
    default: openTab(tab); break;
    }
    }
    public void turnCamera() {
    char[] LR = new char[] { KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT };
    char[] UD = new char[] { KeyEvent.VK_UP, KeyEvent.VK_DOWN };
    char[] LRUD = new char[] { KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT,
    KeyEvent.VK_UP, KeyEvent.VK_DOWN };
    int random2 = random(0, 2);
    int random1 = random(0, 2);
    int random4 = random(0, 4);

    if (random(0, 3) == 0) {
    Bot.getInputManager().pressKey(LR[random1]);
    try {
    Thread.sleep(random(100, 400));
    } catch (Exception e) {}
    Bot.getInputManager().pressKey(UD[random2]);
    try {
    Thread.sleep(random(300, 600));
    } catch (Exception e) {}
    Bot.getInputManager().releaseKey(UD[random2]);
    try {
    Thread.sleep(random(100, 400));
    } catch (Exception e) {}
    Bot.getInputManager().releaseKey(LR[random1]);
    } else {
    Bot.getInputManager().pressKey(LRUD[random4]);
    if (random4 > 1) {
    try {
    Thread.sleep(random(300, 600));
    } catch (Exception e) {}
    } else {
    try {
    Thread.sleep(random(500, 900));
    } catch (Exception e) {}
    }
    Bot.getInputManager().releaseKey(LRUD[random4]);
    }
    }

    public void rotate() {
    int button = random(37,40);
    Bot.getInputManager().pressKey((char) button);
    wait(random(500, 1500));
    Bot.getInputManager().releaseKey((char) button);

    }

    }
     
< Problem with randoms? | Someone should make "You NEED these scripts" topic >

Users viewing this thread
1 guest


 
 
Adblock breaks this site