XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 5 of 5

Thread: Spy down & Anti lure

  1. #1
    grave18's Avatar
    Join Date
    Mar 2014
    Posts
    74
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)

    Question Spy down & Anti lure

    Hello.
    Could someone explain to me how works this script?
    It comes from the library - Official XenoBot Scripts

    I need to get this effect, but I do not know why it is always true...
    lua code:

    elseif (labelName == "AntiLure") then
    local test = targetingGetCreatureThreshold(({'spider', 'poison spider'}), 7, 4, 11, 1) -- floor with spiders = 11
    if test[1] then
    print('true')
    else
    print ('false')
    end

    lua code:

    function targetingGetCreatureThreshold(list, range, amount, multifloor, floor)
    local targets = {}
    local count = 0
    local pos = getSelfPosition()
    for i = CREATURES_LOW, CREATURES_HIGH do
    local name = getCreatureName(i)
    -- Is this creature invited to die?
    if list[string.lower(name)] then
    -- Position & Distance
    local cpos = getCreaturePosition(i)
    local distance = getDistanceBetween(pos, cpos)
    if ((pos.z + (floor or 0)) == cpos.z or multifloor) and distance <= range then
    -- Normal creature checks
    if getCreatureVisible(i) and getCreatureHealthPercent(i) > 0 and isCreatureMonster(i) then
    targets[#targets+1] = getCreatureIDFromIndex(i)
    count = count + 1
    end
    end
    end
    end
    return {count >= amount, targets}
    end

    ss1-na-www.gif--floor 10 ss2-na-www.gif--floor 11

    Please help me with that. Thx
    Last edited by grave18; 12-29-2015 at 01:46 PM.

  2. #2
    grave18's Avatar
    Join Date
    Mar 2014
    Posts
    74
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Refresh.

  3. #3
    grave18's Avatar
    Join Date
    Mar 2014
    Posts
    74
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Refresh.

  4. #4
    XenoBot Scripts Developer Syntax's Avatar
    Join Date
    Feb 2011
    Posts
    1,658
    Mentioned
    431 Post(s)
    Tagged
    4 Thread(s)
    @grave18

    lua code:

    targetingGetCreatureThreshold({
    ["spider"] = true,
    ["poison spider"] = true
    }, 7, 4, false, 1) -- floor with spiders = 11

  5. #5
    grave18's Avatar
    Join Date
    Mar 2014
    Posts
    74
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    @Syntax
    Thank for help ;D It work!
    Last edited by grave18; 12-30-2015 at 11:30 PM.

Posting Permissions

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