amoeder Posted October 15, 2015 Posted October 15, 2015 I'm a real noob but i can't seem to find how to use an item on another item in the API. Do i just use the click method? Can i get some feedback on the little script i tried to write? Item chocolate = getInventory().getItem("Chocolate bar"); Item knife = getInventory().getItem("Knife"); if (inventory contains(chocolate)&& inventory.contains(knife){ click(chocolate); click(knife); } Else{ objects.closest("Bankbooth").interact("Bank"); depositAllExept(knife); withdrawAll(chocolate); }
Chris Posted October 15, 2015 Posted October 15, 2015 (edited) you would want to interact("Use"); Edited October 15, 2015 by TheObserver
amoeder Posted October 15, 2015 Author Posted October 15, 2015 you would want to interact("Use"); Does that makes it just left click or does it really right clicks and clicks use? because that would make it very obvious that u are botting because no normal player would do that?
IHB Posted October 15, 2015 Posted October 15, 2015 Does that makes it just left click or does it really right clicks and clicks use? because that would make it very obvious that u are botting because no normal player would do that? left click cause its the first option on the item 1
Apaec Posted October 15, 2015 Posted October 15, 2015 Does that makes it just left click or does it really right clicks and clicks use? because that would make it very obvious that u are botting because no normal player would do that? Not necessarily, I'm not sure how the .interact() method works exactly as I've not looked at the client code, but I believe it will most times just left click but sometimes right click. Give it a test! apa left click cause its the first option on the item Not always!
amoeder Posted October 15, 2015 Author Posted October 15, 2015 left click cause its the first option on the item but its not the first on chocolate bar is it? so can i do: Item(Chocolate).Interact("use") Item(Chocolate).Interact("use") 1
IHB Posted October 15, 2015 Posted October 15, 2015 (edited) but its not the first on chocolate bar is it? so can i do: Item(Chocolate).Interact("use") Item(Chocolate).Interact("use") if you've clicked use on the knife first then it is Edited October 15, 2015 by IHB 1
Tom Posted October 16, 2015 Posted October 16, 2015 but its not the first on chocolate bar is it? so can i do: Item(Chocolate).Interact("use") Item(Chocolate).Interact("use") Interact will right click if necessary.
FrostBug Posted October 16, 2015 Posted October 16, 2015 (edited) Try something along these lines (assumes that a knife is present) if(getInventory().contains("Chocolate bar")) { if("Knife".equals(getInventory().getSelectedItemName())) { int slot = getInventory().getSlot("Chocolate bar"); getMouse().click(new InventorySlotDestination(getBot(), slot)); } else { int slot = getInventory().getSlot("Knife"); getMouse().click(new InventorySlotDestination(getBot(), slot)); } } Edited October 16, 2015 by FrostBug 1
Joseph Posted October 16, 2015 Posted October 16, 2015 Try something along these lines (assumes that a knife is present) if(getInventory().contains("Chocolate bar")) { if("Knife".equals(getInventory().getSelectedItemName())) { int slot = getInventory().getSlot("Chocolate bar"); getMouse().click(new InventorySlotDestination(getBot(), slot)); } else { int slot = getInventory().getSlot("Knife"); getMouse().click(new InventorySlotDestination(getBot(), slot)); } } i like the flow