Signup Now
Results 1 to 9 of 9
  1. #1
    Free User elderguiga's Avatar
    Join Date
    Feb 2015
    Location
    Caxias do Sul - Brasil
    Posts
    38
    Reputation
    10
    Rep Power
    0

    [request] blessed wooden stake

    [request] blessed wooden stake
    Hello Guys!

    I made a script for vampire dust collector and currently my blessed wooden stake persistent is somehow bugged.
    Is there a 100% persistant for blessed wooden stake?

    I have a hotkey preset for blessed wooden stake, and the persistent i currently use is this one

    HTML Code:
    init start
        -- local SCRIPT_VERSION = '1.0.0'
    
        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 = {5995, 6006, 8744, 18961}                    -- ID's of fresh dead bodies
        local old = {4097, 4137, 8738, 18958}                    -- ID's of not fresh dead bodies
    
        local lootItems = {5906, 5905}                            -- 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 _stake(range, waitfresh)
            local waitfresh = waitfresh or false
    
            local info = bodiesInfo(range, waitfresh)
    
            if skin and itemcount('blessed wooden stake') == 0 and clientitemhotkey('blessed wooden stake','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("blessed wooden stake", 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
        _stake(Range, waitFreshBodies)
    end

    With this persistent, sometimes my character get stuck because he's on top of the dead vampire, or even worst, he gets stuck because he tries to use browse field and cant find the dead vampire.


    Any suggestions or working persistant?

    Thx!!


    edit1: Also, i couldnt find any recent script after they removed the wait fresh bodies time

  2. #2
    Free User Cisco's Avatar
    Join Date
    Aug 2014
    Location
    Brazil
    Posts
    1,424
    Reputation
    119
    Rep Power
    23
    @elderguiga

    Have you tried this?....

    auto(1000)

    local UseStake = true
    local RangeCorpse = 4
    local MoveCorpse = true
    local WaitCorpse = false --wait for fresh bodies
    local MonstersRange = 7 --check monsters around char
    local HuntSections = {'Hunt'}
    local MonstersHunt = {'Vampire', 'Bonebeast'}
    local MoveDust = true
    local BpDust = 'brocade backpack'

    --============

    local Dusts = {'vampire dust', 'demon dust'}

    if $connected then
    if UseStake and (itemcount(5942) > 0) then
    if table.find(HuntSections, $wptsection) then
    if (maroundreachable(MonstersRange, unpack(MonstersHunt)) == 0) and (table.find(MonstersHunt, $attacked.name) == 0) then
    if stakespots(RangeCorpse, MoveCorpse, WaitCorpse) > 0 then
    stake(RangeCorpse, MoveCorpse, WaitCorpse)
    pausewalking(5*1000)
    end
    if MoveDust and (itemcount(BpDust) > 0) then
    if itemcount(table.find(Dusts, itemid)) > 0 then
    for _, dust in ipairs(Dusts) do
    moveitems(dust, BpDust, '100')
    wait(300, 500)
    end
    end
    end
    end
    end
    end
    end

  3. #3
    Free User elderguiga's Avatar
    Join Date
    Feb 2015
    Location
    Caxias do Sul - Brasil
    Posts
    38
    Reputation
    10
    Rep Power
    0
    Quote Originally Posted by Cisco View Post
    @elderguiga

    Have you tried this?....

    auto(1000)

    local UseStake = true
    local RangeCorpse = 4
    local MoveCorpse = true
    local WaitCorpse = false --wait for fresh bodies
    local MonstersRange = 7 --check monsters around char
    local HuntSections = {'Hunt'}
    local MonstersHunt = {'Vampire', 'Bonebeast'}
    local MoveDust = true
    local BpDust = 'brocade backpack'

    --============

    local Dusts = {'vampire dust', 'demon dust'}

    if $connected then
    if UseStake and (itemcount(5942) > 0) then
    if table.find(HuntSections, $wptsection) then
    if (maroundreachable(MonstersRange, unpack(MonstersHunt)) == 0) and (table.find(MonstersHunt, $attacked.name) == 0) then
    if stakespots(RangeCorpse, MoveCorpse, WaitCorpse) > 0 then
    stake(RangeCorpse, MoveCorpse, WaitCorpse)
    pausewalking(5*1000)
    end
    if MoveDust and (itemcount(BpDust) > 0) then
    if itemcount(table.find(Dusts, itemid)) > 0 then
    for _, dust in ipairs(Dusts) do
    moveitems(dust, BpDust, '100')
    wait(300, 500)
    end
    end
    end
    end
    end
    end
    end

    Just tried this, put on cavebot-script and nothing..
    put on persistend and nothing
    he doesnt even try to stake


    HTML Code:
    auto(1000)
    
    local UseStake = true
    local RangeCorpse = 4
    local MoveCorpse = true
    local WaitCorpse = false --wait for fresh bodies
    local MonstersRange = 7 --check monsters around char
    local HuntSections = {'AtSpawn'}
    local MonstersHunt = {'Vampire', 'Vampire bride'}
    local MoveDust = true
    local BpDust = 'Fur backpack'
    
    --============
    
    local Dusts = {'vampire dust', 'demon dust'}
    
    if $connected then
    	if UseStake and (itemcount(5942) > 0) then
    		if table.find(HuntSections, $wptsection) then
    			if (maroundreachable(MonstersRange, unpack(MonstersHunt)) == 0) and (table.find(MonstersHunt, $attacked.name) == 0) then
    				if stakespots(RangeCorpse, MoveCorpse, WaitCorpse) > 0 then
    					stake(RangeCorpse, MoveCorpse, WaitCorpse)
    					pausewalking(5*1000)
    				end
    				if MoveDust and (itemcount(BpDust) > 0) then
    					if itemcount(table.find(Dusts, itemid)) > 0 then
    						for _, dust in ipairs(Dusts) do
    							moveitems(dust, BpDust, '100')
    							wait(300, 500)
    						end
    					end
    				end
    			end
    		end
    	end
    end
    Last edited by elderguiga; 05-06-2017 at 05:51 AM.

  4. #4
    Free User
    Join Date
    Feb 2014
    Posts
    230
    Reputation
    29
    Rep Power
    21
    Did u change "HuntSection"?

    Anyways i sent you last time easier script, why don't u just try it out?

    auto(800, 1000)
    if $lootsaround == 0 and $targetingtarget.id == 0 and stakespots(7) > 0 then
    stake(7)
    pausewalking(3000)
    end

  5. #5
    Free User elderguiga's Avatar
    Join Date
    Feb 2015
    Location
    Caxias do Sul - Brasil
    Posts
    38
    Reputation
    10
    Rep Power
    0
    Quote Originally Posted by Good View Post
    Did u change "HuntSection"?

    Anyways i sent you last time easier script, why don't u just try it out?

    auto(800, 1000)
    if $lootsaround == 0 and $targetingtarget.id == 0 and stakespots(7) > 0 then
    stake(7)
    pausewalking(3000)
    end
    yeah, I changed..

    Gonna try this out this afternoon and I reply

  6. #6
    Free User
    Join Date
    Jan 2017
    Posts
    1
    Reputation
    10
    Rep Power
    0
    achou?, to procurando também @elderguiga

  7. #7
    Free User blakw's Avatar
    Join Date
    Dec 2013
    Posts
    2,670
    Reputation
    73
    Rep Power
    26
    If stake is somehow hanging with a dead body away change the range to 1:
    stake(1, true, true)


    Visit:
    (◣_◢)

  8. #8
    Free User elderguiga's Avatar
    Join Date
    Feb 2015
    Location
    Caxias do Sul - Brasil
    Posts
    38
    Reputation
    10
    Rep Power
    0
    Quote Originally Posted by blakw View Post
    If stake is somehow hanging with a dead body away change the range to 1:
    stake(1, true, true)
    That actually helped me a while ago, but the problem is that sometimes it stands over the dead vampire, and keep trying to stake his feet. he just stops staking when the corpse gets rotten.

  9. #9
    Free User elderguiga's Avatar
    Join Date
    Feb 2015
    Location
    Caxias do Sul - Brasil
    Posts
    38
    Reputation
    10
    Rep Power
    0
    Quote Originally Posted by lipesepp View Post
    achou?, to procurando também @elderguiga
    Ainda não conseguir achar um 100%. o melhor que tem ainda é o que eu postei no primeiro tópico do post.
    Todos que testei depois ou demoram muito pra usar a stake, ou ficam bugados tentando andar e stakar ao mesmo tempo.

    Aquele que eu postei na primeira vez não demora nem tenta andar, mas as vezes ele fica emcima do bixo morto, e fica tentando usar a stake no próprio pé. dai buga o bot. e ele só sai andando denovo quando o corpo apodreçe.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •