Log in

View Full Version : Knight Need Help with Script



jimiee445
11-09-2012, 02:19 PM
Hello iam new user and i don't know how to fix this problem

4576


Scipts i have problem with

dofile("SyntaxLuaLib.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "doors") then
Self.UseItemFromGround(32821, 31112, 7)
end
end


Script 2

dofile("SyntaxLuaLib.lua")

registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")

function onWalkerSelectLabel(labelName)

if (labelName == "bank") then
delayWalker(10000)
Self.Say("hi")
sleep(math.random(1000, 2000))
Self.SayToNpc("deposit all")
sleep(math.random(1000, 2000))
Self.SayToNpc("yes")
sleep(math.random(1000, 2000))


elseif (labelName == "deposit") then
local itemlist = {
["STACK BP"] = { -- Somebackpacks arent supported by lua!
depotSlot = 0, -- will deposit in first backpack of depot
items= {3029, 5912, 11486, 11470, 11456} -- Items with X ID will be deposited
},
["RARE-BP"] = { -- Somebackpacks arent supported by lua! ( in your main bp )
depotSlot = 1, -- will deposit in second backpack of depot
items= {3067, 3574, 827, 3041} -- Items with X ID will be deposited
}
}

depositItems(SOUTH, itemlist) -- this depot is south of the players pos

elseif (labelName == "withdrawmp") then
delayWalker(3000)
setWalkerEnabled(false)
local depot = Container.GetByName("Depot Chest")
for spot = 0, depot:ItemCount() do
local item = depot:GetItemData(spot)
if (item.id == 268) then
depot:MoveItemToContainer(spot, "Brown Backpack", 0)
setWalkerEnabled(true)
break
end
end
end
end


and script 3

dofile("SyntaxLuaLib.lua")
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")

function onWalkerSelectLabel(labelName)
if (labelName == "check") then
delayWalker(10000)
if (count(268) < 70) then
gotoLabel("leave")
else
gotoLabel("check1")
end

elseif (labelName == "check1") then
delayWalker(10000)
if (Self.Cap() < 100) then
gotoLabel("leave")
else
gotoLabel("continue")
end
end
end

gondacki
11-09-2012, 05:02 PM
Hello, you dofile("SyntaxLuaLib.lua")?
execute this or don't know...

Infernal Bolt
11-09-2012, 05:12 PM
I wouldn't suggest using one of these scripts since they are quite outdated.
I updated the lua for you but since it is so old it doesn't even buy manas it takes them from dp.
All scripts into 1 file.



registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "doors") then
Self.OpenDoor(32821, 31112, 7)
elseif (labelName == "bank") then
setWalkerEnabled(false)
Self.DepositMoney('all')
setWalkerEnabled(true)
elseif (labelName == "deposit") then
Self.DepositItems(3029, 5912, 11486, 11470, 11456, {3067,1}, {3574,1}, {827,1}, {3041,1})
elseif (labelName == "withdrawmp") then
setWalkerEnabled(false)
local depot = Container.GetByName("Depot Chest")
for spot = 0, depot:ItemSelf.ItemCount() do
local item = depot:GetItemData(spot)
if (item.id == 268) then
depot:MoveItemToContainer(spot, "Brown Backpack", 0)
setWalkerEnabled(true)
break
end
end
elseif (labelName == "check") then
if (Self.ItemCount(268) < 70 or Self.Cap() < 100) then
gotoLabel("leave")
else
gotoLabel("check1")
end
end
end

jimiee445
11-09-2012, 06:15 PM
Thank You alot mate

Can you tell me how to setups bp in dp ?