when it do it this waypoint it happen
<item text="!cdataread" tag="254"><![CDATA[while (Self.Step("south") == 0) do wait(200) end]]></item>
Printable View
when it do it this waypoint it happen
<item text="!cdataread" tag="254"><![CDATA[while (Self.Step("south") == 0) do wait(200) end]]></item>
@DarkstaR for president!
Very impressive update. Especially considering it just followed a major game update.
Good job sir, will test and give feedback in the next couple of days.
Oh and if anyone cares I documented most of the functions in the lib if you want to read up on what each function does/returns.
Script No WorkCode:--[[ YOU CAN USE THIS AS A STANDALONE SCRIPT OR ADD IT TO A LABEL MANAGER SCRIPT AND
TOGGLE IT ON AND OFF BY CHANGING THIS VARIABLE IN YOUR LABELS. ]]--
local safeStrike = true
registerEventListener(TIMER_TICK, "onTick")
function onTick()
if safeStrike then
local pos = Self.LookPos()
for i = CREATURES_LOW, CREATURES_HIGH do
local c = Creature.GetFromIndex(i)
if c:isAlive() and c:isPlayer() and (c:Position().x == pos.x and c:Position().y == pos.y and c:Position().z == pos.z) then
Self.Turn(math.abs(Self.LookDirection() - 1))
end
end
end
end
registerEvent has to be after the function:
[code=lua]--[[ YOU CAN USE THIS AS A STANDALONE SCRIPT OR ADD IT TO A LABEL MANAGER SCRIPT AND
TOGGLE IT ON AND OFF BY CHANGING THIS VARIABLE IN YOUR LABELS. ]]--
local safeStrike = true
function onTick()
if safeStrike then
local pos = Self.LookPos()
for i = CREATURES_LOW, CREATURES_HIGH do
local c = Creature.GetFromIndex(i)
if c:isAlive() and c:isPlayer() and (c:Position().x == pos.x and c:Position().y == pos.y and c:Position().z == pos.z) then
Self.Turn(math.abs(Self.LookDirection() - 1))
end
end
end
end
registerEventListener(TIMER_TICK, "onTick")[/code]
It works well with the module system, too.
Code:function SafeStrike(module)
if safeStrike then
local pos = Self.LookPos()
for i = CREATURES_LOW, CREATURES_HIGH do
local c = Creature.GetFromIndex(i)
if c:isAlive() and c:isPlayer() and (c:Position().x == pos.x and c:Position().y == pos.y and c:Position().z == pos.z) then
Self.Turn(math.abs(Self.LookDirection() - 1))
end
end
end
end
Module.New('safestrike', SafeStrike)
lovely, xmas gift?
most of my scripts do not work:
MistrockSettingsTibtrak03:
I can not come up with EXANI hur "up
All worked before upgrade...Code:dofile("Forgee.lua")
------------------------------------------------------------------------------------------
------- Customize your script ------------------------------------------------------------
------------------------------------------------------------------------------------------
Hard = true -- Set true if you want the hardest version, with more smiths and drones
---BP Setup---
GoldBp = "Golden Backpack" -- Put the name of your backpack for gold
GoldBpID = 2871 -- Put the ID of your backpack for gold
LootBp = "Demon Backpack" -- Put the name of your backpack for loot
LootBpID = 9601 -- Put the ID of your backpack for loot
---Potions & Cap Setup---
--Cap
CapToRefill = 50 -- below this amount bot goes to refill
--Mana
PotsToRefill = 50 -- below this amount bot goes to refill
ManasToBuy = 150 -- Amount of mana potions to buy
pots = 268 -- ID of manapotion (should not be changed)
--Health
HealthPotsID = 236 -- ID of healthpotion you want to buy
HealthPotsPrice = 100 -- Price of healthpotion
HealthPotsToBuy = 25 -- Amount of healthpotions to buy
------------------------------------------------------------------------------------------
------- Do Not Touch Below! :) -----------------------------------------------------------
------------------------------------------------------------------------------------------
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
function onWalkerSelectLabel(labelName)
if (labelName == "ReopenBps") then
setBotEnabled(false)
closeBackpacks()
wait(1000,2000)
openBackpacks(GoldBpID, LootBpID)
wait(1000,2000)
setBotEnabled(true)
elseif (labelName == "CheckStatus") then
setBotEnabled(false)
local pots = Self.ItemCount(268)
local cap = Self.Cap()
if(pots <= PotsToRefill or cap <= CapToRefill) then
setBotEnabled(true)
gotoLabel('ToTown')
else
setBotEnabled(true)
gotoLabel('Hunt')
end
elseif (labelName == "DepositGold") then
setBotEnabled(false)
delayWalker(10000)
Self.SayToNpc('hi')
wait(1000,2000)
Self.SayToNpc('deposit all')
wait(1000,2000)
Self.SayToNpc('yes')
wait(1000,2000)
local GoldToManas = ((ManasToBuy-Self.ItemCount(268))*50)
local GoldToHealth = ((HealthPotsToBuy-Self.ItemCount(HealthPotsID))*HealthPotsPrice)
local GoldToPots = (GoldToManas+GoldToHealth)
Self.SayToNpc("withdraw " .. GoldToPots)
wait(1000,2000)
Self.SayToNpc('yes')
wait(1000,2000)
Self.SayToNpc('withdraw 500')
wait(1000,2000)
Self.SayToNpc('yes')
wait(1000,2000)
setBotEnabled(true)
elseif (labelName == "DepositLoot") then
setBotEnabled(false)
Self.DepositItems({7452, 0}, {7398, 0}, {9657, 0})
setBotEnabled(true)
elseif (labelName == "ReachDepot") then
setBotEnabled(false)
Self.ReachDepot()
setBotEnabled(true)
elseif (labelName == "GoMistrock") then
setBotEnabled(false)
Self.SayToNpc({'hi','mistrock','yes'}, 60)
wait(1500,3000)
setBotEnabled(true)
elseif (labelName == "GoYalahar") then
setBotEnabled(false)
Self.SayToNpc({'hi','yalahar','yes'}, 60)
wait(1500,3000)
setBotEnabled(true)
elseif (labelName == "CheckManas") then
if (Self.ItemCount(pots) <= PotsToRefill) then
setWalkerEnabled(true)
gotoLabel("BuyManas")
else
setWalkerEnabled(true)
gotoLabel("GoHunt")
end
elseif (labelName == "BuyPotions") then
setBotEnabled(false)
Self.SayToNpc({"Hi", "Trade"}, 65)
wait(1000,2000)
Self.ShopBuyItem(268,(ManasToBuy-Self.ItemCount(268)))
wait(1000,2000)
setBotEnabled(true)
elseif (labelName == "BuyHealthPotions") then
setBotEnabled(false)
Self.SayToNpc({"Hi", "Trade"}, 65)
wait(1000,2000)
Self.ShopBuyItem(HealthPotsID,(HealthPotsToBuy-Self.ItemCount(HealthPotsID)))
wait(1000,2000)
setBotEnabled(true)
elseif (labelName == "LevitateDown") then
setBotEnabled(false)
Self.Cast("exani hur down", 50)
wait(1000,2000)
setBotEnabled(true)
elseif (labelName == "LevitateUp") then
setBotEnabled(false)
Self.Cast("exani hur up", 50)
wait(1000,2000)
setBotEnabled(true)
elseif (labelName == "CheckHard") then
delayWalker(3000)
if Hard == true then
gotoLabel("Hard")
else
gotoLabel("Soft")
end
elseif (labelName == "CheckHard2") then
delayWalker(3000)
if Hard == true then
gotoLabel("Hard2")
else
gotoLabel("Soft2")
end
elseif(labelName == "CheckPosition") then
setBotEnabled(false)
print("Distance to next node: " .. Self.DistanceFromPosition(32620,31411,2))
if(Self.DistanceFromPosition(32620, 31411, 2) <= 0) then
setBotEnabled(true)
gotoLabel("Continue")
else
wait(1000,2000)
gotoLabel('back')
wait(2000,3000)
setBotEnabled(true)
end
elseif(labelName == "CheckPosition2") then
setBotEnabled(false)
print("Distance to next node: " .. Self.DistanceFromPosition(32621,31411,3))
if(Self.DistanceFromPosition(32621, 31411, 3) <= 0) then
setBotEnabled(true)
gotoLabel("Continue2")
else
wait(1000,2000)
gotoLabel('back2')
wait(2000,3000)
setBotEnabled(true)
end
elseif(labelName == "CheckPosition3") then
setBotEnabled(false)
print("Distance to next node: " .. Self.DistanceFromPosition(32628,31411,4))
if(Self.DistanceFromPosition(32628, 31411, 4) <= 2) then
setBotEnabled(true)
gotoLabel("Continue3")
else
wait(1000,2000)
gotoLabel('back3')
wait(2000,3000)
setBotEnabled(true)
end
elseif (labelName == "Levitatedown") then
delayWalker(2000)
Self.Cast("exani hur down", 50)
wait(1000,2000)
setTargetingEnabled(false)
elseif (labelName == "Levitateup") then
delayWalker(2000)
Self.Cast("exani hur up", 50)
wait(1000,2000)
setTargetingEnabled(false)
elseif (labelName == "CheckHealthsShop") then
setBotEnabled(false)
if ((Self.ItemCount(HealthPotsID) < HealthPotsToBuy)) then
setBotEnabled(true)
gotoLabel("BuyHealthPotions")
else
setBotEnabled(true)
gotoLabel("GoOn")
end
end
end
I will have to change?