LoudPacks Posted August 31, 2015 Share Posted August 31, 2015 (edited) Release: Directions: 1. Get swordfish. The script eats swordfish if you fall below 70% 2. Enter the house in lumbridge containing the man and woman. 3. Start the script 4. Go to bed 5. Wake up with level 30-40 thieving. Purpose: 1. Get those early thieving levels out of the way easily (Desert Treasure, ability to thieve better shit, etc.) Features: - Pickpockets both man and woman - World hops if no man / woman in the house - Stays in the house even if doors are open - Eats swordfish if below 70% hp - Human like delays Source: package thieving; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.model.Item; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.api.map.*; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(author = "Chris1665", info = "Lumbridge Pickpocket. Really can be used where 'man' and/or 'woman' are present.", name = "Lumbridge Pickpocket", version = 1.0, logo = "http://i.imgur.com/q0yNJbV.png") public class main extends Script { private int health; private boolean male; private String timeRan; private int xpGained; private long start; private int profit; private int startGP; private int startXP; private long gpHour; private long xpHour; @Override public void onStart() { log("Start in west Lumbridge in the room with the man/women. Have swordfishs in your inventory."); if(!players.getInventory().contains("swordfish")) { log("You have no swordfish. You will not be healed."); } else { log("You have swordfish. You will be healed if your health drops below 70%."); } male = true; health = players.myPlayer().getHealth(); settings.mouse.setSpeed(160); start = System.currentTimeMillis(); startGP = players.getInventory().getItem("coins").getAmount(); startXP = players.getSkills().getExperience(Skill.THIEVING); combat.toggleAutoRetaliate(true); } public enum State{ STEAL, EAT } public State getState() { if(players.myPlayer().getHealth() < (health / 1.4)) { return State.EAT; } else { return State.STEAL; } } @Override public int onLoop() throws InterruptedException { switch(getState()){ case STEAL: NPC man = npcs.closest("Man"); NPC woman = npcs.closest("Woman"); Position manPos = man.getPosition(); Position womanPos = woman.getPosition(); if(!players.myPlayer().isAnimating() && !players.myPlayer().isMoving()) { if(man != null && male && map.canReach(manPos)){ man.interact("Pickpocket"); sleep(random(1800, 2400)); } if(woman != null && !male && map.canReach(womanPos)) { woman.interact("Pickpocket"); sleep(random(1800, 2400)); } if(!map.canReach(manPos) && !map.canReach(womanPos)) { worlds.hopToP2PWorld(); } male = !male; } break; case EAT: if(players.myPlayer().getHealth() < (health / 1.4)) { Item swordfish = players.getInventory().getItem("swordfish"); if(swordfish != null) { swordfish.interact("eat"); sleep(random(1400, 1800)); } } break; } return random(100, 250); } @Override public void onExit() { } @Override public void onPaint(Graphics2D g) { g.setColor(Color.black); timeRan = thieving.time.format(System.currentTimeMillis() - start); g.drawString("Time Ran: " + timeRan, 320, 370); g.drawString("XP Gained: " + xpGained, 320, 390); g.drawString("XP/HR: " + xpHour, 320, 410); g.drawString("Profit: " + profit, 320, 430); g.drawString("GP/HR: " + gpHour, 320, 450); xpGained = players.getSkills().getExperience(Skill.THIEVING) - startXP; xpHour = (int)(xpGained / ((System.currentTimeMillis() - start) / 3600000.0D)); profit = ((players.getInventory().getItem("coins").getAmount())) - (startGP); gpHour = (int)(profit / ((System.currentTimeMillis() - start) / 3600000.0D)); } } Download: http://www.mediafire.com/download/3twua486xxrqa3v/Lumbridge_Pickpocket.jar Edited August 31, 2015 by Chris1665 Quote Link to comment Share on other sites More sharing options...
Apaec Posted August 31, 2015 Share Posted August 31, 2015 Instead of using static sleeps when pickpocketing, you can use player height which will reasonably accurately determine when you're stunned or not! but other than that, awesome script mate, gj apa 1 Quote Link to comment Share on other sites More sharing options...
Bobrocket Posted August 31, 2015 Share Posted August 31, 2015 I feel like my identity has been stolen :'( Good job though! As Apaec said, look into player height (remember that player height also fluctuates normally so add 3 to the player height at all times to negate that) 1 Quote Link to comment Share on other sites More sharing options...
LoudPacks Posted August 31, 2015 Author Share Posted August 31, 2015 (edited) Instead of using static sleeps when pickpocketing, you can use player height which will reasonably accurately determine when you're stunned or not! but other than that, awesome script mate, gj apa I tried using that with out success, but I check for stuns using isAnimating(). The sleep is to add a bit of human like delay, or at least that was my thought process. Thanks for the feedback. I feel like my identity has been stolen :'( Good job though! As Apaec said, look into player height (remember that player height also fluctuates normally so add 3 to the player height at all times to negate that) that +3 is probably why I couldn't get it to work that way :P Edited August 31, 2015 by Chris1665 1 Quote Link to comment Share on other sites More sharing options...