PDA

View Full Version : .lua help?



Xeromex
11-19-2012, 08:40 PM
So, I have my lua file here for a swamp trolls scripts but I have a problem
The depositer and bank depositer don't work, but the check and bpopener do?
Please help me :(


--Venore Swamp Trolls


--Made by Xeromex
--Last updated on 19 november 2012
--For all vocations
---------------------------

--Setup

StackDP = 0 -- Put the slot number of the bp with stackable items
MediDP = 1 -- Put the slot number of the bp with medicine pouches, put more backpacks in here

GoldBP = "Red Backpack" -- Put name of your gold backpack here

MinCap = 75 -- Put the amount of capacity to leave the cave and deposit

--DO NOT CHANGE AFTER THIS--

dofile("Forgee.lua")
print("Venore Swamp Trolls by Xeromex \n Version: 1.0")

registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")

function onWalkerSelectLabel(labelName)
if (labelName == "BpOpen") then
setWalkerEnabled(false)
Self.CloseContainers()
repeat
wait(900)
until (Self.UseItemFromEquipment("backpack") > 0)
wait (1000)
Container.GetFirst():OpenChildren(Item.GetID(GoldB P))
Container:Minimize()
setWalkerEnabled(true)
elseif (labelName == "check") then
print("Current Capacity: " .. math.ceil(Self.Cap()))
if (Self.Cap() > MinCap) then
gotoLabel("continue")
elseif (labelName == "atBank") then
setWalkerEnabled(false)
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))
setWalkerEnabled(true)
elseif (labelName == "deposit") then
setWalkerEnabled(false)
Self.ReachDepot()
Self.DepositItems({12517, 1}, {9686, 0}, {9692, 0}) -- Item, Container (0 = fist container)
sleep(math.random(700, 1400))
setWalkerEnabled(true)
end
end
end

Merkz
11-20-2012, 05:10 AM
try this:

--Venore Swamp Trolls


--Made by Xeromex Edited by Pedro
--Last updated on 20 November 2012
--For all vocations
---------------------------

--Setup

StackDP = 0 -- Put the slot number of the bp with stackable items
MediDP = 1 -- Put the slot number of the bp with medicine pouches, put more backpacks in here

GoldBP = "Red Backpack" -- Put name of your gold backpack here

MinCap = 75 -- Put the amount of capacity to leave the cave and deposit

--DO NOT CHANGE AFTER THIS--

dofile("Forgee.lua")
print("Venore Swamp Trolls by Xeromex \n Version: 1.0")

registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")

function onWalkerSelectLabel(labelName)
if (labelName == "BpOpen") then
setWalkerEnabled(false)
Self.CloseContainers()
repeat
wait(900)
until (Self.UseItemFromEquipment("backpack") > 0)
wait (1000)
Container.GetFirst():OpenChildren(Item.GetID(GoldB P))
Container:Minimize()
setWalkerEnabled(true)
elseif (labelName == "check") then
print("Current Capacity: " .. math.ceil(Self.Cap()))
if (Self.Cap() > MinCap) then
gotoLabel("continue")
end
elseif (labelName == "atBank") then
setWalkerEnabled(false)
Self.DepositMoney('all')
wait(1000)
setWalkerEnabled(true)
elseif (labelName == "deposit") then
setWalkerEnabled(false)
Self.ReachDepot()
Self.DepositItems({12517, 1}, {9686, 0}, {9692, 0}) -- Item, Container (0 = fist container)
sleep(math.random(700, 1400))
setWalkerEnabled(true)
end
end

Xeromex
11-20-2012, 06:27 AM
Ah, I didn't end that line. Thank you :)