Log in

View Full Version : item position



kubax36
03-05-2013, 04:11 PM
Hello, i have problem with my skinning behemoth script


function skin()
if (Self.ItemCount(5908) >= 1 and Self.TargetID() == 0) then
for x = -7, 7, 1 do
for y = -5, 5, 1 do
local item = Map.GetTopUseItem(Self.Position().x + x, Self.Position().y + y,

Self.Position().z)
if (item.id == 5999) then
delayWalker(3000)
setWalkerEnabled(false)

elseif (item.id == 4112) then
setLooterEnabled(false)
delayWalker(3000)
Self.UseItemWithGround(5908, Self.Position().x + x, Self.Position().y + y, Self.Position().z)
wait(1500,2500)
delayWalker(1000)
setLooterEnabled(true)
setWalkerEnabled(true)
end
end
end
end
wait(400)
end


while (true) do
skin()
end


Everything is working almost perfect, there is just one problem, if body of behemoth is unfortunately under me then bot stay there till this body will rot. I have idea how to fix it but, i was trying to do it for 2h but i gave up cuz there was error all the time in script. My idea is to put to script something like that

elseif ((item.id == 4112) = Self.Position().x and Self.Position().y and Self.Position().z) then
delayWalker(1000)
Self.Step("east")

Can someone help me to write it correctly, please? :D

Masterkad
03-11-2013, 03:30 PM
The mistake is that you set the walker off. It is already enough when you delay the walker since three seconds should be enough for going over the screen to skin a corpse. This means if the corpse is below your character, it will pause for three seconds and continue walking after it without skinning the behemoth. I hope you do not mind if you just skin 99% of the corpses.

Stusse
03-11-2013, 04:07 PM
In case you want to step east you should check if its walkable there. Otherwise if you stand west of a wall and try step east you'll stay there.

if (Map.IsTileWalkable(Self.Position().x -1, Self.Position().y, Self.Position().z)) then
Self.Step(EAST)


and so on