Jump to content

A Beginners Guide to Writing OSBot Scripts (where to get started!) by Apaec


Apaec

Recommended Posts

  • 3 weeks later...

this is pretty weird when you're used to C#, i understand everything tho and thanks for the basic explanation :doge:


pls help, after i installed Eclipse i try to run the eclipse .exe file for application and i get a huge error msg

do you have java JDK installed? this is needed. http://www.oracle.com/technetwork/java/javase/downloads/index.html

  • Like 1
Link to comment
Share on other sites

Just asking how i can get any item what are in the bank?

 

Thx

public int onLoop() throws InterruptedException {
		switch (getState()) {
		case BANK:
			Entity stall = objects.closest("Bank Booth");
			if (stall != null) {
				stall.interact("Bank");
			}
			break;
		case GET:
			bank.getItem("Maple Logs");
			break;
		case WAIT:
			sleep(random(500, 700));
			break;
		default:
			break;
		}
		return random(200, 300);
Edited by kerklais
Link to comment
Share on other sites

Just asking how i can get any item what are in the bank?

Thx

public int onLoop() throws InterruptedException {		switch (getState()) {		case BANK:			Entity stall = objects.closest("Bank Booth");			if (stall != null) {				stall.interact("Bank");			}			break;		case GET:			bank.getItem("Maple Logs");			break;		case WAIT:			sleep(random(500, 700));			break;		default:			break;		}		return random(200, 300);
This will withdraw a specific number

getBank().withdraw("item", 5);

This will withdraw all

getBank().withdrawAll("item");

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

Trying to make a barbarian power fisher! The bot drops all of the fish but it doesn't try to fish them!

 

private enum State {

FISH, DROP, WAIT

};

 

private State getState() {

Entity fishspot = objects.closest("Fishing spot");

if (!inventory.isEmptyExcept("Feather","Barbarian rod"))

return State.DROP;

if (fishspot != null)

return State.FISH;

return State.WAIT;

}

 

@Override

public int onLoop() throws InterruptedException {

switch (getState()) {

case FISH:

Entity fishspot = objects.closest("Fishing spot");

if (fishspot != null) {

fishspot.interact("Use-rod");

}

break;

case DROP:

inventory.dropAll("Leaping trout","Leaping salmon","Leaping sturgeon");

break;

case WAIT:

sleep(random(500, 700));

break;

}

return random(200, 300);

}

Link to comment
Share on other sites

Trying to make a barbarian power fisher! The bot drops all of the fish but it doesn't try to fish them!

 

private enum State {

FISH, DROP, WAIT

};

 

private State getState() {

Entity fishspot = objects.closest("Fishing spot");

if (!inventory.isEmptyExcept("Feather","Barbarian rod"))

return State.DROP;

if (fishspot != null)

return State.FISH;

return State.WAIT;

}

 

@Override

public int onLoop() throws InterruptedException {

switch (getState()) {

case FISH:

Entity fishspot = objects.closest("Fishing spot");

if (fishspot != null) {

fishspot.interact("Use-rod");

}

break;

case DROP:

inventory.dropAll("Leaping trout","Leaping salmon","Leaping sturgeon");

break;

case WAIT:

sleep(random(500, 700));

break;

}

return random(200, 300);

}

Entity fishspot = objects.closest("Fishing spot");
if (fishspot != null) {
fishspot.interact("Use-rod");
}

fishing spots are NPC's

 

so

NPC fishspot = objects.closest("Fishing spot");
if (fishspot != null) {
fishspot.interact("Use-rod");
}
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...