Guest User

Untitled

a guest
Apr 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. function shockwaveTimer(primary, minutes_left)
  2.     local key = primary and "primary" or "secondary"
  3.     --Configurable alert intervals, key = current time, value = next alert
  4.     local next_intervals = {}
  5.     next_intervals[60] = 5
  6.     next_intervals[5] = 3
  7.     next_intervals[3] = 1
  8.  
  9.     send("shipt " .. key:title() .. " shockwave timer expires in " .. minutes_left .. " " .. (minutes_left == 1 and "MINUTE!" or "MINUTES."))
  10.    
  11.    
  12.     if bwl.shockwaveTimers[key] then
  13.         bwl.shockwaveTimers[key] = nil
  14.     end
  15.  
  16.     if next_intervals[minutes_left] then
  17.         bwl.shockwaveTimers[key] = tempTimer((minutes_left - next_intervals[minutes_left])*60, [[shockwaveTimer(]] .. (primary and "true" or "false") .. [[, ]] .. next_intervals[minutes_left].. [[)]])
  18.     end
  19. end
Add Comment
Please, Sign In to add comment