Jump to content

Master Farmer Pickpocket


gilaga

Recommended Posts

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 by gilaga
  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...