Advertisement
w9s66v09c8x5o1fl3p0

Rifbot VIP Logout + Relogin

Jan 11th, 2019
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.19 KB | None | 0 0
  1. --[[
  2.     Script Name:        VIP Logout
  3.     Description:        Logout when specific players are online
  4.     Author:             Ascer - example
  5. ]]
  6.  
  7. local VIP_LIST = {"enemy1", "enemy2"}    -- enter players here separated with comma
  8. local RELOGIN = {              
  9.     enabled = true,              -- relogin true/false
  10.     delay = 6                   -- relogin after X minutes
  11. }
  12.  
  13. -- DON'T EDIT BELOW THIS LINE
  14.  
  15. local stime, reconnect = 0, false
  16.  
  17. Module.New("VIP Logout", function ()
  18.     if Self.isConnected() then
  19.         if VIP.isOnline(VIP_LIST) then
  20.             Self.Logout()
  21.             stime = os.clock()
  22.             reconnect = true
  23.         end
  24.     else
  25.         if RELOGIN.enabled then
  26.             if reconnect then
  27.                 printf("Successfully logout due a VIP online. Relogin for " .. math.floor((RELOGIN.delay * 60) - (os.clock() - stime)) .. "s." )
  28.                 wait(800, 1200)
  29.                 if os.clock() - stime > (60 * RELOGIN.delay) then
  30.                     Rifbot.PressKey(13)  -- press enter key
  31.                 end
  32.             else
  33.                Rifbot.PressKey(13)
  34.                wait(800, 1200)
  35.             end        
  36.         end
  37.     end                    
  38. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement