Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import java.util.Map;
- import org.rsbot.script.Constants;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.Skills;
- import org.rsbot.script.wrappers.RSInterfaceChild;
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- /**
- *
- * @author Frank
- */
- @ScriptManifest(authors = "IBotAllDay", name = "IPickFungi", category = "Money Making",
- description = "<html>\n"
- + "<head></head><body>"
- + "<b><center>IPickFungi by: IBotAllDay</center><center>"
- + "</html></body>", version = 1.0)
- public class IPickFungi extends Script {
- public int lumbyTabID = 8008;
- public int fungiID = 2970;
- public int price = 0;
- public int lawID = 563;
- public int bloodID = 565;
- public int altarID = 36972;
- public int bBoothID = 24914;
- public int closedID = 24936;
- public RSTile outsideGateTile = (new RSTile(3444, 3458));
- public int[] gateID = {3506, 3507};
- public int logID = 3508;
- public RSTile logsTile = (new RSTile(3436, 3453));
- public int fungiLogID = 3509;
- public int sickleID = 2963;
- @Override
- public boolean onStart(final Map<String, String> args) {
- new Thread() {
- @Override
- public void run() {
- price = grandExchange.loadItemInfo(fungiID).getGuidePrice();
- }
- }.start();
- return true;
- }
- @Override
- public int loop() {
- if (getInventoryCount(lawID) < 2 || getInventoryCount(bloodID) < 2) {
- log.warning("We ran out of runes to teleport. Stopping");
- stopScript();
- }
- if (isInventoryFull()) {
- if (!atLumbridge()) {
- if (isIdle()) {
- atInventoryItem(lumbyTabID, "Break");
- }
- wait(random(1000, 1200));
- } else {
- if (isIdle() || distanceTo(getDestination()) < 4) {
- RSObject altar = getNearestObjectByID(altarID);
- if (altar != null) {
- if (altar.isOnScreen()) {
- if (isIdle()) {
- altar.action("Pray");
- }
- } else {
- walkTo(altar.getLocation());
- }
- } else {
- walkTo(new RSTile(3243, 3209));
- }
- wait(random(900, 1300));
- }
- }
- } else {
- if (!atCanifis()) {
- if (getCurrentTab() != Constants.TAB_MAGIC) {
- openTab(Constants.TAB_MAGIC);
- } else if (getCurrentTab() == Constants.TAB_MAGIC) {
- getInterface(193, 42).action("Cast");
- }
- } else {
- if (inSwamp()) {
- RSObject fungiLog = getNearestObjectByID(fungiLogID);
- if (fungiLog != null) {
- //TODO code
- } else {
- walkTo(logsTile);
- }
- } else {
- if (outsideGateTile.isOnScreen()) {
- //TODO enter gate
- } else if (isIdle() ||distanceTo(getDestination()) < 4){
- walkTo(outsideGateTile);
- wait(random(900, 1300));
- }
- }
- if (inInn()){
- RSObject door = getNearestObjectByID(closedID);
- if (door != null){
- door.action("Open");
- wait(random(500, 900));
- } else {
- walkTo(new RSTile());
- }
- }
- }
- }
- return random(100, 500);
- }
- public boolean atLumbridge() {
- return distanceTo(new RSTile(3223, 3219)) < 100;
- }
- public boolean atCanifis() {
- return distanceTo(new RSTile(3495, 3477)) < 100;
- }
- public boolean inSwamp() {
- return false;
- }
- public int getPrayPoints() {
- return skills.getCurrSkillLevel(STAT_PRAYER);
- }
- public void RechargePrayer() {
- if (skills.getRealSkillLevel(STAT_PRAYER) != getPrayPoints()) {
- }
- }
- }
Add Comment
Please, Sign In to add comment