Advertisement
jaypar

Advanced Chat

Apr 9th, 2016 (edited)
1,379
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Created and Developed by killzoms
  2. --Some Variable
  3. set = {}
  4. line = 220
  5. filte = {}
  6. time = {}
  7. nu = {}
  8.  
  9. updat = http.get("https://pastebin.com/raw/LcprcigA")
  10. upd = updat.readAll()
  11. cu = fs.open("LapChat", "w")
  12. cu.write(upd)
  13. cu.flush()
  14. cu.close()
  15. os.run("LapChat")
  16.  
  17. --Download LapAPI
  18. --  updat = http.get("https://pastebin.com/raw/FM10T2EU")
  19. --  upd = updat.readAll()
  20. --  cu = fs.open("LapAPI", "w")
  21. --  cu.write(upd)
  22. --  cu.flush()
  23. --  cu.close()
  24. --  os.loadAPI("LapAPI")
  25.  
  26. --Run when the chat runs for the first time
  27. --glass, mon, ups = LapAPI.runChatFirstTime()
  28.  
  29. --Function for finding commands
  30. --function run(...)
  31. -- _G.msgArgs = {}
  32. -- v = 1
  33.  --Check messages for spaces and split when found
  34. -- for i in string.gmatch(msg, "%S+") do
  35. --  _G.msgArgs[v] = i
  36. --  v = v + 1
  37. -- end
  38.  --Classic Command Prefix
  39. -- if string.match(arg[1], "/") ~= nil and string.match(arg[1], "./") == nil then
  40. --  return true
  41. -- else
  42. --  return false
  43. -- end
  44. --end
  45.  
  46. --function fade()
  47. --Will finish
  48. --end
  49.  
  50. --Load Addons
  51. --function addons()
  52. -- installedAddons = {}
  53. -- if fs.exists("Chat/InstalledAddons") == true then
  54. --  iAddons = fs.open("Chat/InstalledAddons", "r")
  55. --  installedAddons = textutils.unserialize(iAddons.readAll())
  56. --  for i,v in ipairs(installedAddons) do
  57. --   os.loadAPI("Chat/Addons/"..installedAddons[i])
  58. --   funct = loadstring(installedAddons[i]..".run()")
  59. --   funct()
  60. --  end
  61. --  iAddons.close()
  62. -- end
  63. --end
  64.  
  65. --function color()
  66. --Working on it
  67. --end
  68.  
  69. --If mon present print messages to it
  70. --function monitor()
  71. -- if mon then
  72. --  mon.setCursorPos(1,1)
  73. --  mon.setTextScale(0.75)
  74. --  mon.clear()
  75. --  mon.write(realName.." > "..msg)
  76. -- end
  77. --end
  78.  
  79. --Main function
  80. --function main()
  81. -- while true do
  82. --Reset variables
  83. --  _G.realName = ""
  84. --  _G.facs = ""
  85. --  _G.rank = ""
  86. --  _G.commandUser = nil
  87.  
  88. --Update Chat
  89. --  if ups == true then
  90. --   LapAPI.update("QDGKgTAh", "startup")
  91. --  end
  92.  
  93.  
  94. --Pull events from the Terminal Glasses
  95. --  e, side, _G.user, _G.uuid, _G.msg = os.pullEvent("glasses_chat_command")
  96.  
  97. --Check for Commands
  98. --  _G.isCommand = run(_G.msg)
  99.  
  100. --If Command set user to command User
  101. --  if _G.isCommand then
  102. --  _G.set = {}
  103. --    _G.commandUser = _G.user
  104. --    _G.user = ""
  105. --  end
  106.  
  107. --Initialize addons
  108. --  addons()
  109.  
  110.   --If Factions installed check for Faction commands
  111. --  if Factions then
  112. --   Factions.facCommands(_G.msgArgs, _G.user)
  113. --  end
  114.  
  115.  
  116. --Load Faction name of user
  117. --  if not isCommand then
  118. --   if Factions then
  119. --    _G.facs = Factions.checkFac(_G.user)
  120. --   end
  121. --  end
  122.  
  123. --  LapAPI.clearChat(_G.msgArgs)
  124.  
  125. --    monitor()
  126. --    LapAPI.chatSave(_G.facs, _G.rank, _G.hyph, _G.user, _G.msg, _G.isCommand)
  127. --    if _G.con then
  128. --     glass.addText(2, 230, "Console > ".._G.con, 0xFFFFFF)
  129. --    end
  130.  
  131. --    fade()
  132. --    If a command not detected print multiple lines
  133. --    if not _G.isCommand then
  134. --     glass.clear()
  135. --     LapAPI.chatMultiline()
  136. --    end
  137. --  glass.sync()
  138. -- end
  139. --end
  140.  
  141. --Run Multiple functions at once
  142. --parallel.waitForAll(main, LapAPI.chatConsole, LapAPI.chatSaveToFile, LapAPI.userJoined, LapAPI.userLeft)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement