Nike622000

Uran Umrechner

May 29th, 2016
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.06 KB | None | 0 0
  1. os.loadAPI("ocs/apis/sensor")
  2. sen = sensor.wrap("bottom")
  3. mon = peripheral.wrap("top")
  4.  
  5. while true do
  6.  
  7. uu = 0
  8. mengeore = 0
  9. mengeuran = 0
  10. mengecell = 0
  11. anzeigeore = 0
  12. anzeigeuran = 0
  13. anzeigecell = 0
  14. uugewinn = 0
  15.  
  16. ziele = sen.getTargets()
  17.  
  18. for k,v in pairs(ziele) do
  19.     if v.Name == "Diamond Chest"
  20.     and v.Position.X==0
  21.     and v.Position.Y==1
  22.     and v.Position.Z==-3
  23.     then
  24.     details = sen.getTargetDetails(k)
  25.             for i = 1,108 do
  26.             if details.Slots[i].Name == "Uranium Ore" then
  27.             mengeore = details.Slots[i].Size
  28.             uu = uu + 17*mengeore
  29.             anzeigeore = anzeigeore+mengeore
  30.             end
  31.  
  32.             if details.Slots[i].Name == "Refined Uranium" then
  33.             mengeuran = details.Slots[i].Size
  34.             uu = uu + 17*mengeuran
  35.             anzeigeuran = anzeigeuran+mengeuran
  36.             end
  37.  
  38.             if details.Slots[i].Name == "Uranium Cell" then
  39.             mengecell = details.Slots[i].Size
  40.             uu = uu + 2*mengecell
  41.             anzeigecell = anzeigecell+mengecell
  42.             end
  43.  
  44.  
  45.         end
  46.         end
  47.         end
  48.  
  49.             for k,v in pairs(ziele) do
  50.         if v.Name == "Diamond Chest"
  51.         and v.Position.X==0
  52.         and v.Position.Y==1
  53.         and v.Position.Z==2
  54.         then
  55.         details = sen.getTargetDetails(k)
  56.             for i = 1,108 do
  57.             if details.Slots[i].Name == "UU-Matter" then
  58.             mengeuu = details.Slots[i].Size
  59.             uugewinn = uugewinn + mengeuu
  60.             end
  61.         end
  62.        
  63.         end
  64.         end
  65.             mon.clear()
  66.             mon.setCursorPos(2,2)
  67.             mon.setTextColor(colors.cyan)
  68.             mon.write("Umtauschuebersicht")
  69.             mon.setTextColor(colors.white)
  70.             mon.setCursorPos(2,5)
  71.             mon.setTextColor(colors.lime)
  72.             mon.write("Uranium:")
  73.             mon.setTextColor(colors.white)
  74.             mon.setCursorPos(2,6)
  75.             mon.write("Uranium Ore: "..anzeigeore)
  76.             mon.setCursorPos(2,7)
  77.             mon.write("Refined Uranium: "..anzeigeuran)
  78.             mon.setCursorPos(2,8)
  79.             mon.write("Uranium Cell: "..anzeigecell)
  80.             mon.setCursorPos(2,10)
  81.             mon.setTextColor(colors.pink)
  82.             mon.write("Gewinn:")
  83.             mon.setTextColor(colors.white)
  84.             mon.setCursorPos(2,11)
  85.             mon.write("noch zu erwartender Gewinn: "..uu.." UU")
  86.             mon.setCursorPos(2,12)
  87.             mon.write("bereits ausgezahlter Gewinn: "..uugewinn.." UU")
  88. sleep(3)
  89. end
Advertisement
Add Comment
Please, Sign In to add comment