Jump to content

guseggers

Members
  • Posts

    3
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male
  • Location:
    United States

Recent Profile Visitors

666 profile views

guseggers's Achievements

Newbie

Newbie (1/10)

0

Reputation

  1. Hello! When walking in a path, I have this... private Position[] B2T = { new Position(3262, 3419, 0), new Position(3257, 3407, 0), new Position(3252, 3401, 0) }; when I run the script, it clicks near the first position on the map, goes to it, then walks a block back to stand on the exact block. Is there any way to have it to a block near that coordinate?
  2. package natRune; import java.awt.Graphics2D; import java.util.concurrent.TimeUnit; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "", info = "Ardougne", name = "Ardougne Stealer", version = 0.01, logo = "") public class natRune extends Script { private long timeBegan; private long timeRan; @Override public void onStart() { log("Welcome to 's script!"); log("If you find any bugs or have any suggestions, please contact me!"); timeBegan = System.currentTimeMillis(); } @Override public void onExit() { log("Thanks for using 's script!"); } private enum State { WAIT, SEARCH }; private State getState() { Entity chest = objects.closest("Chest"); if (chest != null) return State.SEARCH; return State.WAIT; } public void onPaint(Graphics2D g) { Graphics2D gr = g; timeRan = System.currentTimeMillis() - this.timeBegan; g.drawString(ft(timeRan), 10, 320); } private String ft(long duration) { String res = ""; long days = TimeUnit.MILLISECONDS.toDays(duration); long hours = TimeUnit.MILLISECONDS.toHours(duration) - TimeUnit.DAYS.toHours(TimeUnit.MILLISECONDS.toDays(duration)); long minutes = TimeUnit.MILLISECONDS.toMinutes(duration) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(duration)); long seconds = TimeUnit.MILLISECONDS.toSeconds(duration) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(duration)); if (days == 0) { res = (hours + ":" + minutes + ":" + seconds); } else { res = (days + ":" + hours + ":" + minutes + ":" + seconds); } return res; } @Override public int onLoop() throws InterruptedException { switch (getState()) { case SEARCH: Entity chest = objects.closest("Chest"); if (chest != null) { chest.interact("Search for traps"); } case WAIT: sleep(random(15713, 17913)); break; } return random(201, 319); } } Hi! This is one of my first scripts, so I thought I'd keep it simple. It is by the chests where you steal 1 nat and 3gp in Ardougne. There are two chests up there, but my script just has it to interact with the nearest chest. Is there any way to loot one even if your closer to another? - Another idea. Could I have it so it interacts with one chest, follows a walkPath command to the other chest, loots it, and bank? Any help is appreciated!
  3. Hi This is my first script, and I believe I have it compiled right and everything... But whenever I run it from OSBot it makes OSBot stop responding and closes it... Is it my crappy script or what? I don't want it to bank or anything, just sit in the goblin hut and kill them... Help please? Thanks so much. import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(author = "Jards", info = "A Script", name = "Goblin Killer", version = 0.01, logo = "") public class main extends Script { @Override public void onStart() { log("Welcome to gusegger's bot!"); } // all the states we can be in private enum State { IDLE, ATTACKING_GOBLIN, IN_COMBAT, AT_FIELD }; // if player is by the goblin field public boolean atField() { Player player = myPlayer(); int x = player.getPosition().getX(); int y = player.getPosition().getY(); //stating if we're in these positions if ((x > 3242) && (x < 3249) && (y > 3243) && (y < 3249)) { log("x : " + x + " y " + y); log("You're at the goblins son!"); return true; } log("x : " + x + " y : " + y); return false; } // seeing if we're in combat public boolean inCombat() { if(myPlayer().isUnderAttack()) { log("We're in combat!"); return true; } log("We're not in combat yet, punk!"); return false; } public void killingGoblin() { NPC Goblin = npcs.closest("Goblin"); if (Goblin != null && Goblin.getHealth() != 0 && Goblin.isAttackable() && Goblin.getName().contains("Goblin")) { if (map.canReach(Goblin)) { log("Attacking that punk ass goblin!"); Goblin.interact("Attack"); } } else { log("No goblins found!"); } } private State getstate() { // if we are at the field of goblins but not in combat // if we are at the field and in combat, set to in_combat if (atField() && !inCombat()) return State.ATTACKING_GOBLIN; // if we are under attack, set to in_combat if (myPlayer().isUnderAttack()) return State.IN_COMBAT; //if nothing is happening, set to idle return State.IDLE; } @Override public int onLoop() throws InterruptedException { switch (getstate()) { case IN_COMBAT: break; case ATTACKING_GOBLIN: log("Start killing a goblin!"); killingGoblin(); break; } return random(100,300); } @Override public void onExit() { log("Thanks for using gusegger's bot!"); } @Override public void onPaint(Graphics2D g) { //NYI } }
×
×
  • Create New...