Results 1 to 10 of 10

Thread: Use item on Corpse

  1. #1
    iBot User
    Join Date
    Feb 2013
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4

    Use item on Corpse

    Hello,

    Can someone make an action to use a certain item in a monster corpse?

    Thank you.

  2. #2
    iBot User pink_panther's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    4,075
    Mentioned
    49 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    178 Post(s)
    Reputation
    309
    Rep Power
    10
    I didnt test it:

    PHP Code:
    local itemID 1234 -- Corpse ID
    local itemRange 
    7

    for 0,itemRange do
        for 
    0,itemRange do
            if 
    toptileitem(posx+iposy+jposz) == itemID then
                reachgrounditem
    (itemID)
                
    wait(500)
                
    useitemon(itemIDposx+iposy+jposz)
                
    wait(500)
            
    end
        end
    end 

  3. #3
    iBot User jose maria's Avatar
    Join Date
    Jan 2014
    Location
    Brazil
    Posts
    85
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    19 Post(s)
    Reputation
    41
    Rep Power
    3
    Quote Originally Posted by pink_panther View Post
    I didnt test it:

    PHP Code:
    local itemID 1234 -- Corpse ID
    local itemRange 
    7

    for 0,itemRange do
        for 
    0,itemRange do
            if 
    toptileitem(posx+iposy+jposz) == itemID then
                reachgrounditem
    (itemID)
                
    wait(500)
                
    useitemon(itemIDposx+iposy+jposz)
                
    wait(500)
            
    end
        end
    end 
    Hello Panther, i try use this script but character go up of corpse and dont work, i add move('n') after reachgrounditem(itemID) but sometimes does not work.
    You can help me? Thanks

  4. #4
    iBot User pink_panther's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    4,075
    Mentioned
    49 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    178 Post(s)
    Reputation
    309
    Rep Power
    10
    that's becase it's wrong.. :S not sure what I was smoking


    Try this
    Lua Code:
    local corpseId = 1234 -- Corpse ID
    local itemId = 1234 -- Item to use
    local itemRange = 7
     
    for i = 0,itemRange do
        for j = 0,itemRange do
            if toptileitem(posx+i, posy+j, posz) == corpseId then
                reachgrounditem(corpseId)
                wait(500)
                useitemon(itemID, posx+i, posy+j, posz)
                wait(500)
            end
        end
    end

  5. #5
    iBot User jose maria's Avatar
    Join Date
    Jan 2014
    Location
    Brazil
    Posts
    85
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    19 Post(s)
    Reputation
    41
    Rep Power
    3
    Quote Originally Posted by pink_panther View Post
    that's becase it's wrong.. :S not sure what I was smoking


    Try this
    Lua Code:
    local corpseId = 1234 -- Corpse ID
    local itemId = 1234 -- Item to use
    local itemRange = 7
     
    for i = 0,itemRange do
        for j = 0,itemRange do
            if toptileitem(posx+i, posy+j, posz) == corpseId then
                reachgrounditem(corpseId)
                wait(500)
                useitemon(itemID, posx+i, posy+j, posz)
                wait(500)
            end
        end
    end
    I fixed this point before, but reachgrounditem put character on corpse, for work i need he go to be side of corpse.
    Thanks :-)

  6. #6
    iBot User walukasz's Avatar
    Join Date
    Feb 2012
    Location
    Poland
    Posts
    312
    Mentioned
    39 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    25 Post(s)
    Reputation
    67
    Rep Power
    5
    well I believe this is bugged, as it checks only 1/4 of the screen, I will post here my skinning action I simplified a bit, you can try it. reachgrounditem does actually reach ground item, it doesn't try to stand on it, although it sometimes does, my script will ignore body that you stand on, so even if you stand on body, cavebot will move you away from that and action will try to reach again. just try to test it
    Lua Code:
    local SKIN_IDS = {4212}
     
    function DistanceFromSelf(POS_X, POS_Y)
    	updateworld()
    	return math.max(math.abs(POS_X - posx), math.abs(POS_Y - posy))
    end
     
    function IsOnScreen(POS_X, POS_Y)
    	updateworld()
    	return math.abs(POS_X - posx) < 8 and math.abs(POS_Y - posy) < 6
    end
     
    function ClosestGroundItem(ITEMS, RANGE)
    	updateworld()
    	local X_RANGE = RANGE or 7
    	local Y_RANGE = RANGE or 5
    	local MIN = 8
    	local BODY = nil
     
    	for i = -X_RANGE, X_RANGE do
    		for j = -Y_RANGE, Y_RANGE do
    			if (i ~= 0 or j ~= 0) and table.find(ITEMS, toptileitem(posx+i, posy+j, posz)) and DistanceFromSelf(posx+i, posy+j) < MIN then
    				BODY = {X = posx + i, Y = posy + j}
    				MIN = DistanceFromSelf(posx+i, posy+j)
    			end
    		end
    	end
    	return BODY
    end
     
    function SkinOne(RANGE)
    	local BODY = ClosestGroundItem(SKIN_IDS, RANGE)
    	if BODY then
    		pausewalking(1000)
    		while DistanceFromSelf(BODY.X, BODY.Y) > 1 and IsOnScreen(BODY.X, BODY.Y) do
    			reachlocation(BODY.X, BODY.Y, posz) wait(100, 150)
    		end
    		useitemon("obsidian knife", BODY.X, BODY.Y, posz) wait(200, 250)
    		pausewalking(0)
    	end         
    end
     
    SkinOne()


    ofc you need to change skin id and that obsidian knife

  7. #7
    iBot User pink_panther's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    4,075
    Mentioned
    49 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    178 Post(s)
    Reputation
    309
    Rep Power
    10
    Quote Originally Posted by walukasz View Post
    well I believe this is bugged, as it checks only 1/4 of the screen, I will post here my skinning action I simplified a bit, you can try it. reachgrounditem does actually reach ground item, it doesn't try to stand on it, although it sometimes does, my script will ignore body that you stand on, so even if you stand on body, cavebot will move you away from that and action will try to reach again. just try to test it
    Lua Code:
    --snip--


    ofc you need to change skin id and that obsidian knife
    Simplified?

    All you need to do to fix my range bug is this:

    Lua Code:
    local corpseId = 1234 -- Corpse ID
    local itemId = 1234 -- Item to use
    local itemRange = 7
     
    for i = -itemRange,itemRange do
        for j = -itemRange,itemRange do
            if toptileitem(posx+i, posy+j, posz) == corpseId then
                reachgrounditem(corpseId)
                wait(500)
                useitemon(itemID, posx+i, posy+j, posz)
                wait(500)
            end
        end
    end


    Furthermore, if what you're trying to do is use a obsidian knife, blessed stake or fishing rod you can just use stake() skin() or fish().
    Lua Code:
    -- [[ Skinner, Staker and Fisher by Pink Panther ]] --
    if maround() == 0 and not lootbodies then 
    	-- Fishing
    	if itemcount("Fishing Rod") >= 1 then
    		fish(5, true)
    	end
    	-- Skinning
    	if itemcount("Obsidian Knife") >= 1 then
    		skin(5, true)
    	end
    	-- Staking
    	if itemcount("Blessed Wooden Stake") >= 1 then
    		stake(5, true)
    	end
    end


    But I hope this isn't what you need, because this will have been a waste of time. lol

  8. #8
    iBot User walukasz's Avatar
    Join Date
    Feb 2012
    Location
    Poland
    Posts
    312
    Mentioned
    39 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    25 Post(s)
    Reputation
    67
    Rep Power
    5
    Well, what I meant is I simplified MY skinning action I made, because the action I made was more complex than this, and I made it because the original skin action was not good enough for me and I added some more to it that you cannot see here cuz I removed it as it's useless in this context. Why would I rewrite what I did if I know this works well. And your action still is not ignoring the sqm you can never use, which is the one you stand on.

  9. #9
    iBot User pink_panther's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    4,075
    Mentioned
    49 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    178 Post(s)
    Reputation
    309
    Rep Power
    10
    Yours will though, so its ok.

    Or the 2nd one i posted if all OP needs is a simple skinner/staker.

  10. #10
    iBot User jose maria's Avatar
    Join Date
    Jan 2014
    Location
    Brazil
    Posts
    85
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    19 Post(s)
    Reputation
    41
    Rep Power
    3
    I don't need this for stake, skin or fish. I want this script to make script of all hive tasks for free

    I will try yours scripts today, thanks for helping

Posting Permissions

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