Jump to content

Few questions


Recommended Posts

Posted (edited)
8 minutes ago, TheGreatests said:

Was wondering, how can I add a random number to to start buring bones. 

 

sA.inventory.contains(data.bone== 3 ) and also how to count items?

 

I've no idea what you're asking in your first question.

As for getting the amount of an item your inventory has:

inventory.getAmount("raw shrimps");

All this is well documented in the API docs: https://osbot.org/api/

Edited by harrypotter
Posted (edited)
18 minutes ago, harrypotter said:

I've no idea what you're asking in your first question.

As for getting the amount of an item your inventory has:


inventory.getAmount("raw shrimps");

All this is well documented in the API docs: https://osbot.org/api/

.... I am trying to pick a random number to bury from... your 

inventory.getAmount("raw shrimps") is exactly what I already have??

 

Edited by TheGreatests
Posted
1 minute ago, TheGreatests said:

.... I am trying to pick a random number to bury from... your 

inventory.getAmount("raw shrimps") is exactly what I already have??

 

Why would you pick a random number to bury from? 

No where in the snippet you showed us did you use the

getAmount() 

method? If you're already using this then why are you asking how to get the amount :???:

I don't understand what you're trying to do?

Posted

sA.inventory.getAmount(data.bone) <= 3 worked, tyvm man! now onto finding a random number to input there. 

1 minute ago, harrypotter said:

Why would you pick a random number to bury from? 

No where in the snippet you showed us did you use the


getAmount() 

method? If you're already using this then why are you asking how to get the amount :???:

I don't understand what you're trying to do?

Make it more human like, not everyone buries bones at 2, or a full inventory. 

Posted
2 minutes ago, TheGreatests said:

sA.inventory.getAmount(data.bone) <= 3 worked, tyvm man! now onto finding a random number to input there. 

Make it more human like, not everyone buries bones at 2, or a full inventory. 

No human buries bones in a random fashion, you could end up burying bone 2 then jumping to bone 24. This is probably more likely to get you banned than burying as normal will?

  • Like 1
Posted (edited)
33 minutes ago, Shudsy said:

the most humanlike thing would probably be

 

if (getInventory().isFull() && getInventory().contains("bones")) {

bones.interact("bury");

}

Wont this only bury 1 bone? the inventory will no longer be full after the first iteration.

if (getInventory().contains("bones")) {
	bones.interact("bury");
}

 

Edited by harrypotter
Posted

Random rnum = new Random();
  int num = rnum.nextInt(20 +1);
  return   sA.inventory.getAmount(data.bone) <= num&& data.Chickenbarn.contains(sA.players.myPlayer());
 }

 

Yes humans bury bones in random numbers, out better then pattern based scripts you guys are dishing out banning 95% of the damn community. If you cant play the game and evaluate how you play it, don't script it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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