SHARE
TWEET

sort

a guest Jan 21st, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function printList()
  2.     printer = peripheral.wrap("right")
  3.     print("Printed!")
  4.     peripheral.wrap("right")
  5.     printer.newPage()
  6.     printer.setCursorPos(1,1)
  7.     printer.write("EXCAVATION LOG")
  8.     printer.setCursorPos(1,2)
  9.     printer.write("Cobblestone:"..cbble)
  10.     printer.setCursorPos(1,3)
  11.     printer.write("Osmium:"..osmium)
  12.     printer.setCursorPos(1,4)
  13.     printer.write("Uranium:"..uran)
  14.     printer.setCursorPos(1,5)
  15.     printer.write("Lead:"..lead)
  16.     printer.setCursorPos(1,6)
  17.     printer.write("Gold:"..gold)
  18.     printer.setCursorPos(1,7)
  19.     printer.write("Silver"..silver)
  20.     printer.setCursorPos(1,8)
  21.     printer.write("Iron:"..iron)
  22.     printer.setCursorPos(1,9)
  23.     printer.write("Aluminum"..alum)
  24.     printer.setCursorPos(1,10)
  25.     printer.write("Nickel:"..nickel)
  26.     printer.setCursorPos(1,11)
  27.     printer.write("Coal:"..coal)
  28.     printer.setCursorPos(1,12)
  29.     printer.write("Other/Nothing:"..other)
  30.     printer.endPage()
  31.     exit()
  32. end
  33. function sort() turtle.drop(1) end
  34. other = 0
  35. cbble = 0
  36. tin = 0
  37. copper = 0
  38. osmium = 0
  39. uran = 0
  40. lead = 0
  41. coal = 0
  42. gold = 0
  43. silver = 0
  44. iron = 0
  45. alum = 0
  46. nickel = 0
  47. print("Starting in 3 Seconds...")
  48. sleep(3)
  49. peripheral.wrap("right")
  50. while true do
  51.     if  rs.getInput("left") == true then
  52.         printList()
  53.     end
  54.     function list()
  55.         term.clear()
  56.         term.setCursorPos(1,1)
  57.         print("Cobble:" ..cbble)
  58.         print("Tin:" ..tin)
  59.         print("Copper:" ..copper)
  60.         print("Osmium:" ..osmium)
  61.         print("Uranium:".. uran)
  62.         print("Lead:" ..lead)
  63.         print("Gold:" ..gold)
  64.         print("Silver:" ..silver)
  65.         print("Iron:" ..iron)
  66.         print("Aluminum:" ..alum)
  67.         term.setCursorPos(20,1)
  68.         write("Nickel:"..nickel)
  69.         term.setCursorPos(20,2)
  70.         write("Coal:"..coal)
  71.         term.setCursorPos(20,3)
  72.         write("Other/Nothing:"..other)
  73.     end
  74.         if turtle.compareTo(16) == true then
  75.             cbble = cbble + 1
  76.             sort()
  77.         elseif turtle.compareTo(15) == true then tin = tin + 1
  78.             sort()
  79.         elseif turtle.compareTo(14) == true then copper = copper + 1
  80.             sort()
  81.         elseif turtle.compareTo(13) == true then osmium = osmium + 1
  82.             sort()
  83.         elseif turtle.compareTo(12) == true then uran = uran + 1    
  84.             sort()
  85.         elseif turtle.compareTo(11) == true then tin = tin + 1
  86.             sort()
  87.         elseif turtle.compareTo(10) == true then coal = coal + 1
  88.             sort()
  89.         elseif turtle.compareTo(9) == true then lead = leaed + 1
  90.             sort()
  91.         elseif turtle.compareTo(8) == true then gold = gold + 1
  92.             sort()
  93.         elseif turtle.compareTo(7) == true then silver = silver + 1
  94.             sort()
  95.         elseif turtle.compareTo(6) == true then tin = tin + 1
  96.             sort()
  97.         elseif turtle.compareTo(5) == true then iron = iron + 1
  98.             sort()
  99.         elseif turtle.compareTo(4) == true then alum = alum + 1
  100.             sort()
  101.         elseif turtle.compareTo(3) == true then nickel = nickel + 1
  102.             sort()
  103.         elseif turtle.compareTo(2) == true then copper = copper + 1
  104.             sort()
  105.         else other = other + 1
  106.             sort()
  107.         end
  108.         list()
  109. 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