zahar0401

AI base: Executable

Sep 28th, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 KB | None | 0 0
  1. local minutemancode = "3442" -- Minuteman code for overrides
  2. local chat = peripheral.wrap("top")
  3.  
  4. function input()
  5.  --write("> ")
  6.  --local input = read()
  7.  local _1, _2, input = os.pullEvent("chat")
  8.  for k,v in pairs(dofile("/database")) do
  9.   if string.find(input, k) then
  10.    chat.say("[Blackwhite] "..v)
  11.    if string.find(input, "terminate program") then
  12.     return 0
  13.    end
  14.    break
  15.   end
  16.  end
  17. end
  18.  
  19. function password()
  20.  write("INPUT MINUTEMAN ID: ")
  21.  local input = read("*")
  22.  if input == minutemancode then
  23.   term.setTextColor(colors.lime)
  24.   textutils.slowPrint("Minuteman ID accepted.")
  25.   term.setTextColor(colors.white)
  26.   return true
  27.  else
  28.   printError("Minuteman ID invalid.")
  29.  end
  30. end
  31.  
  32. --if password() then
  33.  sleep(3)
  34.  textutils.slowPrint("BLACKWHITE")
  35.   while true do
  36.    if input() == 0 then
  37.    break
  38.   end
  39.  end
  40. --else
  41. -- while true do
  42. --  coroutine.create(function() while true do coroutine.yield() end end)
  43. --  coroutine.yield()
  44. -- end
  45. --end
Advertisement
Add Comment
Please, Sign In to add comment