1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resolved Shop API(s) broken

Discussion in 'Client & Site Support' started by Thunderkill, Feb 6, 2015.

  1. Thunderkill

    Joined:
    Jan 31, 2015
    Messages:
    116
    Likes Received:
    24
    straight TL;DR'd version:

    Shop api seems to be broken. Shop.Buy(int id, int quantity); doesn't work. Also cannot retrieve any item from a shop with Shop. api.

    Code (Text):
    1. System.out.println(Shop.getItems().asList().toString());
    prints out only [ ] when shop is open (Interface ID 1265)

    [​IMG]

    @Cloud

     
  2. Best Answer:
    Post #5 by Cloud, Feb 7, 2015
  3. ciresiuol

    Joined:
    Dec 24, 2014
    Messages:
    81
    Likes Received:
    6
    I think it's just that shop... I know you're writing that for me, but I've been messing around trying to get one working, too... I was just modding another private script bot I had written by Ozzy.. This is from his script bot (not the same shop)
    Code (Text):
    1. package scripts.HarpoonBuyer.Tasks;
    2.  
    3. import com.runemate.game.api.hybrid.entities.Npc;
    4. import com.runemate.game.api.hybrid.local.Camera;
    5. import com.runemate.game.api.hybrid.local.hud.Menu;
    6. import com.runemate.game.api.hybrid.local.hud.interfaces.InterfaceComponent;
    7. import com.runemate.game.api.hybrid.local.hud.interfaces.Interfaces;
    8. import com.runemate.game.api.hybrid.local.hud.interfaces.Inventory;
    9. import com.runemate.game.api.hybrid.location.Area;
    10. import com.runemate.game.api.hybrid.location.Coordinate;
    11. import com.runemate.game.api.hybrid.queries.InterfaceComponentQueryBuilder;
    12. import com.runemate.game.api.hybrid.queries.NpcQueryBuilder;
    13. import com.runemate.game.api.hybrid.queries.results.InterfaceComponentQueryResults;
    14. import com.runemate.game.api.hybrid.queries.results.LocatableEntityQueryResults;
    15. import com.runemate.game.api.hybrid.region.Npcs;
    16. import com.runemate.game.api.hybrid.region.Players;
    17. import com.runemate.game.api.script.Execution;
    18. import com.runemate.game.api.script.framework.task.Task;
    19.  
    20. public class Purchase extends Task {
    21.  
    22.     public static Area shopArea = new Area.Polygonal(new Coordinate(3010, 3230, 0), new Coordinate(3018, 3230, 0), new Coordinate(3018, 3223, 0), new Coordinate(3010, 3220, 0));
    23.     private NpcQueryBuilder shopKeeperQuery = Npcs.newQuery().within(shopArea).names("Gerrant");
    24.     private InterfaceComponentQueryBuilder shopInterfaceQuery = Interfaces.newQuery().texts("Gerrant's Fishy Business");
    25.  
    26.     public boolean validate() {
    27.         return !Inventory.isFull() && shopArea.contains(Players.getLocal()) ;
    28.     }
    29.  
    30.     @Override
    31.     public void execute() {
    32.  
    33.         System.out.println("Purchasing ACTIVE");
    34.  
    35.         InterfaceComponentQueryResults validShopInterfaces = shopInterfaceQuery.results();
    36.         if (!validShopInterfaces.isEmpty()) {
    37.             InterfaceComponentQueryResults validHarpoonInterfaces = Interfaces.newQuery().names("Harpoon").results();
    38.             if (!validHarpoonInterfaces.isEmpty()) {
    39.                 InterfaceComponent harpoonInterface = (InterfaceComponent)validHarpoonInterfaces.first();
    40.                 if (harpoonInterface != null) {
    41.                     int inventoryCount = Inventory.getQuantity();
    42.                     if (harpoonInterface.interact("Buy All")) {
    43.                         Execution.delayUntil(() -> Inventory.getQuantity() > inventoryCount, 1200, 1600);
    44.                         if (Menu.isOpen()) {
    45.                             Menu.close();
    46.                         }
    47.                     }
    48.                 }
    49.             }
    50.  
    51.         } else {
    52.             LocatableEntityQueryResults<Npc> validShopKeepers = shopKeeperQuery.results();
    53.             if (!validShopKeepers.isEmpty()) {
    54.                 Npc shopKeeper = validShopKeepers.first();
    55.                 if (shopKeeper != null && shopKeeper.isValid()) {
    56.                     if (shopKeeper.isVisible()) {
    57.                         if (shopKeeper.interact("Trade")) {
    58.                             Execution.delayUntil(() -> !shopInterfaceQuery.results().isEmpty(), 1200, 1600);
    59.                         }
    60.                     } else {
    61.                         Camera.turnTo(shopKeeper);
    62.                     }
    63.                 }
    64.             }
    65.         }
    66.  
    67.     }
    68.  
    69.  
    70. }
    71.  
     
  4. Thunderkill

    Joined:
    Jan 31, 2015
    Messages:
    116
    Likes Received:
    24
    Well, i'm going to investigate a bit more.

    Edit:

    Nope, all shops broken to me
     
    #3 Thunderkill, Feb 6, 2015
    Last edited: Feb 7, 2015
  5. ciresiuol

    Joined:
    Dec 24, 2014
    Messages:
    81
    Likes Received:
    6
    That works for the shop it's made for, but I tried to edit the whole script bot to do what you're trying and it doesn't work...

    I hope you get it figured out... I still want it... Even if I get it working, it'd be nice to have 2 different scripts bots to do the same thing in different ways... Bot 2 accounts at the same time and no shared patterns...
    If u can't get it working and ever want to give up, though, it's cool...lol
     
    #4 ciresiuol, Feb 6, 2015
    Last edited: Feb 6, 2015
  6. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    Fixed in the next release
     
    Thunderkill and ciresiuol like this.

Share This Page

Loading...