Using blessed wooden stake on dead bodies. Optionaly you can setup:
range - it will consider bodies only in this range
waitfresh - if true it will also consider fresh bodies
It will use browse field if body is covered by any unmoveable item, if its covered by moveable item it will just push it away. It will also add looted items to the MMH list (you need to add items to the loot list also (Looting > LootList)).
Configuration
Just paste the code to:
Cavebot > Scripter (it will works only if cavebot is enabled)
Scripter > Persistant
Code
auto(200)
if (maround(7,false) == 0 and $lootbodies == 0) then
stake(7, true, false)
end
04-24-2015, 02:36 PM
Borges
Great initiative to improve some functions that aren't working well.
Good Job :D
04-24-2015, 03:20 PM
pvzin
Nice stuff!
04-24-2015, 04:07 PM
Garkstal
Quote:
Originally Posted by borges
Great initiative to improve some functions that aren't working well.
Good Job :D
Quote:
Originally Posted by pvzin
Nice stuff!
Thanks :)
04-24-2015, 04:47 PM
Eli
Very well made, but what's the problem with built-in stake()?
04-24-2015, 06:42 PM
Garkstal
It doesnt use browse field if the body is covered by unmovable item (fire field etc)
04-24-2015, 09:16 PM
Eli
Quote:
Originally Posted by Garkstal
It doesnt use browse field if the body is covered by unmovable item (fire field etc)
Using obsidian knife on dead bodies. Optionaly you can setup:
range - it will consider bodies only in this range
waitfresh - if true it will also consider fresh bodies
It will use browse field if body is covered by any unmoveable item, if its covered by moveable item it will just push it away. It will also add looted items to the MMH list (you need to add items to the loot list also (Looting > LootList)).
Configuration
Just paste the code to:
Cavebot > Scripter (it will works only if cavebot is enabled)
local Range = 6 -- Range from which bot will consider bodies
local waitFreshBodies = false -- Wait till body wont be fresh?
-- Do not edit anything below
local fresh = {6017, 5969, 5973, 5981, 5982, 5983, 5984, 5999, 6030, 4239, 6040, 6041, 10355, 10359, 10363, 10367} -- ID's of fresh dead bodies
local old = {4173, 4011, 4025, 4047, 4052, 4057, 4062, 4112, 4212, 4321, 4324, 4327, 10352, 10356, 10360, 10364 } -- ID's of not fresh dead bodies
local lootItems = {5878, 5876, 5877, 5948, 5925, 5893, 954, 2977} -- items which will be added to the MMH list
local function bodiesInfo(range, _fresh)
local infos = {}
for a=0, range do
local i, j = -a, -a
while j <= a do
i = -a
while i <= a do
local px, py = $posx+i, $posy+j
if (math.abs(j) == a or math.abs(i) == a) and tilehasinfo(px, py, $posz) then
local tile = gettile(px, py, $posz)
for k=0, tile.itemcount do
if (_fresh and table.find(fresh, tile.item[k].id)) or (table.find(old, tile.item[k].id)) then
table.insert(infos, {px, py})
break
end
end
end
if math.abs(j) ~= a then
i = i+2*a
else
i = i + 1
end
end
j = j + 1
end
end
return infos
end
function _skin(range, waitfresh)
local waitfresh = waitfresh or false
local info = bodiesInfo(range, waitfresh)
if skin and itemcount('obsidian knife') == 0 and clientitemhotkey('obsidian knife','crosshair') == 'not found' then
info = {}
return ''
end
if #info ~= 0 then
-- Counting items (actual amount)
local Amount = {}
for _, Items in ipairs(lootItems) do
Amount[Items] = itemcount(Items)
end
pausewalking(60000)
for a=1, #info do
local px, py = info[a][1], info[a][2]
if tilehasinfo(px, py, $posz) and tilereachable(px, py, $posz) then
local function distFrom(x,y)
return math.abs($posx - x) > math.abs($posy - y) and math.abs($posx - x) or math.abs($posy - y)
end
if distFrom(px, py) > 1 then
reachlocation(px, py, $posz)
end
local tile = gettile(px, py, $posz)
if not table.find(old, topitem(px, py, $posz).id) and not table.find(fresh, topitem(px, py, $posz).id) then
if itemproperty(topitem(px, py, $posz).id, ITEM_NOTMOVEABLE) then
while windowcount("Browse Field") == 0 do
browsefield(px, py, $posz)
wait(500)
end
for i=1, getcontainer("Browse Field").itemcount do
local itemId = getcontainer("Browse Field").item[i].id
if (table.find(old, itemId)) or (table.find(fresh, itemId) and waitfresh) then
while table.find(fresh, itemId) and waitfresh do
wait(200)
itemId = getcontainer("Browse Field").item[i].id
end
while not table.find(old, topitem(px, py, $posz).id) and itemcount(itemId, "Browse Field") > 0 do
moveitems(itemId, ground(px, py, $posz), "Browse Field", 1)
wait(500)
end
local function bodiesInWindow(win)
local counter = 0
for i=1, getcontainer(win).itemcount do
if (table.find(old, getcontainer(win).item[i].id)) or (waitfresh and table.find(fresh, getcontainer(win).item[i].id)) then
counter = counter + 1
break
end
end
return counter
end
if bodiesInWindow("Browse Field") <= 1 then
closewindows("Browse Field")
end
break
end
end
else
local function push(startx, starty)
local x,y,z = 0, 0, $posz
for i=-1, 1 do
for j=-1, 1 do
if tilewalkable(startx+i, starty+j, $posz) and (i ~= 0 or j ~= 0) and x == 0 then
x,y = startx+i, starty+j
break
end
end
end
return x,y,z
end
while not table.find(fresh, topitem(px, py, $posz).id) and not table.find(old, topitem(px, py, $posz).id) do
moveitems(topitem(px, py, $posz).id, ground(push(px, py)), ground(px, py, $posz), 1)
wait(400, 500)
end
end
end
while table.find(fresh, topitem(px, py, $posz).id and waitfresh) do
wait(200)
end
-- If standing on same tile as body then move somewhere
if $posx == px and $posy == py then
local dirs = {
{$posx-1, $posy},
{$posx+1, $posy},
{$posx, $posy-1},
{$posx, $posy+1}
}
for _, v in ipairs(dirs) do
if not itemproperty(topitem(v[1], v[2], $posz).id, ITEM_FLOORCHANGE) and tilewalkable(v[1], v[2], $posz) then
moveto(v[1], v[2], $posz)
wait(200)
break
end
end
end
while table.find(old, topitem(px, py, $posz).id) do
useitemon("obsidian knife", 0, ground(px, py, $posz))
wait(500)
end
end
end
-- Checking if count has changed
for Item, Count in pairs(Amount) do
local Current = itemcount(Item)
if Current > Count then
Amount[Item] = Current
increaseamountlooted(Item, Current - Count)
end
end
pausewalking(1000)
end
end
init end
auto(100)
-- Example of use
if maround(7) == 0 then
_skin(Range, waitFreshBodies)
end
@Garkstal ur script is not waiting for the bodies. : <
tbh it does not work at all at vampires.
09-12-2015, 12:31 PM
Garkstal
Quote:
Originally Posted by bashante
@Garkstal ur script is not waiting for the bodies. : <
tbh it does not work at all at vampires.
Can you be more specific?
09-13-2015, 10:45 AM
bashante
Quote:
Originally Posted by Garkstal
Can you be more specific?
I dont know what else can i say. I copied ur script from thread and put it in vapire edron crypt script of mine. Just do not use stake. Dont wait for fresh bodies. Like it do not even know what todo
09-13-2015, 04:36 PM
Garkstal
Quote:
Originally Posted by bashante
I dont know what else can i say. I copied ur script from thread and put it in vapire edron crypt script of mine. Just do not use stake. Dont wait for fresh bodies. Like it do not even know what todo
Do you enabled option to wait for fresh bodies?
09-13-2015, 05:21 PM
bashante
Quote:
Originally Posted by Garkstal
Do you enabled option to wait for fresh bodies?
yes i did.
09-14-2015, 03:13 AM
devost
i have the same problem on @Dworak script,
its don't stake nothing,
looks he use ur persistent,
and just don't work
Quote:
Originally Posted by Garkstal
Do you enabled option to wait for fresh bodies?
09-14-2015, 02:01 PM
Garkstal
Quote:
Originally Posted by bashante
yes i did.
Quote:
Originally Posted by devost
i have the same problem on @Dworak script,
its don't stake nothing,
looks he use ur persistent,
and just don't work
Ive got same staker in my penisula tomb script, will check that out once again and post results later.
09-14-2015, 02:38 PM
devost
Quote:
Originally Posted by Garkstal
Ive got same staker in my penisula tomb script, will check that out once again and post results later.
i'll wait brother
09-14-2015, 03:58 PM
Garkstal
Quote:
Originally Posted by devost
i'll wait brother
Ok, ive tested it and its working fine. The issue which you had might occure because:
there is other pausewalking() function which overrides the one from staker persistant
you are using $lootsaround and looting is disabled
09-19-2015, 05:50 PM
ilikepotatoes
Bugs out when my character or other player is standing on body :s
12-10-2015, 10:35 AM
robroa
Hello guys.
Now with the update it is not necessary to wait for the fresh bodies.
How to fix this script?
12-15-2015, 11:30 AM
marcelspl
Quote:
Originally Posted by robroa
Hello guys.
Now with the update it is not necessary to wait for the fresh bodies.
How to fix this script?
I would like to know too!
12-15-2015, 11:36 AM
marcelspl
I would like to see this script working with browser field, because sometimes there is something on the corpse.
12-18-2015, 01:49 PM
fleiuss
Working fine for obisian knife. Only issue is when the bot happens to drop vials on top of the target body. Then it moves vials alright, but one by one, instead of all at once.
Other than that great script! Thanks!
12-18-2015, 02:12 PM
Garkstal
Quote:
Originally Posted by robroa
Hello guys.
Now with the update it is not necessary to wait for the fresh bodies.
How to fix this script?
Quote:
Originally Posted by marcelspl
I would like to know too!
Quote:
Originally Posted by marcelspl
I would like to see this script working with browser field, because sometimes there is something on the corpse.
Quote:
Originally Posted by fleiuss
Working fine for obisian knife. Only issue is when the bot happens to drop vials on top of the target body. Then it moves vials alright, but one by one, instead of all at once.
Other than that great script! Thanks!
Updated
01-05-2016, 11:26 AM
Garkstal
Updated the code to new tibia version
01-05-2016, 01:38 PM
spyro
1 Attachment(s)
in this script is a little problem on edron Vampire Crypt. Problem is when vampire die under wood then script openwindow and trying use blessed wooden stake on body on window (and can't blessed body, just stuck and try and try). How to fix script that script when see wooden beam isnt be like fire bomb, vials or other obstactle, it could be blessed by hand.
Better if this way change from dont browse field to just bless body
I'm getting an error with this script. I'm not sure how to fix it.
00:33:19 error in Persistent script blessed stake:
[" _stake(Range, waitFreshBodies..."]:blessed stake:163 attempt to call global '_stake' (a nil value)
01-13-2016, 01:51 AM
aussiehunter
Getting this same error ^
01-15-2016, 01:49 PM
Garkstal
Quote:
Originally Posted by spyro
in this script is a little problem on edron Vampire Crypt. Problem is when vampire die under wood then script openwindow and trying use blessed wooden stake on body on window (and can't blessed body, just stuck and try and try). How to fix script that script when see wooden beam isnt be like fire bomb, vials or other obstactle, it could be blessed by hand.
Better if this way change from dont browse field to just bless body
I'm getting an error with this script. I'm not sure how to fix it.
00:33:19 error in Persistent script blessed stake:
[" _stake(Range, waitFreshBodies..."]:blessed stake:163 attempt to call global '_stake' (a nil value)
Quote:
Originally Posted by aussiehunter
Getting this same error ^
Quote:
Originally Posted by Dinhu
@Garkstal can u help us?
Im getting this same problem "error in Persistent script blessed stake:
[" _stake(Range, waitFreshBodies..."]:blessed stake:163 attempt to call global '_stake' (a nil value)"
Hey man, I'm hoping you can make this script for using blessed wooden stake right away since CIP made this possible.. anyway to do this?
02-23-2016, 12:51 AM
diabooo
13:53:13 error in Persistent script blessed stake:
[" _stake(Range, waitFreshBodies..."]:blessed stake:163 attempt to call global '_stake' (a nil value)
@Garkstal
I know it's not your fault not work anymore, but please do another again or arrange I beg you ..
Please
02-23-2016, 06:03 AM
AdrianLbN
will it works if i change bodys ID and item's to use name from blessed wooden stake to for example knife etc?