Jump to content

Snowydell

Members
  • Posts

    109
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by Snowydell

  1. I need help with this now. Basically when the script starts a dialouge box comes up to ask where they are running the script. Then I have if statements so whichever choice they choose it goes into that if statement. How would I do something like, if(option ==0) { run this specific class only }
  2. What program(s) do you make your graphics in? They're sick
  3. Am I supposed to keep the .classpath and .project when I turn it into a Jar to share with people? If i'm sharing it locally do I keep the .classpath and .project on when I export it or do I disable it?
  4. Could have sworn I saw something the other day saying to only export the classpath or the project when you're going to share it with people. Which one is it?
  5. Thanks guys I will try that Isolate
  6. Here's the code NPC cow = npcs.closest("Cow", "Cow calf"); if(!inventory.isFull() && COW_AREA.contains(myPlayer()) && !myPlayer().isUnderAttack() && !cow.isUnderAttack() && cow != null) { cow.interact("Attack"); } Now basically what happens is it will target the closest cow even if it's in combat so it will just wait until the cow is dead to target a new cow. How would I make it do something like: npc.closest("Cow", "Cow calf").!isUnderAttack Sorry for all the questions, but this script i'm working on i'll put in the local script section so hopefully if it works
  7. Yeah Heres a pastbin: http://pastebin.com/F3rcag4Z Much easier to read sorry about that.
  8. import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.Area; import java.awt.*; @ScriptManifest(author = "Tyler", info = "Start in Lumbridg Cow Pen", name = "Cow Killer", version = 0, logo = "") public class CowKiller extends Script { //Declare Variables Area COW_AREA = new Area(3265, 3298, 3253, 3255); Area BANK_AREA = new Area(3207, 3222, 3210, 3216); Area STAIRS_AREA = new Area(3203, 3206, 3207, 3210); NPC cow = npcs.closest("Cow","Cow calf"); //WALK FROM COW PEN TO STAIRS private Position[] PATH_PEN_TO_STAIRS = { new Position(3255, 3267, 0), new Position(3250, 3260, 0), new Position(3252, 3253, 0), new Position(3256, 3247, 0), new Position(3259, 3241, 0), new Position(3259, 3233, 0), new Position(3255, 3227, 0), new Position(3249, 3226, 0), new Position(3243, 3225, 0), new Position(3235, 3220, 0), new Position(3225, 3218, 0), new Position(3218, 3218, 0), new Position(3215, 3213, 0), new Position(3206, 3209, 0) }; //WALK FROM STAIRS TO BANK private Position[] PATH_STAIRS_TO_BANK = { new Position(3206, 3215, 2), new Position(3208, 3220, 2), }; //WALK FROM BANK TO STAIRS private Position[] PATH_BANK_TO_STAIRS = { new Position(3205, 3216, 2), new Position(3205, 3209, 2), }; //WALK FROM STAIRS TO PEN private Position[] PATH_STAIRS_TO_PEN = { new Position(3206, 3209, 0), new Position(3215, 3213, 0), new Position(3218, 3218, 0), new Position(3225, 3218, 0), new Position(3235, 3220, 0), new Position(3243, 3225, 0), new Position(3249, 3226, 0), new Position(3255, 3227, 0), new Position(3259, 3233, 0), new Position(3259, 3241, 0), new Position(3256, 3247, 0), new Position(3252, 3253, 0), new Position(3250, 3260, 0), new Position(3255, 3267, 0), }; //OnStart public void onStart() { log("Welcome to my Cow Killer!"); log("Enjoy the script!"); } //Declare State private enum State { ATTACK, WALK_TO_STAIRS_FROM_PEN, GO_UPSTAIRS1, GO_UPSTAIRS2, WALK_TO_BANK, WALK_TO_STAIRS_FROM_BANK, GO_DOWNSTAIRS1, GO_DOWNSTAIRS2, WALK_TO_PEN, BANK, WAIT, } //Finds State private State getState() { //ATTACKS if(!inventory.isFull() && COW_AREA.contains(myPlayer()) && !myPlayer().isUnderAttack() && !cow.isUnderAttack() && cow != null) { return State.ATTACK; } //WALK FROM COW PEN TO STAIRS if(inventory.isFull() && COW_AREA.contains(myPlayer())) { return State.WALK_TO_STAIRS_FROM_PEN; } //GOES UP FIRST SET OF STAIRS if(myPosition().getZ() == 0 && STAIRS_AREA.contains(myPlayer()) && inventory.isFull()) { return State.GO_UPSTAIRS1; } //GOES UP SECOND SET OF STAIRS if(myPosition().getZ() == 1 && STAIRS_AREA.contains(myPlayer()) && inventory.isFull()) { return State.GO_UPSTAIRS2; } //WALKS FROM STAIRS TO BANK if(myPosition().getZ() == 2 && STAIRS_AREA.contains(myPlayer()) && inventory.isFull()) { return State.WALK_TO_BANK; } //BANKS ITEMS if(myPosition().getZ() == 2 && BANK_AREA.contains(myPlayer()) && inventory.isFull()) { return State.BANK; } //WALKS FROM BANK BACK TO STAIRS if(myPosition().getZ() == 2 && BANK_AREA.contains(myPlayer()) && inventory.isEmpty()) { return State.WALK_TO_STAIRS_FROM_BANK; } //GOES DOWN STAIRS TO REACH SECOND FLOOR if(myPosition().getZ() == 2 && STAIRS_AREA.contains(myPlayer()) && inventory.isEmpty()) { return State.GO_DOWNSTAIRS1; } //GOES DOWN STAIRS TO REACH FIRST FLOOR if(myPosition().getZ() == 1 && STAIRS_AREA.contains(myPlayer()) && inventory.isEmpty()) { return State.GO_DOWNSTAIRS2; } //WALKS FROM LUMBRIDGE CASTLE TO COW PEN if(myPosition().getZ() == 0 && STAIRS_AREA.contains(myPlayer()) && inventory.isEmpty()) { return State.WALK_TO_PEN; } return State.WAIT; } //Executes State public int onLoop() throws InterruptedException { switch (getState()) { //ATTACKING case ATTACK: cow = npcs.closest("Cow","Cow calf"); cow.interact("Attack"); break; //WALKS FROM COW PEN TO STAIRS case WALK_TO_STAIRS_FROM_PEN: localWalker.walkPath(PATH_PEN_TO_STAIRS); break; //GOES UP FIRST SET OF STAIRS case GO_UPSTAIRS1: objects.closest("Staircase").interact("Climb-up"); sleep(random(300, 500)); break; //GOES UP SECOND SET OF STAIRS case GO_UPSTAIRS2: objects.closest("Staircase").interact("Climb-up"); sleep(random(300, 500)); break; //WALKS FROM STAIRS TO BANK case WALK_TO_BANK: localWalker.walkPath(PATH_STAIRS_TO_BANK); sleep(random(300, 500)); break; //BANKS ITEMS case BANK: bank.open(); sleep(random(450, 500)); bank.depositAll(); sleep(random(300, 500)); bank.close(); break; //WALKS FROM BANK BACK TO STAIRS case WALK_TO_STAIRS_FROM_BANK: localWalker.walkPath(PATH_BANK_TO_STAIRS); sleep(random(300, 500)); break; //GOES DOWN STAIRS TO REACH SECOND FLOOR case GO_DOWNSTAIRS1: objects.closest("Staircase").interact("Climb-down"); sleep(random(300, 500)); break; //GOES DOWN STAIRS TO REACH FIRST FLOOR case GO_DOWNSTAIRS2: objects.closest("Staircase").interact("Climb-down"); sleep(random(300, 500)); break; //WALKS FROM LUMBRIDGE CASTLE TO COW PEN case WALK_TO_PEN: localWalker.walkPath(PATH_STAIRS_TO_PEN); sleep(random(300, 500)); break; //WAIT case WAIT: sleep(random(500, 700)); break; } return random(200, 300); } //On Exit public void onExit() { log("Thanks for running Oak Cutter!"); } public void onPaint(Graphics2D g) { } }
  9. When I try to run it nothing happens and the screen is still clickable too
  10. Thansk guys, ill try that Divinity and yeah it would be loaded Botre
  11. If a position is out of range on the minimap and screen will it still go to it?
  12. Never knew that was a command thanks for that
  13. So this is my script now fire.interact("Use"); sleep(500); if (getInterfaces().getChild(548, 127).isVisible()) { getInterfaces().getChild(307, 2).interact("Cook All"); } It's for the cooking interface on a fire but I just can't get it to work.
  14. Learn some Java first then go to the tutorial section and use one of the tutorials as a base. You could learn the basics of Java in less than a week. Also, it looks confusing because of the way I copy and pasted it so the format is messed up, hard to read
  15. Sorry to ask but how do I do that? Edit: might have figured it out let me see. Nervermind i'm lost, can someone help me please
  16. Basically at shrimps there is an npc that blocks a fishing spot. How would I make the bot if it clicked on the spot and realized it couldnot walk there go to a different spot or make it so it never clicks on that spot at all. I believe I would need to do an area maybe but idk. Also i'm making this bot for fun not to actually level with btw.
  17. Ah I see, thanks for the answers
  18. Yeah that was it, thank you for the answer , what is task based if it's not to hard to explain. Also does anyone know why my character drops fish slow then stands around for 10 seconds doing nothing until it starts to fish again?
  19. Ok so here's the part of the code I need help on. private State getState() { if(!myPlayer().isAnimating() && !inventory.isFull()) { return State.FISH; } if(inventory.isFull()) { return State.DROP; } return State.WAIT; } public int onLoop() throws InterruptedException { switch (getState()) { case FISH: NPC fishingspot = npcs.closest("Fishing Spot"); fishingspot.interact("Net"); break; case DROP: if(inventory.isFull()) { inventory.dropAllExcept("Small fishing net"); } break; My first question is if it benefits or does the same thing if I put the if statement in the case. As seen in the drop case or can I just leave it out and it will execute the same way since it already declared it needed to drop. Second question is for some reason my player drops the fish fairly slow then after it's all dropped stands around for 10 seconds then goes back to fishing, any fix for these? Thanks
×
×
  • Create New...