Advertisement
Guest User

acidlaynoob

a guest
Sep 16th, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.49 KB | None | 0 0
  1. local LastMessage = os.time()  --  this only runs once, it sets the LastMessage variable to the time
  2. local MessageDelay = 2       -- your bot will only respond to a message every x seconds
  3. local AdvertisementTimer = 35
  4. LastAdvertisement = os.time()
  5.  
  6. -- Advertising, messagedelay means if player sends 2 messages within 1 sec you will answer only 1, it will send each message every 2 second
  7. -- it will not reply to player when it's ready to advertise within 35 secs, after it did it will start again
  8. Module.New('Advertisement', function(Mod)
  9.     if (os.time()-LastAdvertisement)>AdvertisementTimer then
  10.         Self.Say('Hello! If you want to purchase any available AFK scripts, then ask me in local chat or private message for "help" or "info"!')
  11.         LastAdvertisement = os.time()
  12.     end
  13. end)
  14.  
  15. -- localspeechs are local messages
  16. LocalSpeechProxy.OnReceive("DanceStatus", function(proxy, mtype, speaker, level, text)
  17.     if (os.time()-LastMessage)>MessageDelay then
  18. --  lower text are if player writes like "iNfO" it will understand, doesnt matter its uppercase or lower
  19.         lowertext = string.lower(text)
  20.         if text == 'info' then
  21.             Self.PrivateMessage(speaker, 'Hey '..speaker..', you can write following words through pm or local chat to get answer from your questions: "about", "why", "rashid", "fury gate", "level", "rules", "addons", "mounts", "frags", "exp share" or "bye".')
  22.             -- last messages means that when player sends a lot of messages, it will see the LAST one and reply to that one if it's added somewhere
  23.             LastMessage = os.time()
  24.         elseif text == 'help' then
  25.             Self.PrivateMessage(speaker, 'Oh, it seems to look like a player needs my answers, use following words in pm or local chat to get answer: "about", "why", "rashid", "fury gate", "level", "rules", "addons", "mounts", "frags", "exp share" or "bye".')
  26.             LastMessage = os.time()
  27.         elseif text == 'hi' then
  28.             Self.PrivateMessage(speaker, 'Hey '..speaker..', are you trying to talk to me?!')
  29.             LastMessage = os.time()
  30.             -- speaker is only x player written down which says text and it will follow that order, other people can't except speaker with name
  31.             -- if it's only speaker, it means all players, if speaker == 'name' then only Name can
  32.         elseif speaker == 'Dyablo' and text == 'yell' then
  33.             Self.Yell('Hello! If you want to get any answer from following words, write them to me by PRIVATE MESSAGE: "about", "why", "rashid", "fury gate", "level", "rules", "addons", "mounts", "frags", "exp share" or "bye".')
  34.             end
  35.     end
  36. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement