Yamo
02-17-2013, 07:31 PM
--[[--
NAME: HIDDEN BRIMSTONE BUGS FOR KNIGHTS
AUTHOR: LUKE FISHER
CREATE DATE: 28.05.2012
CURRENT VERSION: 1.1
UPDATE DATE: 05.06.2012
--]]--
--Settings---------------------------------------
PotID = 268 --- mana potion ID
MinPots = 120 ---- if less then script will exit spawn
PotCost = 50 ---- cost of mana potion
Pots = 800 ----- amount of mana potions to refill
hPotID = 7643 --- health potion ID
hPotCost = 320 ---- cost of health potion
hPots = 60 ----- amount to refill
MinCap = 150 ---- if less then script will exit spawn
--END OF SETTINGS--------------------------------
--- DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU'RE DOING ---
dofile("Forgee.lua")
function SellVials()
Self.SayToNpc("hi")
sleep(math.random(2000, 3000))
Self.SayToNpc("flask")
sleep(math.random(2000, 3000))
if ((Self.ItemCount(283)+Self.ItemCount(284)+Self.Ite mCount(285)) > 0) then
repeat
Self.SayToNpc("yes")
sleep(math.random(2000, 3000))
until ((Self.ItemCount(283)+Self.ItemCount(284)+Self.Ite mCount(285)) == 0)
end
sleep(math.random(2000, 3000))
Self.SayToNpc("bye")
end
Self.ReachNpc = function(name, tries)
local npc = Creature.GetByName(name)
if (npc:DistanceFromSelf() > 3) then
tries = tries or 15
repeat
local npos = npc:Position()
Self.UseItemFromGround(npos.x, npos.y, npos.z)
wait(1500,2000)
tries = tries - 1
until (npc:DistanceFromSelf() <= 3) or (tries == 0)
end
end
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
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "check") then
delayWalker(1000)
setWalkerEnabled(false)
if (Self.ItemCount(PotID) <= MinPots) or (Self.Cap() < MinCap) then
setWalkerEnabled(true)
gotoLabel("Refill")
else
setWalkerEnabled(true)
gotoLabel("KeepHunting")
end
sleep(math.random(100,5000))
elseif (labelName == "Target&Loot") then
setLooterEnabled(true)
setTargetingEnabled(true)
elseif (labelName == "targetoff") then
setTargetingEnabled(false)
setLooterEnabled(false)
elseif (labelName == "targeton") then
setLooterEnabled(true)
setTargetingEnabled(true)
elseif (labelName == "deposit gold") then
setWalkerEnabled(false)
NpcConv("hi","deposit all","yes","balance")
wait(15000,19000)
setWalkerEnabled(true)
elseif (labelName == "BankCheck") and (Self.ItemCount(3031) > 0) then
gotoLabel("Shopping Time")
elseif (labelName == "Deposit Items") then
setWalkerEnabled(false)
local dprandomise = (math.random(1,2))
if ((dprandomise) ~=1) then
Self.DepositItems(5904, 11702, 3032, 11703, {10305, 1}, {10315, 1}, {9640, 2}, {3055, 3}, {3049, 3})
wait(1500,1900)
setWalkerEnabled(true)
else
Self.DepositItems({3049, 3}, {3055, 3}, {9640, 2}, {10315, 1}, {10305, 1}, 11703, 3032, 11702, 5904)
wait(1500,1900)
setWalkerEnabled(true)
end
elseif (labelName == "poxcheck") then
setWalkerEnabled(false)
if (Self.ItemCount(9640) > 0) then
gotoLabel("dp2")
setWalkerEnabled(true)
else
gotoLabel("ToSpawn")
setWalkerEnabled(true)
end
elseif (labelName == "poxcheck2") then
setWalkerEnabled(false)
if (Self.ItemCount(9640) > 0) then
gotoLabel("dp1")
setWalkerEnabled(true)
else
gotoLabel("ToSpawn")
setWalkerEnabled(true)
end
elseif (labelName == "ResetBP") then
setWalkerEnabled(false)
resetBackpacks()
wait(1500,1900)
setWalkerEnabled(true)
elseif (labelName == "Withdraw") then
setWalkerEnabled(false)
Self.SayToNpc("hi")
sleep(math.random(2400, 3000))
local moneytoget1 = (Pots-Self.ItemCount(PotID))*PotCost
local moneytoget2 = (hPots-Self.ItemCount(hPotID))*hPotCost
local softcost = Self.ItemCount(6530)*10500
local moneytoget = moneytoget1+softcost+moneytoget2
local moneytogetfin = (math.ceil((moneytoget/1000)))*1000
sleep(math.random(5000, 7000))
repeat
Self.SayToNpc("withdraw " .. moneytogetfin)
sleep(math.random(2400, 3000))
Self.SayToNpc("Yes")
sleep(math.random(2400, 3000))
until ((Self.ItemCount(3031) + (Self.ItemCount(3035) * 100) + (Self.ItemCount(3043) * 10000)) >= moneytogetfin)
Self.SayToNpc("bye")
sleep(math.random(2400, 3000))
setWalkerEnabled(true)
elseif (labelName == "buypots") then
setWalkerEnabled(false)
Self.SayToNpc("hi")
sleep(math.random(2000, 3000))
Self.SayToNpc("trade")
sleep(math.random(2400, 3000))
Self.BuyItemsUpTo(PotID, Pots)
sleep(math.random(9400, 12000))
Self.BuyItemsUpTo(hPotID, hPots)
sleep(math.random(3400, 4800))
Self.SayToNpc("bye")
setWalkerEnabled(true)
elseif (labelName == "flask") then
setWalkerEnabled(false)
SellVials()
setWalkerEnabled(true)
elseif (labelName == "potcheck") and (Self.ItemCount(PotID) < (Pots-20)) then
gotoLabel("Shopping Time")
elseif (labelName == "DoorEast") then
setWalkerEnabled(false)
wait(500)
Self.OpenDoor(Self.Position().x + 1, Self.Position().y, Self.Position().z)
setWalkerEnabled(true)
elseif (labelName == "DoorWest") then
setWalkerEnabled(false)
wait(500)
Self.OpenDoor(Self.Position().x - 1, Self.Position().y, Self.Position().z)
setWalkerEnabled(true)
elseif (labelName == "DoorSouth") then
setWalkerEnabled(false)
wait(500)
Self.OpenDoor(Self.Position().x, Self.Position().y + 1, Self.Position().z)
setWalkerEnabled(true)
elseif (labelName == "DoorNorth") then
setWalkerEnabled(false)
wait(500)
Self.OpenDoor(Self.Position().x, Self.Position().y - 1, Self.Position().z)
setWalkerEnabled(true)
elseif (labelName == "ExaniUP") then
setWalkerEnabled(false)
wait(500)
Self.Say("exani hur up")
sleep(math.random(700, 1400))
setWalkerEnabled(true)
elseif (labelName == "ExaniDOWN") then
setWalkerEnabled(false)
wait(500)
Self.Say("exani hur down")
sleep(math.random(700, 1400))
setWalkerEnabled(true)
elseif (labelName == "LeverEast") then
setWalkerEnabled(false)
wait(500)
Self.UseLever(Self.Position().x + 1, Self.Position().y, Self.Position().z, 2773)
setWalkerEnabled(true)
end
end
how to make it work with lever when it right or left? ( right : 2773 ) ( left : 2772)
NAME: HIDDEN BRIMSTONE BUGS FOR KNIGHTS
AUTHOR: LUKE FISHER
CREATE DATE: 28.05.2012
CURRENT VERSION: 1.1
UPDATE DATE: 05.06.2012
--]]--
--Settings---------------------------------------
PotID = 268 --- mana potion ID
MinPots = 120 ---- if less then script will exit spawn
PotCost = 50 ---- cost of mana potion
Pots = 800 ----- amount of mana potions to refill
hPotID = 7643 --- health potion ID
hPotCost = 320 ---- cost of health potion
hPots = 60 ----- amount to refill
MinCap = 150 ---- if less then script will exit spawn
--END OF SETTINGS--------------------------------
--- DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU'RE DOING ---
dofile("Forgee.lua")
function SellVials()
Self.SayToNpc("hi")
sleep(math.random(2000, 3000))
Self.SayToNpc("flask")
sleep(math.random(2000, 3000))
if ((Self.ItemCount(283)+Self.ItemCount(284)+Self.Ite mCount(285)) > 0) then
repeat
Self.SayToNpc("yes")
sleep(math.random(2000, 3000))
until ((Self.ItemCount(283)+Self.ItemCount(284)+Self.Ite mCount(285)) == 0)
end
sleep(math.random(2000, 3000))
Self.SayToNpc("bye")
end
Self.ReachNpc = function(name, tries)
local npc = Creature.GetByName(name)
if (npc:DistanceFromSelf() > 3) then
tries = tries or 15
repeat
local npos = npc:Position()
Self.UseItemFromGround(npos.x, npos.y, npos.z)
wait(1500,2000)
tries = tries - 1
until (npc:DistanceFromSelf() <= 3) or (tries == 0)
end
end
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
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "check") then
delayWalker(1000)
setWalkerEnabled(false)
if (Self.ItemCount(PotID) <= MinPots) or (Self.Cap() < MinCap) then
setWalkerEnabled(true)
gotoLabel("Refill")
else
setWalkerEnabled(true)
gotoLabel("KeepHunting")
end
sleep(math.random(100,5000))
elseif (labelName == "Target&Loot") then
setLooterEnabled(true)
setTargetingEnabled(true)
elseif (labelName == "targetoff") then
setTargetingEnabled(false)
setLooterEnabled(false)
elseif (labelName == "targeton") then
setLooterEnabled(true)
setTargetingEnabled(true)
elseif (labelName == "deposit gold") then
setWalkerEnabled(false)
NpcConv("hi","deposit all","yes","balance")
wait(15000,19000)
setWalkerEnabled(true)
elseif (labelName == "BankCheck") and (Self.ItemCount(3031) > 0) then
gotoLabel("Shopping Time")
elseif (labelName == "Deposit Items") then
setWalkerEnabled(false)
local dprandomise = (math.random(1,2))
if ((dprandomise) ~=1) then
Self.DepositItems(5904, 11702, 3032, 11703, {10305, 1}, {10315, 1}, {9640, 2}, {3055, 3}, {3049, 3})
wait(1500,1900)
setWalkerEnabled(true)
else
Self.DepositItems({3049, 3}, {3055, 3}, {9640, 2}, {10315, 1}, {10305, 1}, 11703, 3032, 11702, 5904)
wait(1500,1900)
setWalkerEnabled(true)
end
elseif (labelName == "poxcheck") then
setWalkerEnabled(false)
if (Self.ItemCount(9640) > 0) then
gotoLabel("dp2")
setWalkerEnabled(true)
else
gotoLabel("ToSpawn")
setWalkerEnabled(true)
end
elseif (labelName == "poxcheck2") then
setWalkerEnabled(false)
if (Self.ItemCount(9640) > 0) then
gotoLabel("dp1")
setWalkerEnabled(true)
else
gotoLabel("ToSpawn")
setWalkerEnabled(true)
end
elseif (labelName == "ResetBP") then
setWalkerEnabled(false)
resetBackpacks()
wait(1500,1900)
setWalkerEnabled(true)
elseif (labelName == "Withdraw") then
setWalkerEnabled(false)
Self.SayToNpc("hi")
sleep(math.random(2400, 3000))
local moneytoget1 = (Pots-Self.ItemCount(PotID))*PotCost
local moneytoget2 = (hPots-Self.ItemCount(hPotID))*hPotCost
local softcost = Self.ItemCount(6530)*10500
local moneytoget = moneytoget1+softcost+moneytoget2
local moneytogetfin = (math.ceil((moneytoget/1000)))*1000
sleep(math.random(5000, 7000))
repeat
Self.SayToNpc("withdraw " .. moneytogetfin)
sleep(math.random(2400, 3000))
Self.SayToNpc("Yes")
sleep(math.random(2400, 3000))
until ((Self.ItemCount(3031) + (Self.ItemCount(3035) * 100) + (Self.ItemCount(3043) * 10000)) >= moneytogetfin)
Self.SayToNpc("bye")
sleep(math.random(2400, 3000))
setWalkerEnabled(true)
elseif (labelName == "buypots") then
setWalkerEnabled(false)
Self.SayToNpc("hi")
sleep(math.random(2000, 3000))
Self.SayToNpc("trade")
sleep(math.random(2400, 3000))
Self.BuyItemsUpTo(PotID, Pots)
sleep(math.random(9400, 12000))
Self.BuyItemsUpTo(hPotID, hPots)
sleep(math.random(3400, 4800))
Self.SayToNpc("bye")
setWalkerEnabled(true)
elseif (labelName == "flask") then
setWalkerEnabled(false)
SellVials()
setWalkerEnabled(true)
elseif (labelName == "potcheck") and (Self.ItemCount(PotID) < (Pots-20)) then
gotoLabel("Shopping Time")
elseif (labelName == "DoorEast") then
setWalkerEnabled(false)
wait(500)
Self.OpenDoor(Self.Position().x + 1, Self.Position().y, Self.Position().z)
setWalkerEnabled(true)
elseif (labelName == "DoorWest") then
setWalkerEnabled(false)
wait(500)
Self.OpenDoor(Self.Position().x - 1, Self.Position().y, Self.Position().z)
setWalkerEnabled(true)
elseif (labelName == "DoorSouth") then
setWalkerEnabled(false)
wait(500)
Self.OpenDoor(Self.Position().x, Self.Position().y + 1, Self.Position().z)
setWalkerEnabled(true)
elseif (labelName == "DoorNorth") then
setWalkerEnabled(false)
wait(500)
Self.OpenDoor(Self.Position().x, Self.Position().y - 1, Self.Position().z)
setWalkerEnabled(true)
elseif (labelName == "ExaniUP") then
setWalkerEnabled(false)
wait(500)
Self.Say("exani hur up")
sleep(math.random(700, 1400))
setWalkerEnabled(true)
elseif (labelName == "ExaniDOWN") then
setWalkerEnabled(false)
wait(500)
Self.Say("exani hur down")
sleep(math.random(700, 1400))
setWalkerEnabled(true)
elseif (labelName == "LeverEast") then
setWalkerEnabled(false)
wait(500)
Self.UseLever(Self.Position().x + 1, Self.Position().y, Self.Position().z, 2773)
setWalkerEnabled(true)
end
end
how to make it work with lever when it right or left? ( right : 2773 ) ( left : 2772)