Advertisement
Guest User

logChat

a guest
Jan 27th, 2015
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.37 KB | None | 0 0
  1. Jarvis = "off"
  2. chatbox = peripheral.wrap("right")
  3. screen = peripheral.wrap("left")
  4. rColor = 0
  5. screen.setTextScale(1)
  6. screen.clear()
  7. screen.setCursorPos(1,1)
  8. rednet.open("top")
  9. a = fs.list("/LOGS")
  10. FILE = #a
  11. modem = peripheral.wrap("top")
  12. modem.open(314)
  13. term.redirect(screen)
  14. chatbox.say("Jarvis: Chat is now being Recorded.")
  15. print("---------------------------------CHAT----------------------------------")
  16. while true do
  17. event, player, message,d,e,f,g = os.pullEvent()
  18. if event == "chat" then
  19. term.setTextColor(512)
  20. if player == "leperchuan97" or  player == "AmericanTradegy_" or player=="thomas09" or player=="Vexillum_" or player=="ChipWee" or player=="bombitmanbomb" then
  21. term.setTextColor(32768)
  22. term.setBackgroundColor(32)
  23.  
  24. end
  25. if player=="bombitmanbomb" or player=="AmericanTradegy_" then
  26. CMD = string.lower(message)
  27. if CMD=="!jarvis on" or CMD=="jarvis turn on" or CMD=="jarvis boot up" then
  28. chatbox.say("Jarvis: Booting Up.")
  29. sleep(2)
  30. chatbox.say('Jarvis: Welcome back "'..player..'"')
  31. Jarvis = "on"
  32. end
  33. if Jarvis == "on" then
  34.   if CMD=="!jarvis time" or CMD=="jarvis what time is it" or CMD=="jarvis time" or CMD =="jarvis what is the time" then
  35.   a = os.time()
  36.   chatbox.say("Jarvis: the time is currently "..a)
  37.   end
  38.   if CMD=="jarvis turn off" or CMD == "jarvis power down" or CMD == "!jarvis off" then
  39.   Jarvis = "off"
  40.   chatbox.say("Jarvis: Powering Down.")
  41.   end
  42.   if CMD=="jarvis reset chat" or CMD=="jarvis reset log" or CMD=="jarvis clear chat" or CMD=="!jarvis log clear" then
  43.   term.setBackgroundColor(32768)
  44.   shell.run("clear")
  45.   chatbox.say("Jarvis: Chat Log has been cleared!")
  46.   end
  47.   if CMD=="jarvis list commands" or CMD=="!jarvis commands" then
  48.   chatbox.say("Jarvis: Commands Availible are 'Time','off','Log Clear','Commands','off'")
  49.   end
  50.   if CMD=="jarvis disable ore proccessing" or CMD=="!jarvis ore off" then
  51.   chatbox.say("Jarvis: Ore Proccessing Disabled.")
  52.   rColor = colors.combine(rColor,colors.white)
  53.   rs.setBundledOutput("bottom",rColor)
  54.   end
  55.   if CMD == "jarvis enable ore proccessing" or CMD=="!jarvis ore on" then
  56.   chatbox.say("Jarvis: Ore Proccessing Enabled.")
  57.   rColor = colors.subtract(rColor,colors.white)
  58.   rs.setBundledOutput("bottom",rColor)
  59.   end
  60. end
  61. end
  62.  
  63.  
  64. if player == "TheColenater" or player == "drsmiles88"
  65. then
  66. term.setTextColor(1)
  67. term.setBackgroundColor(16384)
  68. end
  69. if player == "The_Implant" or player=="b1b1b11" then
  70. term.setTextColor(2048)
  71. end
  72. if player == "Grox18" then
  73. term.setTextColor(16384)
  74. write("[ADMIN]")
  75. end
  76. if player == "KnightTemplar24" or player=="tjborrelli" then
  77. term.setTextColor(1024)
  78. write("[HELPER]")
  79. term.setTextColor(2)
  80. end
  81. if player=="DeSNinja" then
  82. term.setTextColor(32)
  83. write("[Merd]")
  84. term.setTextColor(1024)
  85. end
  86. if player=="RandomS9S9"then
  87. term.setTextColor(8)
  88. write("[???]")
  89. end
  90. write(player)
  91. term.setTextColor(1)
  92. write(":")
  93. term.setTextColor(1)
  94. write(message)
  95. term.setBackgroundColor(32768)
  96. print(" ")
  97. time = os.time()
  98. day = os.day()
  99. tA = file.readLines("chat1.log")
  100. if #tA >=500 then
  101. FILE=FILE+1
  102. end
  103. chat = fs.open("chat1.log","a")
  104. chat.writeLine("<"..day..":"..time..">"..player..":"..message)
  105. chat.close()
  106. end
  107. if event == "modem_message" then
  108. tChat = file.readLines("chat1.log")
  109. print(textutils.serialize(a))
  110. tResults = file.Search(tChat,e)
  111. forsend = textutils.serialize(tResults)
  112. print(forsend)
  113. modem.transmit(d,314,forsend)
  114. end
  115.  
  116.  
  117.  
  118.  
  119. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement