View Full Version : Script to buy SDs from shop?
DarkRoses
06-13-2013, 09:13 PM
What is the LUA script to both check how many sds you have and buy upto x amount of SDs from the shop?
Spectrus
06-13-2013, 09:15 PM
Self.ItemCount('sudden death rune')
Self.ShopBuyItemsUpTo('sudden death rune', ITEM_COUNT)
DarkRoses
06-13-2013, 09:29 PM
Self.ItemCount('sudden death rune')
Self.ShopBuyItemsUpTo('sudden death rune', ITEM_COUNT)
So it would for example be like this:
elseif (labelName == "BuyRunes") then
Walker.Stop()
Self.SayToNpc({"hi", "trade"}, 100)
while Self.Itemcount('sudden death rune')
Self.ShopBuyItemsUpTo('sudden death rune', 1100)
end
Walker.Start()
Or am I wrong? Im new to coding lua so dont facepalm on me;p
Spectrus
06-13-2013, 09:36 PM
Self.ItemCount('sudden death rune') is going to return the number of them it can see in your open containers.
If you just want to buy up to 1100, then all you need is Self.ShopBuyItemsUpTo('sudden death rune', 1100). It will already take in to consideration how many you have.
DarkRoses
06-13-2013, 09:46 PM
Self.ItemCount('sudden death rune') is going to return the number of them it can see in your open containers.
If you just want to buy up to 1100, then all you need is Self.ShopBuyItemsUpTo('sudden death rune', 1100). It will already take in to consideration how many you have.
Thanks for the reply. However, it buys the runes and everything but it does not turn walker back on. Why does it do this?
Spectrus
06-13-2013, 09:47 PM
Self.ShopBuyItemsUpTo('sudden death rune', 1100)
Walker.Start()
That's all you need.
DarkRoses
06-13-2013, 09:54 PM
Self.ShopBuyItemsUpTo('sudden death rune', 1100)
Walker.Start()
That's all you need.
Still doesn't work. My script looks like this:
elseif (labelName == "BuyRunes") then
Walker.Stop()
Self.SayToNpc({"hi", "trade"}, 100)
while Self.ShopBuyItemsUpTo('sudden death rune', 1100) do
end
Walker.Start()
Nakuu
06-13-2013, 09:56 PM
elseif (labelName == "BuyRunes") then
Walker.Stop()
Self.SayToNpc({"hi", "trade"}, 100)
Self.ShopBuyItemsUpTo('sudden death rune', 1100)
Walker.Start()
Spectrus
06-13-2013, 10:03 PM
Also, you should probably have slight delays between each function, just to ensure there's no problems related to connection. A simple wait(300, 500) or so would work.
DarkRoses
06-13-2013, 10:07 PM
elseif (labelName == "BuyRunes") then
Walker.Stop()
Self.SayToNpc({"hi", "trade"}, 100)
Self.ShopBuyItemsUpTo('sudden death rune', 1100)
Walker.Start()
Also, you should probably have slight delays between each function, just to ensure there's no problems related to connection. A simple wait(300, 500) or so would work.
Thanks for the help guys! Really appreciate it!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.