October 15, 201510 yr 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); }
October 15, 201510 yr Author 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?
October 15, 201510 yr 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
October 15, 201510 yr 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!
October 15, 201510 yr Author 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")
October 15, 201510 yr 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, 201510 yr by IHB
October 16, 201510 yr 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.
October 16, 201510 yr 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, 201510 yr by FrostBug
October 16, 201510 yr 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
Create an account or sign in to comment