Page 13 of 45 FirstFirst ... 3 11 12 13 14 15 23 ... LastLast
Results 121 to 130 of 447

Thread: API Requests

  1. #121
    Basic Member
    Join Date
    Apr 2016
    Posts
    6
    Quote Originally Posted by DzeeRay View Post
    TY for the update, those new functions and const are really helpful(especially the GetLaneFrontie ,thanks to Platinum_dota2).
    some requests:
    -reworking the GetNearby* functions to gather information around a dummy npc that the bot set its location one time per frame (that way the bot can for example explore the area around a tower befor TPing to it, setting that npc explorer's location to the bot's location will do the default behavior).
    -add GetNearbyDropedItems that return an array of item_name/item_ownerid pairs.
    -as previously requested, a function get owned summons(couriers included) and a way to call summons abilities.
    -add courier:UsedBy() that return the ID of the player using the courier or nil/-1 if its free.
    -add SwapItems(int nSlot1, int nSlot2)(similar to the main API function).
    +1 for SwapItems
    That is a must to fix backpack and other inventory issues.

  2. #122
    Basic Member
    Join Date
    Jun 2013
    Posts
    274
    I'm looking to get a Unit-Scoped function that will return the name of an item in a hero slot. Currently we have the function GetItemInSlot which returns a handle, but there is no simple way of identifying which items are in which slots.

    This function would be used to help make decisions based on what items the hero, or the heroes target has.

    Examples with GetItemName being the temp name of the desired function:

    Code:
    local npcBot = GetBot();
    
    for i = 1, 6 do
        print(npcBot:GetItemName(i));
    end
    
    //// item_ward_observer
    //// item_courier
    //// item_branches
    //// item_branches
    //// item_tango
    //// item_clarity
    Code:
    local npcBot = GetBot();
    local npcTarget = npcBot:GetTarget();
    
    if (npcTarget ~= nil and IsHero(npcTarget))
    then
    
        for i = 1, 6 do
            print(npcTarget:GetItemName(i));
        end
    
    end


    edit: Retracting due to already being available in a slightly more complex manner.
    Last edited by Cornbane; 01-01-2017 at 09:10 AM. Reason: Retracting

  3. #123
    Basic Member
    Join Date
    Dec 2016
    Posts
    32
    Quote Originally Posted by Cornbane View Post
    but there is no simple way of identifying which items are in which slots.
    i think there is: simply item:GetName();(works for abilities too).

  4. #124
    Basic Member
    Join Date
    Jun 2013
    Posts
    274
    Quote Originally Posted by DzeeRay View Post
    i think there is: simply item:GetName();(works for abilities too).
    It's only causing errors or returning nil values for me. Do you have an example that works? There is also GetUnitName for Unit-Scoped handles so it leads me to believe the GetName functions have specific internal coding for the targets in question.
    Last edited by Cornbane; 12-31-2016 at 01:00 PM.

  5. #125
    Basic Member
    Join Date
    Dec 2016
    Posts
    32
    Quote Originally Posted by Cornbane View Post
    Do you have an example that works?
    i wrote a helper function to get a specific item from the inventory:
    Code:
    function GET_ITEM(bot,item_name)
    	local ritem=nil;
        for i = 0, 5, 1 do
            item = bot:GetItemInSlot(i);
    	if(item~=nil) then
            	if(item:GetName() == item_name) then 
                		ritem=item;
            	end
    	end
        end
        return ritem;
    end
    also the slot index is 0 based not 1.

  6. #126
    Basic Member
    Join Date
    Jun 2013
    Posts
    274
    Ah yes, I made a slight error in how I used it. I'm now able to cycle through the bot items, friendly items and opponent items.

    Thanks.

  7. #127
    Basic Member
    Join Date
    Dec 2016
    Posts
    10
    So when is ChrisC going to be back?

  8. #128
    The december 22nd update added the `GetAttackPoint()` function which is very handy. Could we also get a `GetAttackBackswing()` function?

  9. #129
    Basic Member
    Join Date
    Jan 2017
    Posts
    1
    I apologise if this was previously requested, but I didn't see them listed so far.

    1) since Lua doesn't seem to have event handlers, some functions to check/watch variables such as when Roshan is killed or aegis is picked up (and by whom) -- these could also return something other than boolean values (e.g. GetAegisHolder, GetAegisRemainingTime)

    2) get the items currently held (last seen) on an enemy player; get the time since that item was last (seen) used

    3) get the time an enemy player last used (in vision) an ability or ultimate (does IsUsingAbility cover this?)

  10. #130
    Basic Member
    Join Date
    Feb 2015
    Posts
    15
    Hi I have some API requests:
    1/ GetPrimaryAttribute()
    2/ GetAgility()
    3/ GetStrength()
    4/ GetIntellect()
    Thanks

Posting Permissions

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