XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 6 of 6

Thread: Script to logout

  1. #1

    Join Date
    Apr 2014
    Posts
    8
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Script to logout

    Im looking for script that will at hour XX:XX kill all monsters around and logout.

  2. #2
    Zingron's Avatar
    Join Date
    Sep 2013
    Location
    United Kingdom
    Posts
    130
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    lua code:

    --[[ time in 24 hour format, eg, 21:00, 12:30, 04:35 ]]

    local hourTime = 07 -- time in hours (00 to 24)
    local minsTime = 20 -- time in minutes (00 to 60)



    --[[ leave below this alone]]

    function creatureCount()
    local count = 0
    for name, cid in Creature.iMonsters() do
    count = count + 1
    end
    return count
    end

    while true do
    -- get local time
    local logTime = os.date("*t")

    if logTime.hour == hourTime and logTime.min == minsTime then
    -- stop the walker if time is equal to variable time
    Walker.Stop()
    -- wait until there are no creatures on screen..
    while creatureCount() ~= 0 do
    wait(1000)
    end
    -- ..then exit the client
    os.exit()
    end
    wait(5000)
    end



  3. #3
    Senior Member Trykon's Avatar
    Join Date
    Nov 2014
    Location
    UK
    Posts
    952
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Zingron View Post
    lua code:

    --[[ time in 24 hour format, eg, 21:00, 12:30, 04:35 ]]

    local hourTime = 07 -- time in hours (00 to 24)
    local minsTime = 20 -- time in minutes (00 to 60)



    --[[ leave below this alone]]

    function creatureCount()
    local count = 0
    for name, cid in Creature.iMonsters() do
    count = count + 1
    end
    return count
    end

    while true do
    -- get local time
    local logTime = os.date("*t")

    if logTime.hour == hourTime and logTime.min == minsTime then
    -- stop the walker if time is equal to variable time
    Walker.Stop()
    -- wait until there are no creatures on screen..
    while creatureCount() ~= 0 do
    wait(1000)
    end
    -- ..then exit the client
    os.exit()
    end
    wait(5000)
    end


    But char will be left there anyway for some time, cuz of log out lock
    Not sure if it is safe, when i make scripts to exit i let it exit in first reached pz, this way char disapears stright away
    All my full afk scripts are accessible at:
    My thread
    My store
    My project
    Looking for RL Tibia testers - RP and EK scripts for FREE. Link to info.

  4. #4
    Zingron's Avatar
    Join Date
    Sep 2013
    Location
    United Kingdom
    Posts
    130
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    It will still kill any creatures around before it triggers the xlog. XLogging is safe if there are no creatures around that can do waves, as the creatures will not directly target you if you are disconnected.

    @xwicuxx
    I can add Self.isInFight() which will wait for your battle sign to drop (if you want to be sure of your characters safety), but it would result in your character standing there for a while if you are cursed by anything.

  5. #5

    Join Date
    Apr 2014
    Posts
    8
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Yes, please add it, its 100% exact script im looking for.

  6. #6
    Zingron's Avatar
    Join Date
    Sep 2013
    Location
    United Kingdom
    Posts
    130
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    lua code:

    --[[ time in 24 hour format, eg, 21:00, 12:30, 04:35 ]]



    local hourTime = 11 -- time in hours (00 to 24)

    local minsTime = 50 -- time in minutes (00 to 60)







    --[[ leave below this alone]]



    function creatureCount()

    local count = 0

    for name, cid in Creature.iMonsters() do

    count = count + 1

    end

    return count

    end



    while true do

    -- get local time

    local logTime = os.date("*t")



    if logTime.hour == hourTime and logTime.min == minsTime then

    -- stop the walker if time is equal to variable time

    Walker.Stop()

    -- wait until there are no creatures on screen..

    while creatureCount() ~= 0 or Self.isInFight() do

    wait(1000)

    end

    -- ..then exit the client

    os.exit()

    end

    wait(5000)

    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
  •