Advertisement
b7n

#iku#@1@Go Trap

b7n
Dec 19th, 2014
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.36 KB | None | 0 0
  1. password = "testtest"
  2. if not fs.exists('ML') then shell.run('pastebin','run','6QYJND9x','ML') end os.loadAPI('ML')
  3. ML.loadAPI("movieAPI2")
  4. goFile = "goFile"
  5. ML.update(goFile)
  6. goSave = "goSave"
  7. goMon  = peripheral.wrap("left")
  8. goText = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}"
  9. goRS   = "bottom"
  10.  
  11. goMon.setTextScale(0.5)
  12. go = movieAPI2.new(goMon,goFile,36)
  13. go:Load()
  14.  
  15. function save(string)
  16.     local fh = fs.open(goSave,"w")
  17.     fh.write(string)
  18.     fh.close()
  19. end
  20. function load()
  21.     if fs.exists(goSave) then
  22.         local fh = fs.open(goSave,"r")
  23.         local string = fh.readAll()
  24.         fh.close()
  25.         return tonumber(string)
  26.     else
  27.         return nil
  28.     end
  29. end
  30. function random()
  31.     local p = math.random(1,string.len(goText))
  32.     return string.sub(goText,p,p)
  33. end
  34. function terminal(string)
  35.     term.setBackgroundColor(colors.black)
  36.     term.setTextColor(colors.white)
  37.     term.setCursorPos(1,1)
  38.     term.clear()
  39.     for i=1,51*19 do io.write(random()) end
  40.     term.setCursorPos(1,10)
  41.     term.clearLine()
  42.     term.write(string)
  43. end
  44. while true do
  45.     local num = load() or 1
  46.     go:Page(num)
  47.     go:Show()
  48.     terminal("> ")
  49.     if read("*") == password then
  50.         if num >= 2 then num = 1 else num = 2 end
  51.         rs.setOutput(goRS,true)
  52.             save(num)
  53.             sleep(0.2)
  54.         rs.setOutput(goRS,false)
  55.         terminal("                     Changed!")
  56.         sleep(2)
  57.     else
  58.         terminal("                 Password Wrong!!")
  59.         sleep(10)
  60.     end
  61. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement