Robin2161
01-09-2013, 05:19 PM
Hello,
I'm currently using a script that I guess is outdated. Doesn't work that well with depositing items and selling items.. Someone mind giving me a hand and update it?
--Settings---------------------------------------
MPotID = 268 --- mana potion ID
MinMPots = 20 ---- if less then script will exit spawn
MPots = 200 ----- amount to refill
MPotprice = 50 ---- price of 1 single mana pot
HPotID = 239 ---- health potion ID
HPotprice = 190 ---- health potion price
HPots = 10 ---- health potions you want to buy
MinHPots = 5 ---- min of health potions to leave
MinCap = 50 ---- if less then script will exit spawn
-------------------------------------------------
--END OF SETTINGS--------------------------------
--- DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU'RE DOING ---
dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function NpcConv(...)
for _, str in ipairs(arg) do
wait((tostring(str):len() / 125) * 60000 * math.random(1.1, 1.8))
Self.SayToNpc(str)
end
end
function onWalkerSelectLabel(labelName)
if (labelName == "sell") then
delayWalker(20000)
Self.SayToNpc({"hi", "trade"}, 65)
Self.ShopSellItem(17810, Self.ItemCount(17810))
wait(900, 1200)
Self.ShopSellItem(17859, Self.ItemCount(17859))
wait(900, 1200)
Self.ShopSellItem(17819, Self.ItemCount(17819))
wait(900, 1200)
Self.ShopSellItem(17818, Self.ItemCount(17818))
wait(900, 1200)
Self.ShopSellItem(17813, Self.ItemCount(17813))
wait(900, 1200)
Self.ShopSellItem(17812, Self.ItemCount(17812))
wait(900, 1200)
setWalkerEnabled(true)
elseif (labelName == "checker") then
delayWalker(1000)
setWalkerEnabled(false)
if (Self.ItemCount(MPotID) <= MinMPots) or (Self.Cap() < MinCap) or (Self.ItemCount(HPotID) <= MinHPots) then
setWalkerEnabled(true)
gotoLabel("leavecave")
else
setWalkerEnabled(true)
gotoLabel("hunt")
end
elseif (labelName == "bank") then
setWalkerEnabled(false)
NpcConv("hi","deposit all","yes","balance")
wait(900, 1200)
Self.WithdrawMoney((MPotprice*(MPots-Self.ItemCount(MPotID))))
wait(900, 1200)
Self.SayToNpc("yes")
wait(900, 1200)
Self.WithdrawMoney((HPotprice*(HPots-Self.ItemCount(HPotID))))
wait(900, 1200)
Self.SayToNpc("yes")
wait(2000)
setWalkerEnabled(true)
wait(2000)
elseif (labelName == "useelevatordown") then
delayWalker(3000)
Self.UseItemFromGround(Self.Position().x + 1, Self.Position().y, Self.Position().z)
elseif (labelName == "useelevatorup") then
delayWalker(3000)
Self.UseItemFromGround(Self.Position().x + 1, Self.Position().y, Self.Position().z)
elseif (labelName == "backpacks") then
dofile("Forgee.lua")
delayWalker(15000)
resetBackpacks()
elseif (labelName == "deposit") then
setWalkerEnabled(false)
Self.DepositItems({17810,0})
Self.DepositItems({17859,0})
Self.DepositItems({17819,0})
Self.DepositItems({17818,0})
Self.DepositItems({17813,0})
Self.DepositItems({17812,0})
Self.DepositItems({17817,0})
Self.DepositItems({17809,0})
Self.DepositItems({17825,0})
wait(1500,1900)
setWalkerEnabled(true)
wait(2000)
elseif (labelName == "refillpots") then
setWalkerEnabled(false)
wait(900, 1200)
Self.SayToNpc({"hi", "flasks", "yes", "Trade"}, 65)
wait(900, 1200)
buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(MPotID , (MPots-Self.ItemCount(MPotID)))
wait(900, 1200)
buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(HPotID , (HPots-Self.ItemCount(HPotID)))
wait(200, 500)
setWalkerEnabled(true)
end
end
function buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(item, count)
count = tonumber(count) or 1
repeat
local amnt = math.min(count, 100)
if(Self.ShopBuyItem(item, amnt) == 0)then
return printf("ERROR: failed to buy item: %s", tostring(item))
end
wait(200,500)
count = (count - amnt)
until count <= 0
end
I'm currently using a script that I guess is outdated. Doesn't work that well with depositing items and selling items.. Someone mind giving me a hand and update it?
--Settings---------------------------------------
MPotID = 268 --- mana potion ID
MinMPots = 20 ---- if less then script will exit spawn
MPots = 200 ----- amount to refill
MPotprice = 50 ---- price of 1 single mana pot
HPotID = 239 ---- health potion ID
HPotprice = 190 ---- health potion price
HPots = 10 ---- health potions you want to buy
MinHPots = 5 ---- min of health potions to leave
MinCap = 50 ---- if less then script will exit spawn
-------------------------------------------------
--END OF SETTINGS--------------------------------
--- DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU'RE DOING ---
dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function NpcConv(...)
for _, str in ipairs(arg) do
wait((tostring(str):len() / 125) * 60000 * math.random(1.1, 1.8))
Self.SayToNpc(str)
end
end
function onWalkerSelectLabel(labelName)
if (labelName == "sell") then
delayWalker(20000)
Self.SayToNpc({"hi", "trade"}, 65)
Self.ShopSellItem(17810, Self.ItemCount(17810))
wait(900, 1200)
Self.ShopSellItem(17859, Self.ItemCount(17859))
wait(900, 1200)
Self.ShopSellItem(17819, Self.ItemCount(17819))
wait(900, 1200)
Self.ShopSellItem(17818, Self.ItemCount(17818))
wait(900, 1200)
Self.ShopSellItem(17813, Self.ItemCount(17813))
wait(900, 1200)
Self.ShopSellItem(17812, Self.ItemCount(17812))
wait(900, 1200)
setWalkerEnabled(true)
elseif (labelName == "checker") then
delayWalker(1000)
setWalkerEnabled(false)
if (Self.ItemCount(MPotID) <= MinMPots) or (Self.Cap() < MinCap) or (Self.ItemCount(HPotID) <= MinHPots) then
setWalkerEnabled(true)
gotoLabel("leavecave")
else
setWalkerEnabled(true)
gotoLabel("hunt")
end
elseif (labelName == "bank") then
setWalkerEnabled(false)
NpcConv("hi","deposit all","yes","balance")
wait(900, 1200)
Self.WithdrawMoney((MPotprice*(MPots-Self.ItemCount(MPotID))))
wait(900, 1200)
Self.SayToNpc("yes")
wait(900, 1200)
Self.WithdrawMoney((HPotprice*(HPots-Self.ItemCount(HPotID))))
wait(900, 1200)
Self.SayToNpc("yes")
wait(2000)
setWalkerEnabled(true)
wait(2000)
elseif (labelName == "useelevatordown") then
delayWalker(3000)
Self.UseItemFromGround(Self.Position().x + 1, Self.Position().y, Self.Position().z)
elseif (labelName == "useelevatorup") then
delayWalker(3000)
Self.UseItemFromGround(Self.Position().x + 1, Self.Position().y, Self.Position().z)
elseif (labelName == "backpacks") then
dofile("Forgee.lua")
delayWalker(15000)
resetBackpacks()
elseif (labelName == "deposit") then
setWalkerEnabled(false)
Self.DepositItems({17810,0})
Self.DepositItems({17859,0})
Self.DepositItems({17819,0})
Self.DepositItems({17818,0})
Self.DepositItems({17813,0})
Self.DepositItems({17812,0})
Self.DepositItems({17817,0})
Self.DepositItems({17809,0})
Self.DepositItems({17825,0})
wait(1500,1900)
setWalkerEnabled(true)
wait(2000)
elseif (labelName == "refillpots") then
setWalkerEnabled(false)
wait(900, 1200)
Self.SayToNpc({"hi", "flasks", "yes", "Trade"}, 65)
wait(900, 1200)
buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(MPotID , (MPots-Self.ItemCount(MPotID)))
wait(900, 1200)
buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(HPotID , (HPots-Self.ItemCount(HPotID)))
wait(200, 500)
setWalkerEnabled(true)
end
end
function buyAlotOfItemsBecauseItsSuchAGodDamnBigDeal(item, count)
count = tonumber(count) or 1
repeat
local amnt = math.min(count, 100)
if(Self.ShopBuyItem(item, amnt) == 0)then
return printf("ERROR: failed to buy item: %s", tostring(item))
end
wait(200,500)
count = (count - amnt)
until count <= 0
end