stp38
08-28-2012, 10:00 PM
Lua script=
-----------------------setting------------------------------------------------------------
maxMana = 80
manaId = 238
leaveMana = 20 --Number of mana potion you want to leave your hunt
------------------------------------------------------------------------------------
dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "Withdrawmoney") then
setWalkerEnabled(false)
delayWalker(5000)
Self.SayToNpc({"hi","deposit all","yes"}, 65)
sleep(math.random(700, 1400))
delayWalker(2000)
sleep(math.random(700, 1400))
Self.WithdrawMoney((manaPrice*(maxMana-Self.ItemCount(manaId))))
Self.SayToNpc({"yes"})
setWalkerEnabled(true)
end
end
dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "check") then
if ((Self.ItemCount(manaId) < leaveMana)) or (Self.Cap() < MinCap) then
gotoLabel("Withdrawmoney")
else
gotoLabel("hunt")
end
end
dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "check1") then
if ((Self.ItemCount(manaId) < leaveMana)) or (Self.Cap() < MinCap) then
gotoLabel("exit")
else
gotoLabel("hunt")
end
end
end
dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "Resetbp") then
resetBackpacks()
end
end
end
elseif (labelName == "BuyPotions") then
setWalkerEnabled(false)
delayWalker(10000) --Stops walker so that the character doesn't move away from the NPC.
Self.SayToNpc("hi")
sleep(math.random(800, 1700)) --Sleep between everything the character says to avoid suspicion.
Self.SayToNpc({"Hi", "flasks", "yes", "yes", "yes", "Trade"}, 65)
sleep(math.random(800, 1700)) --Sleep between everything the character says to avoid suspicion.
Self.SayToNpc("trade")
sleep(math.random(2000, 2400)) --Sleep between everything the character says to avoid suspicion.
buyitems(ManaPotID, (WantedMPS-Self.ItemCount(ManaPotID)))
sleep(math.random(800, 1700))
setWalkerEnabled(true)
end
end
function buyitems(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
end
-----------------------setting------------------------------------------------------------
maxMana = 80
manaId = 238
leaveMana = 20 --Number of mana potion you want to leave your hunt
------------------------------------------------------------------------------------
dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "Withdrawmoney") then
setWalkerEnabled(false)
delayWalker(5000)
Self.SayToNpc({"hi","deposit all","yes"}, 65)
sleep(math.random(700, 1400))
delayWalker(2000)
sleep(math.random(700, 1400))
Self.WithdrawMoney((manaPrice*(maxMana-Self.ItemCount(manaId))))
Self.SayToNpc({"yes"})
setWalkerEnabled(true)
end
end
dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "check") then
if ((Self.ItemCount(manaId) < leaveMana)) or (Self.Cap() < MinCap) then
gotoLabel("Withdrawmoney")
else
gotoLabel("hunt")
end
end
dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "check1") then
if ((Self.ItemCount(manaId) < leaveMana)) or (Self.Cap() < MinCap) then
gotoLabel("exit")
else
gotoLabel("hunt")
end
end
end
dofile("Forgee.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "Resetbp") then
resetBackpacks()
end
end
end
elseif (labelName == "BuyPotions") then
setWalkerEnabled(false)
delayWalker(10000) --Stops walker so that the character doesn't move away from the NPC.
Self.SayToNpc("hi")
sleep(math.random(800, 1700)) --Sleep between everything the character says to avoid suspicion.
Self.SayToNpc({"Hi", "flasks", "yes", "yes", "yes", "Trade"}, 65)
sleep(math.random(800, 1700)) --Sleep between everything the character says to avoid suspicion.
Self.SayToNpc("trade")
sleep(math.random(2000, 2400)) --Sleep between everything the character says to avoid suspicion.
buyitems(ManaPotID, (WantedMPS-Self.ItemCount(ManaPotID)))
sleep(math.random(800, 1700))
setWalkerEnabled(true)
end
end
function buyitems(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
end