XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 5 of 5

Thread: Quick scripting question

  1. #1
    dekodertronic's Avatar
    Join Date
    Mar 2014
    Location
    Mass, USA
    Posts
    100
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Question Quick scripting question

    Hey fellas, I'm trying to set up a script to equip a energy ring once a certain amount of creatures are on the screen.

    I noticed the following code given by another user on a thread:

    RingCreature-Equip = 3 ; How many creatures at which you will equip the ring? (0 to disable)

    My question is, where do i write this is? Thank you for the help in advance!

  2. #2
    Senior Member xux's Avatar
    Join Date
    Apr 2013
    Posts
    713
    Mentioned
    33 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dekodertronic View Post
    Hey fellas, I'm trying to set up a script to equip a energy ring once a certain amount of creatures are on the screen.

    I noticed the following code given by another user on a thread:

    RingCreature-Equip = 3 ; How many creatures at which you will equip the ring? (0 to disable)

    My question is, where do i write this is? Thank you for the help in advance!
    This is only setting up a variable, so on top would be most logical.

    Need a private build script? PM me.

  3. #3
    Super Moderator Infernal Bolt's Avatar
    Join Date
    Dec 2011
    Location
    Skellefteċ, Sweden
    Posts
    2,880
    Mentioned
    217 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by dekodertronic View Post
    Hey fellas, I'm trying to set up a script to equip a energy ring once a certain amount of creatures are on the screen.

    I noticed the following code given by another user on a thread:

    RingCreature-Equip = 3 ; How many creatures at which you will equip the ring? (0 to disable)

    My question is, where do i write this is? Thank you for the help in advance!
    You'd also need the rest of the script and not just the variable.

  4. #4

    Join Date
    Feb 2014
    Posts
    117
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    lua code:
    local RingID = 3051     --3051 energy ring
    local amount = 3 -- monster amount to put ring on
    local range = 6 -- range to consider when looking for monster on screen (NO MORE THAN 7!)
    local monsterList = -- separate monsters with comma
    {
    'Crystal Spider'
    }


    --Dont edit below unless u know what ure doing
    function getMonsterCount()
    local count = 0
    for k, v in ipairs(Self.GetTargets(range)) do
    if table.find(monsterList, v:Name()) then
    count = count + 1
    end
    end
    return count
    end

    function ring()
    if getMonsterCount() >= amount and Self.Ring().id ~= getActiveRingID(RingID) and Self.ItemCount(RingID) >= 1 then
    Self.Equip(RingID, "ring")
    wait(200,400)
    if Self.Ring().id == getActiveRingID(RingID) then
    wait(2000,3000) -- just so it doesnt remove it imidiately ( more human like? )
    end

    elseif getMonsterCount() < amount and Self.Ring().id == getActiveRingID(RingID) then
    Self.Dequip("ring")
    end
    end

    Module('energyRing', function(ManaShield)
    ring()
    ManaShield:Delay(200 * math.random(1,3))
    end)

  5. #5
    dekodertronic's Avatar
    Join Date
    Mar 2014
    Location
    Mass, USA
    Posts
    100
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by slaweksor View Post
    lua code:
    local RingID = 3051     --3051 energy ring
    local amount = 3 -- monster amount to put ring on
    local range = 6 -- range to consider when looking for monster on screen (NO MORE THAN 7!)
    local monsterList = -- separate monsters with comma
    {
    'Crystal Spider'
    }


    --Dont edit below unless u know what ure doing
    function getMonsterCount()
    local count = 0
    for k, v in ipairs(Self.GetTargets(range)) do
    if table.find(monsterList, v:Name()) then
    count = count + 1
    end
    end
    return count
    end

    function ring()
    if getMonsterCount() >= amount and Self.Ring().id ~= getActiveRingID(RingID) and Self.ItemCount(RingID) >= 1 then
    Self.Equip(RingID, "ring")
    wait(200,400)
    if Self.Ring().id == getActiveRingID(RingID) then
    wait(2000,3000) -- just so it doesnt remove it imidiately ( more human like? )
    end

    elseif getMonsterCount() < amount and Self.Ring().id == getActiveRingID(RingID) then
    Self.Dequip("ring")
    end
    end

    Module('energyRing', function(ManaShield)
    ring()
    ManaShield:Delay(200 * math.random(1,3))
    end)
    thank you sooooooooooooo much ))

Posting Permissions

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