Results 1 to 5 of 5

Thread: Pausebot and log off if X player logs in

  1. #1
    Normal User
    Join Date
    Dec 2012
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    11
    Rep Power
    5

    Pausebot and log off if X player logs in

    Basically i need an action that will kill all monsters around me, cast exana flam and logs off if X players logs in(cant close tibia cause character might die)
    Last edited by Eli; 12-28-2013 at 10:57 PM.

  2. #2
    zami84's Avatar
    Join Date
    May 2012
    Posts
    316
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    1 Post(s)
    Reputation
    48
    Rep Power
    5
    Quote Originally Posted by soder View Post
    Not possible but:

    Code:
    local PLAYER_NAMES = {"PLAYER_NAME1", "PLAYER NAME2"}
    
    local CHANNEL_MESSAGES = getnewmessages("Server Log")
    local CHANNEL_MESSAGES_COUNT = CHANNEL_MESSAGES.count - 1
    
    for INDEX = 0, CHANNEL_MESSAGES_COUNT do
        if (CHANNEL_MESSAGES[CHANNEL_MESSAGES_COUNT - INDEX].type == 18) then
            if (table.find(PLAYER_NAMES, string.match(string.sub(CHANNEL_MESSAGES[CHANNEL_MESSAGES_COUNT - INDEX].text, 7), "(.+) has logged in."))) then
                for _ = 1, 4 do
                    playsound("alert.wav") wait(1000, 1500)
                end
            end
        end 
    end
    This will alert when a player on your vip login (you must set "Notify at login" on the player)

    Credits to Sirmate.

    SO:
    Lua Code:
    local PLAYER_NAMES = {"PLAYER_NAME1", "PLAYER NAME2"}
     
    local CHANNEL_MESSAGES = getnewmessages("Server Log")
    local CHANNEL_MESSAGES_COUNT = CHANNEL_MESSAGES.count - 1
     
    for INDEX = 0, CHANNEL_MESSAGES_COUNT do
        if (CHANNEL_MESSAGES[CHANNEL_MESSAGES_COUNT - INDEX].type == 18) then
            if (table.find(PLAYER_NAMES, string.match(string.sub(CHANNEL_MESSAGES[CHANNEL_MESSAGES_COUNT - INDEX].text, 7), "(.+) has logged in."))) then
                for _ = 1, 4 do
                    if maround(5) == 0 then
    setcavebot("no")
    wait(300000)
    logout()
    end
                end
            end
        end 
    end

  3. #3
    Normal User
    Join Date
    Dec 2012
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    11
    Rep Power
    5
    yes perfect, thank you!

  4. #4
    zami84's Avatar
    Join Date
    May 2012
    Posts
    316
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    1 Post(s)
    Reputation
    48
    Rep Power
    5
    i not tested thise. so use with caution

  5. #5
    iScripter Eli's Avatar
    Join Date
    Mar 2012
    Posts
    3,764
    Mentioned
    492 Post(s)
    Tagged
    2 Thread(s)
    Quoted
    956 Post(s)
    Reputation
    586
    Rep Power
    10
    Problem solved, thread closed.

Posting Permissions

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