SHARE
TWEET

Untitled

a guest Aug 22nd, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --code wall making sure that no funny
  2. --business is going on with the tape drive
  3. local run = true
  4. tape = peripheral.find("tape_drive")
  5. if not tape then
  6.   print("ya need a tape fer this eiet")
  7.   run = false
  8. end
  9. if not tape.isReady() and not tape.getLabel() == "Movement_SoundPAC" then
  10.   print("put the correct tape in boy")
  11.   run = false
  12. end
  13. --if run is false, program will not start
  14. if tape and tape.isReady() and tape.getLabel() == "Movement_SoundPAC" then
  15.   tape.seek(-tape.getSize()) --adding "()" to getSize will call the function
  16. end
  17.  
  18. local scene = 1 -- not used yet
  19. local x = 2 --defining
  20. local y = 2 --position variables
  21. local function input()
  22.   local event,key,aux1,aux2 = os.pullEvent()
  23.   if event == "key" then
  24.     if key == "200" or key == "17" and y > 1 then
  25.       y = y - 1
  26.     elseif key == "208" or key == "31" and y < 9 then
  27.       y = y + 1
  28.     elseif key == "203" or key == "30" and x > 1 then
  29.       x = x - 1
  30.     elseif key == "205" or key == "32" and x > 1 then
  31.       x = x + 1
  32.     elseif key == "28" then
  33.       if tape.getState() == "PLAYING" then
  34.         tape.stop()
  35.         tape.seek(-tape.getSize())
  36.       end  
  37.       run = false
  38.     end
  39.   end
  40. end
  41. local l1 = {}
  42. local l2 = {}
  43. local l3 = {}
  44. local l4 = {}
  45. local l5 = {}
  46. local l6 = {}
  47. local l7 = {}
  48. local l8 = {}
  49. local l9 = {}
  50. local l10 = {}
  51. local l11 = {}
  52. -- dont define as local for every change, because it messes up lua
  53. --while run do
  54.   term.clear()
  55.   term.setCursorPos(1,1)
  56.   l1 = {"#","#","#","#","#","#","#","#","#","#","#"}
  57.   l2 = {"#"," "," "," "," "," "," "," "," "," ","#"}
  58.   l3 = {"#"," "," "," "," "," "," "," "," "," ","#"}
  59.   l4 = {"#"," "," "," "," "," "," "," "," "," ","#"}
  60.   l5 = {"#"," "," "," "," "," "," "," "," "," ","#"}
  61.   l6 = {"#"," "," "," "," "," "," "," "," "," ","#"}
  62.   l7 = {"#"," "," "," "," "," "," "," "," "," ","#"}
  63.   l8 = {"#"," "," "," "," "," "," "," "," "," ","#"}
  64.   l9 = {"#"," "," "," "," "," "," "," "," "," ","#"}
  65.   l10 ={"#"," "," "," "," "," "," "," "," "," ","#"}
  66.   l11 ={"#","#","#","#","#","#","#","#","#","#","#"}
  67.   for i,f in pairs(l1)do
  68.     char = 1
  69.     term.write(f)
  70.     term.setCursorPos(i,1)
  71.     char = char + 1
  72.   end
  73.   for i,f in pairs(l2)do
  74.     char = 1
  75.     term.write(f)
  76.     term.setCursorPos(i,2)
  77.     char = char + 1
  78.   end
  79.   for i,f in pairs(l3)do
  80.     char = 1
  81.     term.write(f)
  82.     term.setCursorPos(i,3)
  83.     char = char + 1
  84.   end
  85.   for i,f in pairs(l4)do
  86.     char = 1
  87.     term.write(f)
  88.     term.setCursorPos(i,4)
  89.     char = char + 1
  90.   end
  91.   for i,f in pairs(l5)do
  92.     char = 1
  93.     term.write(f)
  94.     term.setCursorPos(i,5)
  95.     char = char + 1
  96.   end
  97.   for i,f in pairs(l1)do
  98.     char = 1
  99.     term.write(f)
  100.     term.setCursorPos(i,6)
  101.     char = char + 1
  102.   end
  103.   for i,f in pairs(l7)do
  104.     char = 1
  105.     term.write(f)
  106.     term.setCursorPos(i,7)
  107.     char = char + 1
  108.   end
  109.   for i,f in pairs(l8)do
  110.     char = 1
  111.     term.write(f)
  112.     term.setCursorPos(i,8)
  113.     char = char + 1
  114.   end
  115.   for i,f in pairs(l9)do
  116.     char = 1
  117.     term.write(f)
  118.     term.setCursorPos(i,9)
  119.     char = char + 1
  120.   end
  121.   for i,f in pairs(l10)do
  122.     char = 1
  123.     term.write(f)
  124.     term.setCursorPos(i,10)
  125.     char = char + 1
  126.   end
  127.   for i,f in pairs(l11)do
  128.     char = 1
  129.     term.write(f)
  130.     term.setCursorPos(i,11)
  131.     char = char + 1
  132.   end
  133. --end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top