Results 1 to 4 of 4

Thread: Full depot alert

  1. #1
    iBot User
    Join Date
    Aug 2012
    Posts
    805
    Mentioned
    18 Post(s)
    Tagged
    2 Thread(s)
    Quoted
    38 Post(s)
    Reputation
    180
    Rep Power
    7

    Full depot alert

    Hello, I need alert of full depot. Ex. if more then 900 items in depot then do something.

    Code:
    16:27 Your depot contains 930 items.
    I just dont know how to return number "930" from this message.

    Thanks for help.

  2. #2
    Normal User mistgun's Avatar
    Join Date
    Nov 2012
    Location
    LDZ
    Posts
    333
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    3 Post(s)
    Reputation
    41
    Rep Power
    5
    I've just made an action that play alarm and disable cavebot if your depot contains 930 items:

    Code:
    local msgs = getnewmessages("Server Log")
    local msg = msgs.count-1
    local message = "Your depot contains 930 items"
    
    for i = 0, msg do
        if msgs[i].text:find(message) or message.type == 18
        then
            wait(500)
            focusclient()
            wait(500)
            playsound("alert.wav")
            wait(1000,2000)
            setcavebot("off")
        end
    end
    LATEST FREE AND PAID SCRIPTS

    Ghostland: EK Coryms Cave: EK
    Peninsula Tomb: EK, MS/ED Mount Sternum: EK
    Dwarf City: EK Nightstalkers Mountain: ED, MS

  3. #3
    iBot User
    Join Date
    Aug 2012
    Posts
    805
    Mentioned
    18 Post(s)
    Tagged
    2 Thread(s)
    Quoted
    38 Post(s)
    Reputation
    180
    Rep Power
    7
    thanks but I knew that option and still doesnt solve problem, Im depositing 30-40 items each depositing so I have to add around 40 messages :P (but ofc it might be a solution)

  4. #4
    iBot User pink_panther's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    4,075
    Mentioned
    49 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    178 Post(s)
    Reputation
    309
    Rep Power
    10
    stand by....


    Edit:
    [deleted]

    Edit 2:

    Ok, so heres what i have:


    PHP Code:
    local maxItems 900

    local msgs 
    getnewmessages("Server Log"
    local msg msgs.count-
    local message 
    "Your depot contains" 

    for 0msg do 
        if 
    msgs[i].text:find(messagethen 
            local currentItemCount 
    string.match(msgs[i].text"%d%d%d"
        if 
    tonumber(currentItemCount) > maxItems then
                playsound
    ("alert.wav")
            
    end
        end 
    end 
    This will only work if you have over 100 items and less than 1000, because it matches a 3 digit number. Otherwise it will print an error saying tried to compare a nil value in the debu log.. but who cares.

    Otherwise it plays an alart, which you can easily change to closetibia()

    If someone wants to expand on it so it matches any number, by all means, do so.
    Last edited by pink_panther; 09-17-2013 at 05:51 AM.

Posting Permissions

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