This update brings a lot of improvements to the 3.0.0 update, adds some new functionality, and fixes some bugs. If you have not seen the 3.0.0 update thread, it is imperative that you read it.
Changelog:
[highlight=lua]--------------------------------------Code:v3.0.1
Fixed many Scripter issues which surfaced with v3.0.0
Fixed some crashes and debugs which surfaced with v3.0.0
Fixed the Channel Scripter class, it should work properly now.
Added the new furniture kit item ID's to the Pathfinder (17972 and 17977).
Added Self.OpenMainBackpack() to the Scripter. It will open your main backpack and return its instance.
Added the Walker class to the Scripter.
Walker.Stop(): The same as setWalkerEnabled(false).
Walker.Start(): The same as setWalkerEnabled(true).
Walker.Delay(time): The same as delayWalker(time).
Walker.Goto(label): The same as gotoLabel(label).
Walker.ConditionalGoto(condition, labeltrue[, labelelse])
Functionality: Calls Walker.Goto() on either labeltrue or labelelse, depending on the state of condition.
Parameters:
condition: A true or non-true value.
labeltrue: The label we will go to if condition has a value of true.
labelelse: If supplied (it is optional), the label we will go to if condition is not true.
Example Usage: Walker.ConditionalGoto(Self.Cap() < 100, "deposit", "hunt")
Added the Looter class to the Scripter.
Looter.Stop(): The same as setLooterEnabled(false).
Looter.Start(): the same as setLooterEnabled(true).
Added the Targeting class to the Scripter.
Targeting.Stop(): The same as setTargetingEnabled(false).
Targeting.Start(): the same as setTargetingEnabled(true).
Added the Cavebot class to the Scripter.
Cavebot.Stop(): Calls Walker.Stop(), Looter.Stop(), and Targeting.Stop().
Cavebot.Start(): Calls Walker.Start(), Looter.Start(), and Targeting.Start().
------- [[ Lua examples: ]] -------
--------------------------------------
------------[[ New function descriptions ]]------------
Walker.Delay(1000) -- is the same as: delayWalker(1000)
Walker.Goto("boobs") -- is the same as: gotoLabel("boobs")
Walker.Stop() -- is the same as: setWalkerEnabled(false)
Walker.Start() -- is the same as: setWalkerEnabled(true)
Walker.ConditionalGoto(Self.ItemCount("mana potion") < 50, "LeaveHunt", "ContinueHunt")
--[[ Is the same as:
if (Self.ItemCount("mana potion") < 50) then
gotoLabel("LeaveHunt")
else
gotoLabel("ContinueHunt")
end
]]--
Walker.ConditionalGoto(Self.ItemCount("mana potion") < 50, "LeaveHunt")
--[[ Is the same as:
if (Self.ItemCount("mana potion") < 50) then
gotoLabel("LeaveHunt")
end
]]--
Self.OpenMainBackpack() -- Opens your main backpack and returns the Container instance it opened as.
------------[[ New function examples ]]------------
-- Method 1 for checking mana pots, health pots, and capacity, before deciding what to do --
Walker.ConditionalGoto(Self.ItemCount("mana potion") < 50, "LeaveHunt")
Walker.ConditionalGoto(Self.ItemCount("ultimate health potion") < 50, "LeaveHunt")
Walker.ConditionalGoto(Self.Cap() < 100, "LeaveHunt", "ContinueHunt")
-- Method 2 for checking mana pots, health pots, and capacity, before deciding what to do --
local MustDeposit = Self.ItemCount("mana potion") < 50 or Self.ItemCount("ultimate health potion") < 50 or Self.Cap() < 100
Walker.ConditionalGoto(MustDeposit , "LeaveHunt", "ContinueHunt")
-- Opens your main backpack, followed by the blue and orange backpacks inside of it. --
Self.OpenMainBackpack():OpenChildren("blue backpack", "orange backpack")
------------[[ v3.0.0 information (incase you missed the thread) ]]------------
-- interchangeable name/ids example --
Self.UseItemWithMe("mana potion") -- same as: Self.UseItemWithMe(268)
Self.Equip("stonecutter axe", "weapon") -- same as: Self.Equip(3319, "weapon")
Self.UseItemWithTarget("sudden death rune") -- same as: Self.UseItemWithTarget(3155)
Self.DropItems(Self.Position().x, Self.Position().y, Self.Position().z, 284, 285, "label")
Self.DepositItems(17809, "cheese cutter", {17818, 0}, {"earflap", 0} )
Self.WithdrawItems(0, {268, 0, 100}, {"power bolt", 0, 1500}, {"strong mana potion", 0, 300})
-- static calls example --
Container.Minimize("blue backpack") -- same as: Container.GetByName("blue backpack"):Minimize()
Container.OpenChildren("blue backpack", 8860, 2871) -- same as: Container.GetByName("blue backpack"):OpenChildren(8860, 2871)
Creature.isTarget('Demon') -- same as: Creature.GetByName('Demon'):isTarget()
-- module example --
function DoFish(module) --our fisher callback
local WATER_FISH = {4597, 4598, 4599, 4600, 4601, 4602}
for x = -7, 7, 1 do
for y = -5, 5, 1 do
local position = Self.Position()
local item = Map.GetTopUseItem(position.x + x, position.y + y, position.z)
if(table.contains(WATER_FISH, item.id))then
Self.UseItemWithGround(3483, position.x + x, position.y + y, position.z)
module:Delay(1000) --delay myself for 1 second
end
end
end
end
local fisher = Module.New('auto-fisher', DoFish) -- create an autofisher module
fisher:Stop() -- stops the fisher
fisher:Start() -- starts the fisher
Module.Stop('auto-fisher') -- also stops the fisher
Module.Start('auto-fisher') -- also starts the fisher[/highlight]
For download and operation instructions, refer back to this thread:
http://forums.xenobot.net/showthread.php?19