w9s66v09c8x5o1fl3p0

Rifbot Advertising + Yell

Jan 11th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.25 KB | None | 0 0
  1. --[[
  2.     Script Name:        Advertising
  3.     Description:        Advert your message on Trade and Default channel as Yell.
  4.     Author:             Ascer - example
  5. ]]
  6.  
  7. local TRADE = {true, 180, 400}              -- advert on trade true/false, random time: 180-400s
  8. local DEFAULT_YELL = {true, 80, 250}        -- advert on default as yell true/false, random time: 80-250s
  9.  
  10. local MESSAGES = {                          -- messages, could be single or group (if group then random)
  11.     "Sell bps of uh, sd",
  12.     "Buy golden account!"
  13. }
  14.  
  15.  
  16. -- DON'T EDIT BELOW THIS LINE
  17.  
  18. local tradeTime, tradeDelay, yellTime, yellDelay = 0, 0, 0, 0
  19.  
  20. Module.New("Advertising", function ()
  21.     local items = table.count(MESSAGES)
  22.     if TRADE[1] then
  23.         if os.clock() - tradeTime > tradeDelay then
  24.             Self.SayOnChannel(MESSAGES[math.random(1, items)], CHANNEL_ADVERTISING)
  25.             tradeTime = os.clock()
  26.             tradeDelay = math.random(TRADE[2], TRADE[3]) -- divide by 1000 is no need sice os.clock() return seconds
  27.             if DEFAULT_YELL[1] then
  28.                 wait(3000, 7000) -- wait between trade and yell message
  29.             end
  30.         end
  31.     end
  32.     if DEFAULT_YELL[1] then
  33.         if os.clock() - yellTime > yellDelay then
  34.             Self.Yell(MESSAGES[math.random(1, items)])
  35.             yellTime = os.clock()
  36.             yellDelay = math.random(DEFAULT_YELL[2], DEFAULT_YELL[3])
  37.         end
  38.     end    
  39. end)
Add Comment
Please, Sign In to add comment