Jump to content

igetbanned

Members
  • Posts

    18
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

651 profile views

igetbanned's Achievements

Newbie

Newbie (1/10)

2

Reputation

  1. Eric had mentioned that so I changed the script to be random sleep times If I did something wrong with the new sleep times please let me know: if(judge != null) { if (!getInventory().contains("Bronze Arrow") && !getEquipment().contains("Bronze Arrow")) { if(getDialogues().isPendingContinuation()) { getDialogues().clickContinue(); sleep(MethodProvider.gRandom(400, 850)); } else if(getDialogues().inDialogue()) { getDialogues().selectOption("Sure, I'll give it a go."); sleep(MethodProvider.gRandom(400, 850)); } else { judge.interact("Talk-to"); } } } while (getInventory().contains("Bronze Arrow")) { getEquipment().equip(EquipmentSlot.ARROWS, "Bronze Arrow"); } while (getEquipment().isWearingItem(EquipmentSlot.ARROWS, "Bronze Arrow")) { Targets.interact("Fire-at"); sleep(MethodProvider.gRandom(600, 1250)); getInterfaces().closeOpenInterface(); } Still getting the interface issue, just sits there when the results of the arrow pop up. Perhaps it's not recognized as an interface? Idk
  2. Like so? if (interfaces.getOpenInterface().isVisible() && interfaces.getOpenInterface() != null) interfaces.closeOpenInterface(); Tested and it returns an error I might just try the parent/child method but I'll have to look at the API because I know nothing about that lol
  3. Got it I've tried it on my own, and everything runs smooth now except for the part where it has to close the new interface that opens once an arrow is fired. Here's the new code: if(judge != null) { if (!getInventory().contains("Bronze Arrow") && !getEquipment().contains("Bronze Arrow")) { if(getDialogues().isPendingContinuation()) { getDialogues().clickContinue(); sleep(MethodProvider.gRandom(400, 850)); } else if(getDialogues().inDialogue()) { getDialogues().selectOption("Sure, I'll give it a go."); sleep(MethodProvider.gRandom(400, 850)); } else { judge.interact("Talk-to"); } } } while (getInventory().contains("Bronze Arrow")) { getEquipment().equip(EquipmentSlot.ARROWS, "Bronze Arrow"); } while (getEquipment().isWearingItem(EquipmentSlot.ARROWS, "Bronze Arrow")) { Targets.interact("Fire-at"); sleep(MethodProvider.gRandom(600, 1250)); getInterfaces().closeOpenInterface(); } I tried using interfaces, Interfaces, getInterfaces().getOpenInterfaces().close() Anything I could think of. Do I have to create a static variable for the open interface, and add .close() to it or something?
  4. Worked, thanks Changed to this now, hope I did the sleeping right: NPC judge = npcs.closestThatContains("Competition Judge"); if(judge != null) { if (!getInventory().contains("Bronze Arrow") && !getEquipment().contains("Bronze Arrow")) { if(getDialogues().isPendingContinuation()) { getDialogues().clickContinue(); sleep(MethodProvider.gRandom(400, 850)); } else if(getDialogues().inDialogue()) { getDialogues().selectOption("Sure, I'll give it a go."); sleep(MethodProvider.gRandom(400, 850)); } else { judge.interact("Talk-to"); } } } Might I ask why I always see if ( != null ) in scripts? What is it significant about that condition? Can't it just not be used with the same outcome?
  5. Trying to make a Range Guild script, but the dialogue seems to be messing up on me. Here's what I have: NPC judge = npcs.closestThatContains("Competition Judge"); if (!getInventory().contains("Bronze Arrow") && !getEquipment().contains("Bronze Arrow")) judge.interact("Talk-to"); getDialogues().clickContinue(); sleep(1500); getDialogues().selectOption("Sure, I'll give it a go."); sleep(1500); getDialogues().clickContinue(); sleep(1000); It just loops back to "Talk-to" and clicks continue once, then restarts again and talks to the judge. A never ending cycle. I tried removing the if statement and even adding another but it didn't work. Can't test the latter part of my script because I can't even get passed the dialogue portion, lol. Help?
  6. Works now! Thank you both so much
  7. I finished (or so I think) the functionality part of my script, but upon running it in OSBot, the bot just stands there. I've tried everything to my level of understanding, yet nothing works. Restarting the bot/script won't fix it. Here's all the code: package org.igetbanned.barbfisher; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; /** * Created by ${igetbanned} on 8/30/2014. */ @ScriptManifest( author = "igetbanned", info = "Powerfishes barbarian style", name = "BarbarianFisher", version = 0.1, logo = "Cool" ) public class BarbarianFIsher extends Script { private static final int[] FISHING_ID = {14882}; public void onStart(){ log("Barbarian Fisher Started!"); } private enum State { FISHING, DROPPING } private State getState() { if (inventory.isFull()) return State.DROPPING; return State.FISHING; } public int onLoop() throws InterruptedException { switch (getState()) { case FISHING: if (!myPlayer().isAnimating()) { RS2Object Fishing_spot = objects.closest(FISHING_ID); if (!inventory.isFull()){ Fishing_spot.interact("Use-rod"); } } break; case DROPPING: inventory.dropAllExcept(11323, 314); break; } return random(200, 300); } public void onPaint(Graphics g) { } //code to be executed on exit public void onExit(){ log("Script stopped!"); } }
  8. I'm trying to make a script that powerfishes leaping trout/salmon/sturgeon at otto's grotto. I'm new to Java, however, and there doesn't seem to be many, if any at all, tutorials for OSBot 2 scripting. Anyways, here's what I need help with: - Upon starting the script the bot just stands there (URGENT!!!) - Interacting with an Object (fishing spot) won't work for some reason - Dropping (not sure what the code is for that, but if I can find it on the API please link ) - Antiban (Mousing over skills/changing tabs) I use JDK 7 with IntelliJ IDEA I'm not asking you guys to hold my hand on making this, but I am very new to Java (and even coding), and there doesn't seem to be much help for those who are "new" to the scene. Figured this would be a fun way to learn Java and play RS tho. Thanks! What I have so far: package org.igetbanned.barbfisher; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; /** * Created by ${igetbanned} on 8/30/2014. */ @ScriptManifest( author = "igetbanned", info = "Powerfishes barbarian style", name = "BarbarianFisher", version = 0.1, logo = "Cool" ) public class BarbarianFIsher extends Script { public void onStart(){ log("Barbarian Fisher Started!"); } private enum State { FISHING, DROPPING, IDLE } private State getState() { if (inventory.isFull()) return State.DROPPING; if (inventory.isEmptyExcept("Barbarian Rod", "Feather")) return State.FISHING; return State.IDLE; } public int onLoop() throws InterruptedException { switch (getState()) { case FISHING: Entity fishingspot = objects.closest("Fishing Spot"); fishingspot.interact("Use-rod"); break; case DROPPING: inventory.drop(11328, 11330); break; case IDLE: sleep(random(500, 700)); break; } return random(200, 300); } public void onPaint(Graphics g) { } //code to be executed on exit public void onExit(){ log("Script stopped!"); } }
×
×
  • Create New...