XenoBot Forums - Powered by vBulletin

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Loot = Sound

  1. #1
    Elizabeth's Avatar
    Join Date
    Mar 2016
    Location
    Poland
    Posts
    72
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)

    Loot = Sound

    Hey, i need two scripts:

    - When i looting items like "Royal Helmet and "Shard" my bot play alarm.

    - When my character stand 40 sec walker.goto label "stay"
    Last edited by Elizabeth; 03-29-2016 at 01:19 AM.

  2. #2

    Join Date
    Jan 2014
    Posts
    183
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Elizabeth View Post
    Hey, i need two scripts:

    - When i looting items like "Royal Helmet and "Shard" my bot play alarm.

    - When my character stand 40 sec walker.goto label "stay"
    i could do it tomorrow if noone will help you

  3. #3
    Elizabeth's Avatar
    Join Date
    Mar 2016
    Location
    Poland
    Posts
    72
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kamilqq View Post
    i could do it tomorrow if noone will help you
    Ok, i wait

  4. #4
    Lifetime Subscriber
    Join Date
    Aug 2012
    Location
    Stockholm, Sweden
    Posts
    428
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    lua code:

    items = {
    {item = "royal helmet", count = 1},
    {item = "shard", count = 10}
    }
    Module.New("loot alerter", function(mod)
    for item, count in pairs(items) do
    if (Self.ItemCount(items.item) >= items.count) then
    alert()
    mod:Delay(5000)
    end
    end
    end)


    Not tested Been working all day with tables might aswell do this
    Last edited by krille09; 03-29-2016 at 03:24 AM.
    Belden's Free Scripts
    Belden's Quest Scripts

    Bought Lifetime Subscription from Fractal
    Bought TeamSpeak 3 Service from Sikkness
    Bought Leveling Service from Y2Quakepc2

  5. #5
    Senior Member Jontor's Avatar
    Join Date
    Sep 2014
    Posts
    446
    Mentioned
    51 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by krille09 View Post
    lua code:

    items = {
    {item = "royal helmet", count = 1},
    {item = "shard", count = 10}
    }
    Module.New("loot alerter", function(mod)
    for item, count in pairs(items) do
    if (Self.ItemCount(items.item) >= items.count) then
    alert()
    mod:Delay(5000)
    end
    end
    end)


    Not tested Been working all day with tables might aswell do this
    Your 'for item, count in pairs(items) do' actually returns the index and table, so you'd need another loop or changing the table layout to something like this
    Code:
    items = {
        ["royal helmet"] = 1,
        ["shard"] = 10
    }
    Anyways, I'd do both like:
    Code:
    -- alarmDelay is in seconds
    local loot = {
        {name = "royal helmet", count = 1, alarmDelay = 10},
        {name = "shard", count = 10, alarmDelay = 60}
    }
    
    Module.New("countLoot", function(mod)
        for i = 1, #loot do
            if (Self.ItemCount(loot[i].name) >= loot[i].count) then
                alert()
                mod:Delay(loot[i].alarmDelay * 1000)
            end
        end
    end)
    
    
    local positions = {}
    
    Module.New("posChecker", function(mod)
        table.insert(positions, {pos = Self.Position(), time = os.time()})
        local _pos = Self.Position()
    
        for i = 1, #positions do
            if (os.difftime(os.time(), positions[i].time) >= 45) then
                if (positions[i].pos.x == _pos.x and positions[i].pos.y == _pos.y and positions[i].pos.z == _pos.z) then
                    alert()
                    Walker.Goto("stay")
                    positions = {}
                    break
                else
                    table.remove(positions, i)
                    break
                end
            end
        end
    
        mod:Delay(5000)
    end)

  6. #6
    Moderator shadowart's Avatar
    Join Date
    Dec 2014
    Location
    Sweden
    Posts
    1,985
    Mentioned
    225 Post(s)
    Tagged
    3 Thread(s)
    I don't see why you're involving some arbitrary count in the loot checker. I'd use a LootMessageProxy to alarm when it drops instead. Can't code from this device though.

  7. #7

    Join Date
    Jan 2014
    Posts
    183
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Why you guys doin it by counting items?
    Just use LootProxy to receive message of item needed.
    Also Jontor come my thread and answer + teach me to code.

    EDIT:
    I see im synchronized with shadowart

  8. #8
    Senior Member Jontor's Avatar
    Join Date
    Sep 2014
    Posts
    446
    Mentioned
    51 Post(s)
    Tagged
    1 Thread(s)
    Thing is that @Elizabeth mentioned 'shard' as an item to play an alert. but I assume it's not like you want to hear this annoying alarm everytime you loot a 2k gold worth item

  9. #9
    Elizabeth's Avatar
    Join Date
    Mar 2016
    Location
    Poland
    Posts
    72
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jontor View Post
    Your 'for item, count in pairs(items) do' actually returns the index and table, so you'd need another loop or changing the table layout to something like this
    Code:
    items = {
        ["royal helmet"] = 1,
        ["shard"] = 10
    }
    Anyways, I'd do both like:
    Code:
    -- alarmDelay is in seconds
    local loot = {
        {name = "royal helmet", count = 1, alarmDelay = 10},
        {name = "shard", count = 10, alarmDelay = 60}
    }
    
    Module.New("countLoot", function(mod)
        for i = 1, #loot do
            if (Self.ItemCount(loot[i].name) >= loot[i].count) then
                alert()
                mod:Delay(loot[i].alarmDelay * 1000)
            end
        end
    end)
    
    
    local positions = {}
    
    Module.New("posChecker", function(mod)
        table.insert(positions, {pos = Self.Position(), time = os.time()})
        local _pos = Self.Position()
    
        for i = 1, #positions do
            if (os.difftime(os.time(), positions[i].time) >= 45) then
                if (positions[i].pos.x == _pos.x and positions[i].pos.y == _pos.y and positions[i].pos.z == _pos.z) then
                    alert()
                    Walker.Goto("stay")
                    positions = {}
                    break
                else
                    table.remove(positions, i)
                    break
                end
            end
        end
    
        mod:Delay(5000)
    end)
    Thx for efforts, but this is not work
    I write about script loot - alert.
    The script plays a sound every 10 seconds non stop, even when i dont looted.



    Quote Originally Posted by Jontor View Post
    Thing is that @Elizabeth mentioned 'shard' as an item to play an alert. but I assume it's not like you want to hear this annoying alarm everytime you loot a 2k gold worth item
    No, i changed this scary alarm for other xd
    I want, that script play alarm always when i droped "shard" or "royal helmet"
    This is possible?

  10. #10
    Senior Member Jontor's Avatar
    Join Date
    Sep 2014
    Posts
    446
    Mentioned
    51 Post(s)
    Tagged
    1 Thread(s)
    @Elizabeth
    This one should alert on every item drop
    Code:
    local items = {"royal helmet", "shard"}
    
    LootMessageProxy.OnReceive("", function(proxy, message)
        if (table.find(items, string.lower(message)) then
            alert()
        end
    end)

Posting Permissions

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