TheGreatests Posted May 12, 2017 Posted May 12, 2017 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?
harrypotter Posted May 12, 2017 Posted May 12, 2017 (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 May 12, 2017 by harrypotter
TheGreatests Posted May 12, 2017 Author Posted May 12, 2017 (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 May 12, 2017 by TheGreatests
Charlotte Posted May 12, 2017 Posted May 12, 2017 (edited) int x = random(1,10) if (inventory.getAmount("item") == x) { bury } Edited May 12, 2017 by Charlotte 2
TheGreatests Posted May 12, 2017 Author Posted May 12, 2017 sA.inventory.contains(data.bone== 3 ) doesn't count the items? nether does yours...?
harrypotter Posted May 12, 2017 Posted May 12, 2017 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?
TheGreatests Posted May 12, 2017 Author Posted May 12, 2017 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.
harrypotter Posted May 12, 2017 Posted May 12, 2017 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? 1
Container Posted May 12, 2017 Posted May 12, 2017 I'd probably make it bury every 1, 2 or 3 bones with the amount of buries for each number of bones be most for 1 and least for 3 sets of bones.
Shudsy Posted May 12, 2017 Posted May 12, 2017 (edited) the most humanlike thing would probably be if (getInventory().isFull() && getInventory().contains("bones")) { bones.interact("bury"); } Edited May 12, 2017 by Shudsy
harrypotter Posted May 12, 2017 Posted May 12, 2017 (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 May 12, 2017 by harrypotter
Shudsy Posted May 13, 2017 Posted May 13, 2017 7 minutes ago, harrypotter said: Wont this only bury 1 bone? the inventory will no longer be full after the first iteration. if (getInventory().contains("bones")) { bones.interact("bury"); } oh shit 2 am brainderp 1
TheGreatests Posted May 13, 2017 Author Posted May 13, 2017 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.
TheGreatests Posted May 13, 2017 Author Posted May 13, 2017 Damn I felt alittle mean here. Sorry guys, I seriously think you guys need to implement better features into your scripts though. There is virtually no reason to argue with me on my random generation of of burying, I evaluated how I would play the game. Majority of the people are continuously look at the inventory.