View Full Version : Shopsellallitems
softbzero
12-12-2015, 06:04 PM
Hey. Today i updating on stream lua and i cant make list for self.shopsellallitems if i use
List1 = xxx, xxx or {xxx, xxx1} or {(xxx), (xxx1)} or (xxx, xxx1) then it dont work or selling only first item xxx.
If i use : self.shopsellallitems(xxx, xxx1) it selling only first item too.
Can i have a help from you?
shadowart
12-12-2015, 06:18 PM
It's only supposed to take one argument, you'll have to use a loop.
ososzayat
12-12-2015, 06:20 PM
This's an example from a script i use.. working for me :D
elseif (labelName == "SellLoot") then
Walker.Stop()
Self.SayToNpc({"hi", "trade"}, 65)
wait(900, 1200)
for _, v in ipairs({"carapace shield", "grasshopper legs", "calopteryx cape", "compound eye", "crawler head plating", "dung ball", "hive scythe", "kollos shell", "spidris mandible", "spitter nose", "swarmer antenna"}) do
Self.ShopSellAllItems(v)
wait(800, 1200)
end
Walker.Start()
softbzero
12-12-2015, 07:00 PM
shadowart thanks for info.
Wait you use v for list and this work? :v
softbzero
12-12-2015, 07:06 PM
- add all elements of array `a'
function add (a)
local sum = 0
for i,v in ipairs(a) do
sum = sum + v
end
return sum
end
If i change it for xenobot it will work?
shadowart
12-12-2015, 07:25 PM
for _, item in ipairs({"item1", "item2", "item3"}) do
Shop.SellAllItems(item)
-- Do not add a wait here if you have a long list! SellAllItems has a built in wait that only triggers if your sale count was above 0.
end
softbzero
12-12-2015, 08:50 PM
Thanks shadowart. Close this.
softbzero
12-13-2015, 12:59 PM
shadowart
Its wasnt working it need small changes -> for _, item in ipairs({3030,
3028}) do
Self.ShopSellAllItems(item)
-- thanks to shadowart for support with this line ^ up
end
without "", and self.shopsellallitems :)
thanks as well
shadowart
12-13-2015, 01:35 PM
"" are needed if you use item names, which lead to more readable code. Using IDs does ofc work too, you can even mix names and IDs within the list if you want to.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.