• Log in or sign up for an account here: https://www.sythe.org/login

Minimizable Auto alching script / RSBot Script?

Status
Not open for further replies.

Nerdsta Son

Forum Addict

Banned
Joined
May 20, 2008
Sythe Gold
0
Messages
293
Yeah, Just wondering if theres one around. Don't need randoms, Just a clicker that i can minimize, or what thats in RSBot. Add me on msn if you got one, or can make me one. Or post here

[email protected]
 
here is an rsbot script that alchs inside your house with building mode on

Script Name: HouseAlcher.java
Script author: bloodyargon
*instructions*
1st argument u put in is the id of wha you alching
2nd argument you put in is the id of what house portal ur using

Code:
import java.awt.*;
import com.speljohan.rsbot.event.listeners.PaintListener;
import com.speljohan.rsbot.event.listeners.ServerMessageListener;
import com.speljohan.rsbot.event.events.ServerMessageEvent;
import com.speljohan.rsbot.script.*;
import com.speljohan.rsbot.script.wrappers.*;
import com.speljohan.rsbot.script.wrappers.RSTile;
import com.speljohan.rsbot.bot.Bot;
import com.speljohan.rsbot.accessors.*;
import com.speljohan.rsbot.accessors.Character;
import com.speljohan.rsbot.account.Account;
import java.awt.Graphics;
import com.speljohan.rsbot.event.listeners.PaintListener;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.lang.reflect.Array;
import java.applet.Applet;
import java.awt.Point;


public class HouseAlcher extends Script implements PaintListener {
    public long startTime = System.currentTimeMillis();
    public int alched = 0;
    public int alchID = -1; //856
    public int nature = 561;
    public int housePortal = -1; //15479
    public boolean canAlch = false;
    public int startXP = 0;
    public int currentXP = 0;
    public double getVersion( ) {
        return( 0.01 );
    }
    public String getName( ) {
        return( "AutoAlcher[POH]" );
    }

    public String getAuthor( ) {
        return( "Blood Argon" );
    }

    public String getScriptCategory() {
        return( "Blood Argon" );
    }

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

        html += "<html>\n";
        html += "<body>\n";
        html += "<h2>" + getName( ) + " v" + getVersion( ) + "</h2><br>\n";
        html += "Author: " + getAuthor( ) + "<br>\n";
        html += "<br>\n";
        html += "<center>\n";
        html += "First Arg : ID of item to alch.\n";
        html += "Second Arg : Outside your house portal, its ID\n";
        html += "Example : 856,15479\n";
        html += "Arguments:<input type=\"text\" name=\"args\">\n";
        html += "</center>\n";
        html += "</body>\n";
        html += "</html\n";

        return( html );
    }
    public boolean onStart(String[] args) {
        Bot.getEventManager( ).addListener(PaintListener.class, this);
        if(args.length < 1) {
            log("You didnt fill in the proper arguments!");
            return (false);
        }
        alchID = Integer.parseInt(args[0]);
        housePortal = Integer.parseInt(args[1]);
        log("alchID : "+alchID+" housePortal "+housePortal);
        if (isLoggedIn())
        {
            startXP = skills.getCurrentSkillExp(STAT_MAGIC);
        } else {
            log("Please start logged in for proper XP counting.");
            log("Now stopping script");
            Bot.getEventManager( ).removeListener(PaintListener.class, this);
            log("Paint listener removed");
            wait(1000);
            return(false);
        }    
        return( true );
    }
        public void onFinish( ) {
            Bot.getEventManager( ).removeListener(PaintListener.class, this);
        }
    public int loop( ) {    
        if (findObject(10, housePortal) != null) {
            RSObject portal = findObject(10, housePortal);
            if (atObject(portal, "Enter")) {
                if(interfaceExists(232)) {
                        atInterface(232,3);
                        wait(random(1000,2000));
                        log("Entering house");
                        canAlch = true;
                        wait(random(7000,10000));
                }
            } else {
                rotate();
            }
        } else {
            //log("Didnt find the portal");
            canAlch = true;
        }    
    if (canAlch == true)
    {
        antiBan();
        
        if (getCurrentTab() != TAB_MAGIC)
            myOpenTab(TAB_MAGIC);
            



        if(getMyPlayer().getAnimation() == -1) {
            //castSpell(36);
            if (!RSInterface.getInterface(13).isValid()) {             
                  highAlch(36);           
                    clickInventoryItem(alchID,true);    
            }
        }
        
        if (isLoggedIn())
        {
            if (getInventoryCount(nature) == 0) {
                log("Out of natures");
                stopAllScripts();
            }
            if (getInventoryCount(alchID) == 0) {
                log("Out of alching item : "+alchID);
                stopAllScripts();
            }
        }
        
    }
    
    return random(500,800);
        } //Loop end
            public void highAlch(int spell) {//Blood Argon
             int x = 0;
              int y = 0;
              if (spell == 36) { //High Alch
                  x = 572;
                  y = 347;
              }
              if (spell == 14)
                 {
                  x = 716;
                  y = 251;
              }
          clickMouse(x + random(-5, 5), y + random(-5, 5), true);
            }
        public void rotate() {
            int button = random(37,40);
            Bot.getInputManager().pressKey((char) button);
            wait(random(500, 1500));
            Bot.getInputManager().releaseKey((char) button);
        }
            public int antiBan() {
        switch(random(0, 800)) {
            case 0: rotate(); break;
            case 1: rotate(); break;
            case 2: rotate(); break;
            case 3: rotate(); break;
            case 4: rotate(); break;
            case 5: rotate(); break;
            case 6: rotate(); break;
            case 7: rotate(); break;

            case 8: setRun(true); break;

            case 9: rotate(); break;
            case 10: moveMouse(random(0, 515), random(0, 337)); break;
            case 11: moveMouse(random(0, 515), random(0, 337)); break;
            case 12: moveMouse(random(0, 515), random(0, 337)); break;
            case 13: moveMouse(random(0, 515), random(0, 337)); break;
            case 14: moveMouse(random(0, 515), random(0, 337)); break;
            case 15: moveMouse(random(0, 764), random(0, 502)); break;
            case 16: moveMouse(random(0, 764), random(0, 502)); break;
            case 17: moveMouse(random(0, 764), random(0, 502)); break;

            case 18: openTab(TAB_INVENTORY); break;
            case 19: openTab(TAB_INVENTORY); break;
            case 20: openTab(TAB_STATS); break;
            case 21: openTab(TAB_STATS); break;
            case 23: openTab(random(0, 13)); break;
            case 24: openTab(random(0, 13)); break;
            case 25: 
                int X = getMyPlayer().getLocation().getX();
                int Y = getMyPlayer().getLocation().getY();
                int rX = random(-15,15);
                int rY = random(-15,15);
                int newX = X+rX;
                int newY = Y+rY;
                RSTile tilez2 = new RSTile(newX, newY);
                walkTileMM(tilez2); 
                log("Initiate Walking");
            break;
            default: break;

        }
        return random(300, 500);
    }

        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;
            int x = 9;
            int y = 188;
            //interval of 12
            int xp = 65;
            int XPGain = 0;
            XPGain = currentXP - startXP;
            int countToNext = 0;
            countToNext = skills.getXPToNextLevel(STAT_MAGIC) / xp + 1;
            currentXP = skills.getCurrentSkillExp(STAT_MAGIC);
            alched = XPGain / xp;
            
            float expPerSec = 0;        
      if ((minutes > 0 || hours > 0 || seconds > 0) && XPGain > 0) {
         expPerSec = ((float) XPGain)/(float)(seconds + (minutes*60) + (hours*60*60));
      }
            float expPerMin = expPerSec * 60;
         float expPerHour = expPerMin * 60;    
        g.setColor(Color.blue);
        g.drawString("==Alcher==", x, y); 
        g.setColor(Color.white);
        g.drawString("Alched : "+alched, x, y+=12); 
        g.drawString("XP Gained "+XPGain, x, y+=12);
        g.drawString("Alchs till Level : "+countToNext+".", x, y+=12);    
        g.drawString("Exp Per Hour: " + (int)expPerHour, x, y+=12);
        g.drawString("Alchs Per Hour: " + ((int)expPerHour/xp), x, y+=12);
        g.drawString("Currently level " + skills.getCurrentSkillLevel(STAT_MAGIC) + " and " + skills.getPercentToNextLevel(STAT_MAGIC) + "% to next level", x, y+=12);    
        g.drawString("Runtime: " + hours + " hours " + minutes + " minutes " + seconds + " seconds.", x, y+=12);
    }
    }
      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 boolean clickInventoryItem(int itemID, boolean click) {
        if (getCurrentTab() != TAB_INVENTORY
                && !RSInterface.getInterface(INTERFACE_BANK).isValid()
                && !RSInterface.getInterface(INTERFACE_STORE).isValid()) {
            openTab(TAB_INVENTORY);
        }
        int[] items = getInventoryArray();
        java.util.List<Integer> possible = new ArrayList<Integer>();
        for (int i = 0; i < items.length; i++) {
            if (items[i] == itemID) {
                possible.add(i);
            }
        }
        if (possible.size() == 0) return false;
        int idx = possible.get(random(0, possible.size()));
        Point t = getInventoryItemPoint(idx);
        clickMouse(t, 5, 5, click);
        return true;
    }
    
    
    
}

