Advertisement
artem211

ore_map

Aug 7th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.95 KB | None | 0 0
  1. local hol = require("component").hologram
  2. local geo = require("component").geolyzer
  3. local ore_count = 0
  4. local uran_count = 0
  5. function scanMap()
  6.  for x=-23,24 do
  7.   for z=-23,24 do
  8.    printCollumn(x,z,geo.scan(x,z))
  9.   end
  10.  end
  11. end
  12.  
  13. function printCollumn(x,z,coll)
  14. -- local height = 1
  15.  hol.set(23,32,23, 02)
  16.  for y = 2,32 do
  17.   if coll[y] > 70 and coll[y] <120 then
  18.    uran_count=uran_count+1
  19.    hol.set(x+23,y-1,z+23, 03)
  20.   end
  21.   if coll[y] > 30 and coll[y] < 70 then
  22.   hol.set(x+23,y-1,z+23, 02)
  23.   end
  24. --  print(x,z,coll[y])
  25.   if (coll[y] > 2.0 and coll[y] < 35) then
  26.    ore_count=ore_count+1
  27.    hol.set(x+23,y-1, z+23, 01)
  28.   else
  29.   --hol.set(x+23,y-24, z+23, 03)
  30.   end
  31.  end
  32. end
  33.  
  34. hol.clear()
  35. hol.setTranslation(0,0.3,0)
  36. hol.setScale(1.2)
  37. scanMap()
  38. require("term").clear()
  39. --print("Предположительно(помехи) урановой руды найдено: "..uran_count)
  40. print("Руды найдено: "..ore_count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement