KanyeWest69 Posted May 2, 2015 Share Posted May 2, 2015 First real script iv made for OSBot, pretty simple. Fill your inventory with super energy pots and stand in shotput circle. Run the script and it will autoplay the shotput minigame untill you run out of super energy pots. Good for quick amounts of tokens for getting defenders. import org.osbot.rs07.api.model.Entity;import org.osbot.rs07.api.ui.Skill;import org.osbot.rs07.script.Script;import org.osbot.rs07.script.ScriptManifest;import java.awt.*;@ScriptManifest(name = "ShotPutter", author = "Kanye", version = 1.0, info = "", logo = "")public class main extends Script { private State currentState = State.selectBalls; private int currentHealth = -1; @Override public void onStart() { // Code here will execute before the loop is started } @Override public void onExit() { // Code here will execute after the script ends } @SuppressWarnings("unused") private State getState() { if (currentState == State.drinkPotion) { } return State.drinkPotion; } private enum State { selectBalls, selectThrow, throwing, drinkPotion; } private State lastState; private int waitCount = 0; private int newHealth = -1; @Override public int onLoop() throws InterruptedException { if (lastState != currentState) { log(currentState.toString()); } lastState = currentState; if (currentState == State.selectBalls) { if (dialogues.inDialogue() == true) { currentState = State.selectThrow; } else { Entity ballPile = objects.closest(15665); if (waitCount == 0 || waitCount >= 30) { ballPile.interact("Throw"); waitCount = 0; } waitCount++; } } else if (currentState == State.selectThrow) { currentHealth = getSkills().getDynamic(Skill.HITPOINTS); log(currentHealth); sleep(random(600, 1200)); if (dialogues.inDialogue() == true) { dialogues.selectOption(1); currentState = State.throwing; } } else if (currentState == State.throwing) { if (newHealth == -1) { newHealth = getSkills().getDynamic(Skill.HITPOINTS); if (newHealth > currentHealth) { currentHealth--; log("Current health - 1!!!!!!"); } } newHealth = getSkills().getDynamic(Skill.HITPOINTS); log(newHealth); if (newHealth < currentHealth) { currentState = State.drinkPotion; } myPlayer().getHealth(); sleep(random(600, 1200)); if (dialogues.inDialogue() == true && currentState == State.throwing) { dialogues.clickContinue(); currentState = State.drinkPotion; } } else if (currentState == State.drinkPotion && !dialogues.inDialogue()) { newHealth = -1; sleep(random(100, 300)); if (inventory.contains(3022)) inventory.getItem(3022).interact("Drink"); else if (inventory.contains(3020)) inventory.getItem(3020).interact("Drink"); else if (inventory.contains(3018)) inventory.getItem(3018).interact("Drink"); else if (inventory.contains(3016)) inventory.getItem(3016).interact("Drink"); else stop(true); sleep(random(100, 300)); currentState = State.selectBalls; } return random(100, 300); // The amount of time in milliseconds before // the loop starts // over } @Override public void onPaint(Graphics2D g) { // This is where you will put your code for paint(s) }} Quote Link to comment Share on other sites More sharing options...
TheRealSwaps Posted May 2, 2015 Share Posted May 2, 2015 Nice do you have any pictures progress reports and such? Quote Link to comment Share on other sites More sharing options...
Fruity Posted May 2, 2015 Share Posted May 2, 2015 Oh i remember doing this years ago when i went for my first rune defender . Whats the Points p/hr rate on this? Quote Link to comment Share on other sites More sharing options...
KanyeWest69 Posted May 2, 2015 Author Share Posted May 2, 2015 (edited) I have no pictures maybe il update post with one later. It has no progress report overlay or anything. I literally made this in an hour or two. It works fucking all good though. I've also tried to make it not seem like a bot really. I'd think itd be pretty safe. If people are interested il make a graphic for it with points and hour, with banking etc. But only if people actually care cuz its effort. Edited May 2, 2015 by KanyeWest69 Quote Link to comment Share on other sites More sharing options...
Fruity Posted May 2, 2015 Share Posted May 2, 2015 Change the potion to what potion you are using and remove the 'sA.' because it is in your main class. Makes checking/Drinking potions cleaner public void drinkPotion() throws InterruptedException { if (invContainsPotion()) { if (sA.getInventory().interactWithNameThatContains( "Drink", "Overload")) { } } } public boolean invContainsPotion() { for (int i = 0; i <= 4; i++) { if (sA.getInventory().contains("Overload (" + i + ")")) { return true; } } return false; } Quote Link to comment Share on other sites More sharing options...
KanyeWest69 Posted May 2, 2015 Author Share Posted May 2, 2015 Change the potion to what potion you are using and remove the 'sA.' because it is in your main class. Makes checking/Drinking potions cleaner True dat. Also made script that jst drinks prayer pots and overloads for nmz. Theres quite a bunch of things I could do nicer tbh. Just made these for something to do and to see if people are interested. Quote Link to comment Share on other sites More sharing options...
Fruity Posted May 2, 2015 Share Posted May 2, 2015 True dat. Also made script that jst drinks prayer pots and overloads for nmz. Theres quite a bunch of things I could do nicer tbh. Just made these for something to do and to see if people are interested. aha fair enough Quote Link to comment Share on other sites More sharing options...
3 Hit U Posted May 15, 2015 Share Posted May 15, 2015 how do you use this script i've got a mac and have no idea but would love to use it? Quote Link to comment Share on other sites More sharing options...
darvinb98 Posted June 25, 2015 Share Posted June 25, 2015 there seems to be scripts for everywhere now lmaoooo xddddddd Quote Link to comment Share on other sites More sharing options...