gilaga Posted July 30, 2014 Share Posted July 30, 2014 (edited) Start in Draynor, in bank Eats trout, lobster, and salmon. Pathing is horrible but will fix soon. -Fixed a banking problem. -Virus Scans: https://www.virustotal.com/en/file/5fecff4cb660abf4dab1f09a67392e956996836c142a519291986d2da604c1ce/analysis/1406772744/ http://virusscan.jotti.org/en/scanresult/b655cbdd477c44aa067a3534e16e6b321d7d305a http://www.mediafire.com/download/953o742324jj616/BasicPickpocket.jar import org.osbot.legacy.script.mouse.MinimapTileDestination; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.utility.Area; import org.osbot.rs07.input.mouse.MiniMapTileDestination; import java.awt.*; @ScriptManifest(author = "Gilaga", info = "First Script Iv'e ever made.", name = "Basic PickPocket", version = 0, logo = "") public class BasicPickpocket extends Script{ private static final Area BANK_AREA = new Area(3092,3240,3095,3246); private Position PICKPOCKET_POSITION = new Position(3081,3250,0); private Position BANK_POSITION = new Position(3092,3243,0); private Position RUN_POSITION = new Position(3095,3250,0); private enum State{ EAT, BANK, WALK_TO_BANK, WALK_TO_PICKPOCKET, PICKPOCKET, RUN }; private State getState(){ if(myPlayer().isUnderAttack() && myPlayer().getInteracting().getId() == 5515){ return State.RUN; } else if(skills.getDynamic(Skill.HITPOINTS) < 10){ if(inventory.contains("Salmon", "Lobster", "Trout")){ return State.EAT; } else if(BANK_AREA.contains(myPlayer())){ return State.BANK; } else{ return State.WALK_TO_BANK; } } else if(BANK_AREA.contains(myPlayer())){ return State.WALK_TO_PICKPOCKET; } return State.PICKPOCKET; } public int onLoop() throws InterruptedException{ switch(getState()){ case EAT: inventory.interact("Eat", "Salmon", "Lobster", "Trout"); break; case PICKPOCKET: getNpcs().closestThatContains("Master Farmer").interact("Pickpocket"); break; case BANK: RS2Object bankBooth = objects.closest("Bank booth"); if (bankBooth != null) { if (bankBooth.interact("Bank")) { while (!bank.isOpen()) sleep(250); if(bank.contains("Salmon")){ bank.depositAll(); bank.withdraw("Salmon", 10); bank.close(); } else if(bank.contains("Lobster")){ bank.depositAll(); bank.withdraw("Lobster", 10); bank.close(); } else if(bank.contains("Trout")){ bank.depositAll(); bank.withdraw("Trout", 15); bank.close(); } else{ stop(); } } } break; case WALK_TO_PICKPOCKET: walkTile(PICKPOCKET_POSITION); break; case WALK_TO_BANK: walkTile(PICKPOCKET_POSITION); walkTile(BANK_POSITION); break; case RUN: walkTile(PICKPOCKET_POSITION); walkTile(RUN_POSITION); break; } return random(200,300); } private boolean walkTile(Position p) throws InterruptedException { mouse.move(new MiniMapTileDestination(bot, p), false); sleep(random(150, 250)); mouse.click(false); int failsafe = 0; while (failsafe < 10 && myPlayer().getPosition().distance(p) > 2) { sleep(200); failsafe++; if (myPlayer().isMoving()) failsafe = 0; } if (failsafe == 10) return false; return true; } public void onPaint(Graphics2D g) { } } Edited July 31, 2014 by gilaga 1 Quote Link to comment Share on other sites More sharing options...
Anaesthetic Posted July 30, 2014 Share Posted July 30, 2014 Are you allowed to have mediafire download links like that? Quote Link to comment Share on other sites More sharing options...
gilaga Posted July 30, 2014 Author Share Posted July 30, 2014 Are you allowed to have mediafire download links like that? Honestly, I have no idea. Quote Link to comment Share on other sites More sharing options...
Anaesthetic Posted July 30, 2014 Share Posted July 30, 2014 Honestly, I have no idea. You should probably just post the source code so that we can look through and make sure that there is nothing malicious about the script itself... Quote Link to comment Share on other sites More sharing options...
Nitrousek Posted July 30, 2014 Share Posted July 30, 2014 You are allowed to have links, you should post a virus scan since you're new, and posting the code is indeed a good way to make people trust you a little more. Quote Link to comment Share on other sites More sharing options...
gilaga Posted July 31, 2014 Author Share Posted July 31, 2014 (edited) You are allowed to have links, you should post a virus scan since you're new, and posting the code is indeed a good way to make people trust you a little more. Thanks, where can I go for a good virus scan? Edited July 31, 2014 by gilaga Quote Link to comment Share on other sites More sharing options...
Nitrousek Posted July 31, 2014 Share Posted July 31, 2014 (edited) Thanks, where can I go for a good virus scan? Virustotal or jotti https://www.virustotal.com/ http://virusscan.jotti.org/en Edited July 31, 2014 by Nitrousek Quote Link to comment Share on other sites More sharing options...
gilaga Posted July 31, 2014 Author Share Posted July 31, 2014 Virustotal or jotti https://www.virustotal.com/ http://virusscan.jotti.org/en Done, thanks. Quote Link to comment Share on other sites More sharing options...
st1llgod Posted July 31, 2014 Share Posted July 31, 2014 Are you going to make a UI for this, so I can choose which food to use, and which seeds to steal? Would be awesome. Just started using this. Quote Link to comment Share on other sites More sharing options...
gilaga Posted July 31, 2014 Author Share Posted July 31, 2014 Are you going to make a UI for this, so I can choose which food to use, and which seeds to steal? Would be awesome. Just started using this. I am really new to making scripts and I really dont think I would be able to make a UI. I am willing to make more food options available though, Currently the bot prioritizes certain foods over others, it will take out salmon first, then lobster, and then trout. I haven't tested this feature yet but I believe it works, confirmed with salmon though. If you would like to make a suggestion on a food to add I would be open to it. Quote Link to comment Share on other sites More sharing options...
st1llgod Posted July 31, 2014 Share Posted July 31, 2014 I am really new to making scripts and I really dont think I would be able to make a UI. I am willing to make more food options available though, Currently the bot prioritizes certain foods over others, it will take out salmon first, then lobster, and then trout. I haven't tested this feature yet but I believe it works, confirmed with salmon though. If you would like to make a suggestion on a food to add I would be open to it. Oh no, I don't have a food suggestion, the only thing I'm really missing, is the drop option.. All these potato seeds are so unnecessary. but I'm very thankfull for the script, it's running smoothly for about an hour now. I'll see how it's running when I get home from work (In about 5 hours) - Tell you if it's still running. Quote Link to comment Share on other sites More sharing options...
gilaga Posted July 31, 2014 Author Share Posted July 31, 2014 Oh no, I don't have a food suggestion, the only thing I'm really missing, is the drop option.. All these potato seeds are so unnecessary. but I'm very thankfull for the script, it's running smoothly for about an hour now. I'll see how it's running when I get home from work (In about 5 hours) - Tell you if it's still running. Server restart. Quote Link to comment Share on other sites More sharing options...
st1llgod Posted July 31, 2014 Share Posted July 31, 2014 Server restart. I see, you are correct. Now I can't start OSBot though, "check your boot options" Anyone know the reason behind this? Quote Link to comment Share on other sites More sharing options...
gilaga Posted July 31, 2014 Author Share Posted July 31, 2014 I see, you are correct. Now I can't start OSBot though, "check your boot options" Anyone know the reason behind this? OSBot is currently down, think its happening for everyone. Oh no, I don't have a food suggestion, the only thing I'm really missing, is the drop option.. All these potato seeds are so unnecessary. but I'm very thankfull for the script, it's running smoothly for about an hour now. I'll see how it's running when I get home from work (In about 5 hours) - Tell you if it's still running. with the dropping option, its not necessary, I keep all my seeds, but if you dont want them, just take a visit to a general store one day, problem solved. Quote Link to comment Share on other sites More sharing options...
st1llgod Posted August 1, 2014 Share Posted August 1, 2014 OSBot is currently down, think its happening for everyone. with the dropping option, its not necessary, I keep all my seeds, but if you dont want them, just take a visit to a general store one day, problem solved. Alrighty, will do. Luckily, my bank is nowhere near filled up, so it shouldn't be a problem. Once again, thanks for the script. Quote Link to comment Share on other sites More sharing options...