Author Topic: Selling/Buying items  (Read 478 times)

0 Members and 1 Guest are viewing this topic.

Offline GaunTopic starter

  • Restricted
  • *
  • Posts: 1
  • Activity:
    0%
  • Reputation Power: 1
  • Gaun has no influence.
  • Referrals: 0
    • View Profile
Selling/Buying items
« on: March 19, 2025, 07:04:18 PM »
Hi all, was wondering if any of you managed to sell/buy items from a Orion OA script? If so you might see what I'm missing here:

I am able to get the vendorList object and see the vendorListItems in it and their properties.
I made a shopList to test buying an item by Graphic but I can't seem to obtain it.

Code: [Select]
var slist = Orion.GetShopList("hammer");
var hammer = new ShopListItem("0x13E3");
slist.SetItems([hammer]);

Orion.Print(Orion.GetShopList("hammer")!=null);

Orion.Say("buy");
Orion.WaitForShop();
var vlist = Orion.GetCurrentVendorList();
Orion.Print("isBuyList: "+vlist.IsBuyList());
Orion.Print(vlist.Items().length+" items in shop")
vlist.Items().forEach(function (item){
if (item.Count()>0){
Orion.Print(item.Count()+" "+item.Name());
}
})
Orion.BuyCurrent("hammer");

Thank you !

Tags: