Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.osbot.rs07.api.map.Area;
- import org.osbot.rs07.api.map.Position;
- import org.osbot.rs07.api.model.Item;
- import org.osbot.rs07.api.model.RS2Object;
- import org.osbot.rs07.script.Script;
- import org.osbot.rs07.script.ScriptManifest;
- import java.awt.*;
- import java.util.List;
- @ScriptManifest(author = "You", info = "My first script", name = "walking", version = 0, logo = "")
- public class Trial extends Script {
- boolean Composted = false;
- int Tele = 0;
- Area cath = new Area(2811, 3465, 2816, 3461);
- Area farm = new Area(3057, 3313, 3060, 3309);
- Area ard = new Area(2668, 3376, 2674, 3372);
- @Override
- public void onStart() {
- log("Welcome to Simple Tea Thiever by Apaec.");
- log("If you experience any issues while running this script please report them to me on the forums.");
- log("Enjoy the script, gain some thieving levels!.");
- }
- private enum State {
- PLANT, COMPOST, RAKE, CAMMY, FALLY, ARDY, HARVEST
- };
- private State getState() {
- RS2Object herbs = getObjects().closest("Herbs");
- RS2Object patch = getObjects().closest("Herb patch");
- if (herbs != null && herbs.hasAction("Pick"))
- return State.HARVEST;
- if (patch != null && patch.hasAction("Rake"))
- return State.RAKE;
- if (patch != null && !patch.hasAction("Rake") && Composted != true)
- return State.COMPOST;
- if (patch != null && !patch.hasAction("Rake") && Composted == true)
- return State.PLANT;
- if (patch == null && !myPlayer().isMoving() && Tele == 1)
- return State.FALLY;
- if (patch == null && !myPlayer().isMoving() && Tele == 2)
- return State.CAMMY;
- if (patch == null && !myPlayer().isMoving() && Tele == 3);
- return State.ARDY;
- }
- @Override
- public int onLoop() throws InterruptedException {
- switch (getState()) {
- case COMPOST:
- if(getInventory().isItemSelected()){
- RS2Object patch = getObjects().closest("Herb patch");
- if(patch != null)
- patch.interact("Use");
- }else{
- getInventory().interact("Use", "Supercompost");
- Composted = true;
- sleep(random(1300, 2500));
- }
- break;
- case PLANT:
- if(getInventory().isItemSelected()){
- RS2Object patch = getObjects().closest("Herb patch");
- if(patch != null)
- patch.interact("Use");
- }else{
- getInventory().interact("Use", "Guam seed");
- Tele ++;
- sleep(random(1300, 2000));
- }
- case HARVEST:
- RS2Object herbs = getObjects().closest("Herbs");
- if (herbs.hasAction("Pick") & !myPlayer().isAnimating()) {
- herbs.interact("Pick");
- sleep(3000);
- sleep(5000);
- }
- case RAKE:
- RS2Object patch1 = getObjects().closest("Herb patch");
- if (patch1.hasAction("Rake") & !myPlayer().isAnimating()) {
- patch1.interact("Rake");
- sleep(1000);
- }
- break;
- case FALLY:
- if (!farm.contains(myPosition()) && Tele == 1) {
- Composted = false;
- getWalking().webWalk(farm);
- }
- break;
- case CAMMY:
- if (!farm.contains(myPosition()) && Tele == 2) {
- Composted = false;
- getWalking().webWalk(cath);
- }
- break;
- case ARDY:
- if (!farm.contains(myPosition()) && Tele == 3) {
- Composted = false;
- getWalking().webWalk(ard);
- }
- break;
- }
- return random(200, 300);
- }
- @Override
- public void onExit() {
- log("Thanks for running my Tea Thiever!");
- }
- @Override
- public void onPaint(Graphics2D g) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement