Results 1 to 5 of 5

Thread: useitem on kill

  1. #1
    Normal User
    Join Date
    Sep 2012
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    3 Post(s)
    Reputation
    10
    Rep Power
    5

    useitem on kill

    Hello, i'm here for ask if someone have an action for use a special item on slug after have kill him ?

    like an action search for where is the slug i kill then reach it and use item on it


    if possible when item use on it change in setup

    use = false to use = true


    i've think about:

    Code:
    reachgrounditem(12533)
    wait(2000)
    useitemon(17670, posx, posy, posz)
    wait(1000)
    but don't work

    for change the setup i've think need a getsetting but i don't know how to use it

    thank for your help
    Last edited by kilirt@yahoo.fr; 07-27-2014 at 02:46 PM.

  2. #2
    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 need this and @walukasz help me! See here:
    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:
    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

  3. #3
    Normal User
    Join Date
    Sep 2012
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    3 Post(s)
    Reputation
    10
    Rep Power
    5
    thanks it great do you know how can i change the setup like

    item_use= false to item_use = true for check if i can leave of the cave

  4. #4
    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 kilirt@yahoo.fr View Post
    thanks it great do you know how can i change the setup like

    item_use= false to item_use = true for check if i can leave of the cave
    When you using this item you get new product or have update message?

  5. #5
    Normal User
    Join Date
    Sep 2012
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    3 Post(s)
    Reputation
    10
    Rep Power
    5
    Quote Originally Posted by jose maria View Post
    When you using this item you get new product or have update message?
    thank but i've found how to do it work, when i use item the item change his id so i do if itemcount(xxx) < 1 then ...

Posting Permissions

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