or, theres just a regular alcher if you dont have a house

script name: AutoAlcher.java
script author: Zachafer

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

public class AutoAlcher extends Script{

	int spellid = 0;
	int item = 0;
	static int natureid = 561;
	
	int a, b;
	int x, y;
	
	public double getVersion() {
		return 0.1;
	}

	public String getScriptCategory() {
		return "Magic";
	}

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

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

	public boolean onStart(Map<String, String> args) {
		if (args.get("alch").equals("low")) {
			spellid = 14;
			a = 703;
			b = 262;
			x = 715;
			y = 250;
		} else {
			spellid = 36;
			a = 570;
			b = 335;
			x = 572;
			y = 349;
		}
		item = Integer.parseInt(args.get("id"));
		log("Alch type = " + args.get("alch"));
		log("Item ID = " + item);
		return true;
	}

	public int loop() {
		if (!inventoryContains(natureid)) {
			log("Out of nature runes!");
			return -1;
		}
		if (!inventoryContains(item)) {
			log("Out of items to alch!");
			return -1;
		}
		openTab(TAB_MAGIC);
		clickMouse(x + random(-7, 7), y + random(-7, 7), true);
		wait(random(300, 800));
		clickMouse(a + random(-7, 7), b + random(-7, 7), true);
		return random(1000, 2000);
	}

	public String getScriptDescription() {
		String html = "";
		html += "<html>";
		html += "<center>";
		html += "<h2>" + getName() + "</h2>";
		html += "<br />";
		html += "<b>Author:</b> " + getAuthor();
		html += "<br />";
		html += "<b>Version:</b> " + getVersion();
		html += "<br /><br />";
		html += "<b>Arguments:</b>";
		html += "<br />";
		html += "<br />";
		html += "<form>";
		html += "<input type=\"radio\" name=\"alch\" value=\"low\"> Low alch";
		html += "&nbsp; <input type=\"radio\" name=\"alch\" value=\"high\" checked=\"true\"> High alch";
		html += "<br />Item ID: <input type=\"text\" name=\"id\">";
		html += "</form>";
		html += "<br />";
		html += "Place the item in the <b>13<sup>th</sup></b> inventory slot.";
		html += "</center>";
		html += "</html>";
		return html;
	}
}
 
how do i put that script in my RSBOT? i also need a .class file
 
Status
Not open for further replies.
Runescape Gamblingrunescape gambling
Back
Top