Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.osbot.rs07.api.ui.RS2Widget;
- import org.osbot.rs07.script.Script;
- import org.osbot.rs07.script.ScriptManifest;
- import org.osbot.rs07.utility.ConditionalSleep;
- import java.util.ArrayList;
- import java.util.List;
- /**
- * Created by Saiyan on 03/12/2016.
- */
- @ScriptManifest(version = 0, info ="" , name = "Fletcher", logo = "", author ="Johan" )
- public class Titanic extends Script {
- @Override
- public void onStart() throws InterruptedException {
- }
- private void useInventoryItems(String item1, String item2) {
- if(getInventory().isItemSelected()) {
- getInventory().getItem(item1).interact("Use");
- new ConditionalSleep(2000) {
- @Override
- public boolean condition() {
- return getWidgets().getWidgetContainingText(306, "Short Bow") != null;
- }
- }.sleep();
- } else {
- getInventory().getItem(item2).interact("Use");
- new ConditionalSleep(2000) {
- @Override
- public boolean condition() {
- return getInventory().isItemSelected();
- }
- }.sleep();
- }
- }
- private void conditionalSleep(int time, boolean stopCondition) {
- new ConditionalSleep(time) {
- @Override
- public boolean condition() throws InterruptedException {
- return stopCondition;
- }
- }.sleep();
- }
- private void clickContinue() throws InterruptedException {
- RS2Widget widget = getWidgets().getWidgetContainingText("Click here to continue");
- if(widget != null && widget.isVisible()) {
- widget.interact();
- sleep(random(250, 750));
- }
- }
- @Override
- public int onLoop() throws InterruptedException {
- RS2Widget makex = getWidgets().getWidgetContainingText(306, "Short Bow");
- if(!getInventory().contains("Logs")) {
- if(getBank().isOpen()) {
- if(getInventory().isFull()) {
- getBank().depositAllExcept("Knife");
- } else {
- getBank().withdraw("Logs", 69);
- }
- } else {
- getBank().open();
- }
- } else {
- if(getDialogues().clickContinue()) {
- clickContinue();
- } else {
- if(getBank().isOpen()) {
- getBank().close();
- } else {
- if(!myPlayer().isAnimating()) {
- if (!getDialogues().inDialogue()) {
- if (makex == null) {
- useInventoryItems("Knife", "Logs");
- } else {
- makex.interact("Make X");
- //anyways yea i need to get ready lul cya xD
- //at least its wurking :P
- conditionalSleep(5000,getDialogues().inDialogue() && !makex.isVisible());
- }
- } else {
- getKeyboard().typeString("99");
- conditionalSleep(15_000,getInventory().onlyContains("Shortbow (u)", "Knife"));
- }
- }
- }
- }
- }
- return 350;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement