Drewyboyo Posted December 29, 2016 Share Posted December 29, 2016 Thanks to @imateamcape for helping me through writing this first one and helping me understand allot of the functioning of how the script works. Any help or opinions on what I could change/add to make it better would be appreciated, after this has been refined (Since it obviously is from Apa's tutorial) I will try and make another script based off the foundations I have learned. 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.script.Script;import org.osbot.rs07.script.ScriptManifest;import java.awt.*;@ScriptManifest(author = "Drewyboyo", info = "noob script x d", name = "Tea Thiever", version = 0, logo = "")public class main extends Script {@@Overridepublic void onStart() {log("Welcome to TeaCx.");log("If you experience any issues while running this script please report them to me on the forums.");log("Enjoy the tea .");}private enum State {TO_BANK,OPEN_BANK,USE_BANK,TO_STALL,STEAL};private Area myBank = (Banks.VARROCK_EAST);private Area thievingArea = (new Area(3267, 3415, 3271, 3409));private State getState() {if(inventory.isFull()) {if(myBank.contains(myPlayer())) {if(getBank().isOpen()) {return State.USE_BANK;}return State.OPEN_BANK;}return State.TO_BANK;}if(thievingArea.contains(myPlayer())) {return State.STEAL;}return State.TO_STALL;}@@Overridepublic int onLoop() throws InterruptedException {switch (getState()) {case TO_STALL:getWalking().webWalk(thievingArea);break;case TO_BANK:getWalking().webWalk(myBank);break;case OPEN_BANK:break;case USE_BANK:getBank().depositAll();break;case STEAL:RS2Object stall = getObjects().closest("Tea Stall");if(stall != null) {if(stall.hasAction("Steal-from") && stall.interact("Steal-from")) {return random(1900, 2500);}}break;}return random(200, 300);}@@Overridepublic void onExit() {log("Thanks for running my Tea Thiever!");}@@Overridepublic void onPaint(Graphics2D g) {}} Quote Link to comment Share on other sites More sharing options...
Hayase Posted December 29, 2016 Share Posted December 29, 2016 (edited) case STEAL: RS2Object stall = getObjects().closest("Tea Stall"); if(stall != null) { if(stall.hasAction("Steal-from") && stall.interact("Steal-from")) { return random(1900, 2500); } } break; Use conditional sleeps so you don't have to worry about sleeping for too little or too long. It's a good idea to get used to using conditional sleeps now for later down the road if you decide to make other scripts that involve interacting with NPCs/objects. case STEAL: RS2Object stall = getObjects().closest("Tea Stall"); if(stall != null) { if(stall.hasAction("Steal-from") && stall.interact("Steal-from")) { new ConditionalSleep(3_000) { @[member='Override'] public boolean condition() throws InterruptedException { return myPlayer().isAnimating(); } }.sleep(); } } break; Edited December 29, 2016 by Hayase Quote Link to comment Share on other sites More sharing options...
Drewyboyo Posted December 29, 2016 Author Share Posted December 29, 2016 case STEAL: RS2Object stall = getObjects().closest("Tea Stall"); if(stall != null) { if(stall.hasAction("Steal-from") && stall.interact("Steal-from")) { return random(1900, 2500); } } break; Use conditional sleeps so you don't have to worry about sleeping for too little or too long. It's a good idea to get used to using conditional sleeps now for later down the road if you decide to make other scripts that involve interacting with NPCs/objects. case STEAL: RS2Object stall = getObjects().closest("Tea Stall"); if(stall != null) { if(stall.hasAction("Steal-from") && stall.interact("Steal-from")) { new ConditionalSleep(3_000) { @[member='Override'] public boolean condition() throws InterruptedException { return myPlayer().isAnimating(); } }.sleep(); } } break; I was just starting to make a f2p miner, how do i differ rocks from eachother? ex: They're just called rocks, not iron, copper, etc. Quote Link to comment Share on other sites More sharing options...
Hayase Posted December 29, 2016 Share Posted December 29, 2016 I was just starting to make a f2p miner, how do i differ rocks from eachother? ex: They're just called rocks, not iron, copper, etc. http://osbot.org/forum/topic/88389-mining-rocks-with-ore-no-ids/ Quote Link to comment Share on other sites More sharing options...
Drewyboyo Posted December 29, 2016 Author Share Posted December 29, 2016 (edited) http://osbot.org/forum/topic/88389-mining-rocks-with-ore-no-ids/ getting the same error someone mentioned in the thread of not being able to read the Java 8, looked up a guide on how to set my eclipse project to do so and still getting the errors. edit: I'll do something instead of mining for now. Edited December 29, 2016 by Drewyboyo Quote Link to comment Share on other sites More sharing options...