Jump to content

nmba

Members
  • Posts

    6
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

806 profile views

nmba's Achievements

Newbie

Newbie (1/10)

1

Reputation

  1. nmba

    LMS points

    hello kashyal , i can do that for u. hmu on discord MOBERTO#2928
  2. nmba

    first script

    i changed to bank method to this : public void bank() throws InterruptedException { int randomSleepAfterBank = random(5000,25000); if (!Banks.LUMBRIDGE_UPPER.contains(myPosition())){ getWalking().webWalk(Banks.LUMBRIDGE_UPPER); }else if(!getBank().isOpen()) { getBank().open(); }else if (!getInventory().isEmpty()){ getBank().depositAll("logs"); }else getBank().close(); } is this any better? thanks for the tips already tho
  3. hello guys , today ive been working on my first script. Due to @Explv advise i finally finished my java bootcamp and im feeling way more comfortable to code now. Anyways can u guys maybe give some tips on how i maybe can improve my script/code. import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.map.constants.Banks; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; import java.util.Random; @ScriptManifest(author = "Mob", name = "simple", info = "test", version = 0.1, logo = "") public final class TestingBot extends Script { @Override public final int onLoop() throws InterruptedException { //checking what wc lvl u are to check what to chop int startWcLevel = getSkills().getStatic(Skill.WOODCUTTING); //lvl < 20 and inv not full --> chop if (startWcLevel < 20 && !getInventory().isFull()){ chop(); //lvl > 20 and inv not full --> chopoak }else if (startWcLevel > 20 && !getInventory().isFull()){ chopOak(); }else bank(); return 200; } public void chop() throws InterruptedException { //making area , if position is not in the area --> walk to random pos. in the area Area treeArea = new Area(3181,3235,3205,3256); if (!treeArea.contains(myPosition())){ getWalking().webWalk(treeArea.getRandomPosition()); } //getting closest tree in the area --> if not null and can interact RS2Object tree = getObjects().closest(treeArea,"tree"); if (tree != null && tree.interact("Chop down")) { //sleeps while doing action to click the tree sleep(random(1800,2500)); //new conditional sleep when animating , tree doesnt exist new ConditionalSleep(random(5000,7000)) { @Override public boolean condition() { return !myPlayer().isAnimating() || !tree.exists(); } }.sleep(); } } public void chopOak() throws InterruptedException { Area treeOakArea = new Area(3186,3238,3207,3253); if (!treeOakArea.contains(myPosition())){ getWalking().webWalk(treeOakArea.getRandomPosition()); } RS2Object tree = getObjects().closest(treeOakArea,"Oak"); if (tree != null && tree.interact("Chop down")) { sleep(random(1800,2500)); new ConditionalSleep(random(5000,7000)) { @Override public boolean condition() { return !myPlayer().isAnimating() || !tree.exists(); } }.sleep(); } } public void bank() throws InterruptedException { int randomSleepAfterBank = random(5000,25000); if (!Banks.LUMBRIDGE_UPPER.contains(myPosition())){ getWalking().webWalk(Banks.LUMBRIDGE_UPPER); }else if(!getBank().isOpen()) { getBank().open(); getBank().depositAll("Logs"); getBank().close(); sleep(randomSleepAfterBank); } } }
  4. can i get a trial for the woodcutting bot plz
  5. hello trying to write my first script but i got a few problems @Override public int onLoop() throws InterruptedException { RS2Object stall = getObjects().closest("Tea Stall"); Area area = Banks.VARROCK_EAST; if (getInventory().isFull()) { if (!area.contains(myPosition())) { getWalking().webWalk(area); getBank().open(); if (bank.isOpen()) { bank.depositAll(); } else { getBank().open(); } else{ getWalking().webWalk(area); } else{ getWalking().webWalk(stall.getPosition()); } } } else if (stall != null && !myPlayer().isAnimating()) { stall.interact("Steal-from"); } return random(200, 300); } i already figured out that the problem is that i use : IF IF IF , ELSE ELSE ELSE but need to use if else , else if . But i cant figure out how i should do it exactly. Can someone please help me.
×
×
  • Create New...