combat_acc Posted November 13, 2016 Posted November 13, 2016 how would this be done? if bank contains x items trade the items to other player
IHB Posted November 13, 2016 Posted November 13, 2016 (edited) if (api.getBank().getAmount(item) > amount) { close bank api.getPlayers().closest(their name).interact("Trade with"); sleep conditional till api.getTrade().isFirstInterfaceOpen(); api.getTrade().offer(itemid, amount); sleep conditional till api.getTrade().getOurOffers().contains(item); api.getTrade().acceptTrade(); sleep condition till api.getTrade().isSecondInterfaceOpen(); api.getTrade().acceptTrade(); sleep conditional till !api.getTrade().isCurrentlyTrading(); } ignore the api method provider Edited November 13, 2016 by IHB 1
Explv Posted November 13, 2016 Posted November 13, 2016 (edited) how would this be done? if bank contains x items trade the items to other player Bot with items to trade: if inventory contains x items if bank is open close bank else if not in trade use trade interaction on target player sleep until in trade else if in trade with wrong player close trade else if on first trade screen if not offered x items offer x items else if not accepted accept trade else if on second screen if not accepted trade accept trade else if not bank is open open bank else if bank contains x items withdraw x items else stop Bot receiving items: bool trade On received message: if message is of type trade and message is from target player set trade to true On loop: if trade is true if not in trade do trade interaction with target player sleep until in trade else if not trading target player close trade else if on first window if other player accepted accept trade else if on second window if other player accepted accept trade set trade to false Edited November 13, 2016 by Explv 12
Juggles Posted November 13, 2016 Posted November 13, 2016 if (api.getBank().getAmount(item) > amount) { close bank api.getPlayers().closest(their name).interact("Trade with"); sleep conditional till api.getTrade().isFirstInterfaceOpen(); api.getTrade().offer(itemid, amount); sleep conditional till api.getTrade().getOurOffers().contains(item); api.getTrade().acceptTrade(); sleep condition till api.getTrade().isSecondInterfaceOpen(); api.getTrade().acceptTrade(); sleep conditional till !api.getTrade().isCurrentlyTrading(); } ignore the api method provider This will fail if it has to reloop because the bank isn't open and it can't check to see the amount of item in the bank.
IHB Posted November 13, 2016 Posted November 13, 2016 This will fail if it has to reloop because the bank isn't open and it can't check to see the amount of item in the bank. tru, i just use it cos im lazy
PlagueDoctor Posted November 14, 2016 Posted November 14, 2016 Bot with items to trade: if inventory contains x items if bank is open close bank else if not in trade use trade interaction on target player sleep until in trade else if in trade with wrong player close trade else if on first trade screen if not offered x items offer x items else if not accepted accept trade else if on second screen if not accepted trade accept trade else if not bank is open open bank else if bank contains x items withdraw x items else stop Bot receiving items: bool trade On received message: if message is of type trade and message is from target player set trade to true On loop: if trade is true if not in trade do trade interaction with target player sleep until in trade else if not trading target player close trade else if on first window if other player accepted accept trade else if on second window if other player accepted accept trade set trade to false I cannot stress enough how fucking AMAZING it was to have this written out while i was writing my muling code.. made it so much easier. 1
Explv Posted November 14, 2016 Posted November 14, 2016 I cannot stress enough how fucking AMAZING it was to have this written out while i was writing my muling code.. made it so much easier. I'm glad you found it useful 1