View Full Version : Need some help with this script...
brahbrahbrah
06-26-2012, 09:15 AM
Ive been trying this morning to alter a mistrock paladin script to a ek/mage one by changing royal spear checker to a mana pot&cap checker, mana pot withdrawer instead of royal spear and the backpack function by forgee..
Can anyone check if this is correctly done?
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "check") then
if (Self.ItemCount(268) <= 25) or (Self.Cap() < 0) then
gotoLabel("refill")
else
gotoLabel("hunter")
end
elseif (labelName == "down") then
Self.Say("exani hur down")
elseif (labelName == "up") then
Self.Say("exani hur up")
elseif (labelName == "boattoyalahar") then
delayWalker(2000)
Self.Say("hi")
wait(800)
Self.SayToNpc("yalahar")
wait(800)
Self.SayToNpc("yes")
elseif (labelName == "gotomistrock") then
delayWalker(2000)
Self.Say("hi")
wait(800)
Self.SayToNpc("mistrock")
wait(800)
Self.SayToNpc("yes")
elseif (labelName == "bank") then
Self.DepositMoney("all")
elseif (labelName == "bankwithdraw") then
Self.WithdrawMoney("100")
elseif (labelName == "depot") then
Self.DepositItems({9657,0})
Self.DepositItems({3269,1},{7452,1},{7398,1})
elseif (labelName == "withdraw") then
Self.WithdrawItems(2,268)
elseif (labelName == "depotcheck") then
if (Self.ItemCount(268) < 150) then
gotoLabel("withdraw")
elseif (labelName == "Backpacks") then
dofile("Forgee.lua")
delayWalker(7000)
resetBackpacks()
end
end
end
Jakob Miller
06-26-2012, 09:22 AM
You do not need mana potion withdrawers anymore. Just go to shop and buy?
brahbrahbrah
06-26-2012, 09:40 AM
You do not need mana potion withdrawers anymore. Just go to shop and buy?
Mate, If I knew how to alter the entire script to go buy potions I would but I'm trying to hanker by by altering the script I have at hand and making it work, even tough it is a hassle to go buy potions to drop in dp :p
Jakob Miller
06-26-2012, 09:42 AM
Mate, If I knew how to alter the entire script to go buy potions I would but I'm trying to hanker by by altering the script I have at hand and making it work, even tough it is a hassle to go buy potions to drop in dp :p
I like your style. BUT. If you lack knowledge about scripting, I suggest you to take one of my scripts "magicians in yala for instance" and start from there. The talk to npc scripts are pretty advanced and therefore hard to understand!
brahbrahbrah
06-28-2012, 10:14 AM
I like your style. BUT. If you lack knowledge about scripting, I suggest you to take one of my scripts "magicians in yala for instance" and start from there. The talk to npc scripts are pretty advanced and therefore hard to understand!
function onWalkerSelectLabel(labelName)
if (labelName == "check") then
if (Self.ItemCount(268) < 11) then
setWalkerEnabled(false)
else
gotoLabel("hunting")
end
Ive dieted it down to just this, to stop walker if manapots are less then 11, but it wont work either.
Ive added the "check" label and there is a "hunting" label aswell.
Error-message I get;
"12:12 [XenoScript] manapotchecker.lua: 'end' expected (to close 'if' at line 2) near '<eof>'"
desche188
06-28-2012, 10:21 AM
function onWalkerSelectLabel(labelName)
if (labelName == "check") then
if (Self.ItemCount(268) < 11) then
setWalkerEnabled(false)
else
gotoLabel("hunting")
end
Ive dieted it down to just this, to stop walker if manapots are less then 11, but it wont work either.
Ive added the "check" label and there is a "hunting" label aswell.
Error-message I get;
"12:12 [XenoScript] manapotchecker.lua: 'end' expected (to close 'if' at line 2) near '<eof>'"
This will work
function onWalkerSelectLabel(labelName)
if (labelName == "check") then
if (Self.ItemCount(268) < 11) then
setWalkerEnabled(false) else
gotoLabel("hunting")
end
end
brahbrahbrah
06-28-2012, 10:26 AM
This will work
function onWalkerSelectLabel(labelName)
if (labelName == "check") then
if (Self.ItemCount(268) < 11) then
setWalkerEnabled(false) else
gotoLabel("hunting")
end
end
12:26 [XenoScript] mana.lua: 'end' expected (to close 'function' at line 1) near '<eof>'
brahbrahbrah
06-28-2012, 10:30 AM
jakobmiller fixed it for me, thanks alot brah =)
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "check") then
if (Self.ItemCount(268) < 11) then
setWalkerEnabled(false) else
gotoLabel("hunting")
end
end
end
desche188
06-28-2012, 10:33 AM
Brahbrahbrah you need to tab out your scripts not space them out because it makes things impossible to end
Jakob Miller
06-28-2012, 10:47 AM
Brahbrahbrah you need to tab out your scripts not space them out because it makes things impossible to end
Tabing has nothing to do with the code since the editor does not read tabs. But it makes it toooooons more easier to see what is written. B
gokuhsalas
07-18-2012, 02:53 PM
I need help too with my script can someone help me please? I need make it just deposit and leave with cap<30 and manas <10--Magicians..Here is the lua archive, please help me and someone has an script of mutated humans for free?
PHP Code:
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 = {
["Yellow Backpack"] = { --FIRST BACKPACK ( in your main bp )
depotSlot = 0, -- will deposit in first backpack of depot
items= {2995, 3067, 7440, 12308, 3069, 3072, 3075} -- Items with X ID will be deposited
},
["Red Backpack"] = { -- SECOND BACKPACK ( in your main bp )
depotSlot = 1, -- will deposit in second backpack of depot
items= {3034, 9645, 9639, 678} -- Items with X ID will be deposited
}
}
depositItems(SOUTH, itemlist) -- this depot is south of the players pos
elseif (labelName == "withdraw") 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, "Green Backpack", 0)
setWalkerEnabled(true)
break
end
end
end
end
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.