tuekats

configureRoundabout

Jun 1st, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local place = ...
  2.  
  3. print("-----------------VERSION-12-------------------")
  4.  
  5. local hopperTable = { {"replaceitem block ~12 ~4 ~4 ","golden_rail ",true,"north"},
  6.                       {"replaceitem block ~10 ~4 ~4 ","golden_rail ",false,"north"},   
  7.                       {"replaceitem block ~10 ~3 ~4 ","golden_rail ",false,"north"},   
  8.                       {"replaceitem block ~12 ~3 ~4 ","golden_rail ",false,"north"},
  9.                       {"replaceitem block ~9 ~4 ~0 ","activator_rail ",false,"north_reset"},   
  10.                       {"replaceitem block ~9 ~4 ~2 ","activator_rail ",true,"north_reset"},
  11.                       {"replaceitem block ~9 ~3 ~0 ","activator_rail ",false,"north_reset"},
  12.                       {"replaceitem block ~9 ~3 ~2 ","activator_rail ",false,"north_reset"},
  13.                       {"replaceitem block ~11 ~4 ~10 ","golden_rail ",false,"east"},
  14.                       {"replaceitem block ~11 ~4 ~12 ","golden_rail ",true,"east"},
  15.                       {"replaceitem block ~11 ~3 ~10 ","golden_rail ",false,"east"},
  16.                       {"replaceitem block ~11 ~3 ~12 ","golden_rail ",false,"east"},
  17.                       {"replaceitem block ~13 ~4 ~9 ","activator_rail ",true,"east_reset"},
  18.                       {"replaceitem block ~15 ~4 ~9 ","activator_rail ",false,"east_reset"},
  19.                       {"replaceitem block ~13 ~3 ~9 ","activator_rail ",false,"east_reset"},
  20.                       {"replaceitem block ~15 ~3 ~9 ","activator_rail ",false,"east_reset"},
  21.                       {"replaceitem block ~3 ~4 ~11 ","golden_rail ",true,"south"},
  22.                       {"replaceitem block ~5 ~4 ~11 ","golden_rail ",false,"south"},
  23.                       {"replaceitem block ~3 ~3 ~11 ","golden_rail ",false,"south"},
  24.                       {"replaceitem block ~5 ~3 ~11 ","golden_rail ",false,"south"},
  25.                       {"replaceitem block ~6 ~4 ~13 ","activator_rail ",true,"south_reset"},
  26.                       {"replaceitem block ~6 ~4 ~15 ","activator_rail ",false,"south_reset"},
  27.                       {"replaceitem block ~6 ~3 ~13 ","activator_rail ",false,"south_reset"},
  28.                       {"replaceitem block ~6 ~3 ~15 ","activator_rail ",false,"south_reset"},
  29.                       {"replaceitem block ~4 ~4 ~3 ","golden_rail ",true,"west"},
  30.                       {"replaceitem block ~4 ~4 ~5 ","golden_rail ",false,"west"},
  31.                       {"replaceitem block ~4 ~3 ~3 ","golden_rail ",false,"west"},
  32.                       {"replaceitem block ~4 ~3 ~5 ","golden_rail ",false,"west"},
  33.                       {"replaceitem block ~0 ~4 ~6 ","activator_rail ",false,"west_reset"},
  34.                       {"replaceitem block ~2 ~4 ~6 ","activator_rail ",true,"west_reset"},
  35.                       {"replaceitem block ~0 ~3 ~6 ","activator_rail ",false,"west_reset"},
  36.                       {"replaceitem block ~2 ~3 ~6 ","activator_rail ",false,"west_reset"},
  37.                     }
  38.  
  39.  
  40. for k in pairs(hopperTable) do
  41.     --print("iteration through hopperTable")
  42.     local string1 = "roundabout_"..place.."_"..hopperTable[k][4]
  43.  
  44.     local string2 = ""
  45.    
  46.     if hopperTable[k][3]==true then
  47.         --print("hopper table true")
  48.         for i=1,4 do
  49.  
  50.             string2 = "slot.container."..i.." "
  51.             commands.exec(hopperTable[k][1]..string2..hopperTable[k][2].."1 0 {display:{Name:"..string1.."},ench:[{id:1,lvl:1}]}")
  52.         end
  53.         string2 = "slot.container.0 "
  54.         commands.exec(hopperTable[k][1]..string2..hopperTable[k][2].."18 0 {display:{Name:"..string1.."},ench:[{id:1,lvl:1}]}")
  55.     else
  56.         --print("hopper table false")
  57.         string2 = "slot.container.0 "
  58.         commands.exec(hopperTable[k][1]..string2..hopperTable[k][2].."1 0 {display:{Name:"..string1.."},ench:[{id:1,lvl:1}]}")
  59.     end
  60. end
  61.  
  62. commands.exec("setblock ~1 ~5 ~9 golden_rail shape=ascending_north,powered=true")
  63. commands.exec("setblock ~0 ~5 ~9 rail shape=east_west")
  64. commands.exec("setblock ~1 ~6 ~8 rail shape=south_east")
  65.  
  66. --commands.exec("setblock ~15 ~5 ~6 air")
  67. commands.exec("setblock ~14 ~5 ~6 golden_rail shape=ascending_south,powered=true")
  68. commands.exec("setblock ~15 ~5 ~6 rail shape=east_west")
  69.  
  70. commands.exec("setblock ~4 ~5 ~6 rail shape=south_west")
  71.  
  72. local string4 = "adresses_roundabout_"..place
  73. --print(string4)
  74. commands.exec("blockdata ~7 ~5 ~7 {CustomName:"..string4.."}")
  75. commands.exec("blockdata ~8 ~5 ~7 {CustomName:"..string4.."}")
  76.  
  77. local directions = {
  78.                     {"north","golden_rail"},
  79.                     {"north_reset","activator_rail"},
  80.                     {"east","golden_rail"},
  81.                     {"east_reset","activator_rail"},
  82.                     {"south","golden_rail"},
  83.                     {"south_reset","activator_rail"},
  84.                     {"west","golden_rail"},
  85.                     {"west_reset","activator_rail"},
  86.                     }
  87.  
  88. for i=0,7 do
  89.     local string3 = "roundabout_"..place.."_"..directions[i+1][1]  
  90.     --print(string3)
  91.     local string4 = "replaceitem block ~7 ~5 ~7 slot.container."..i.." "..directions[i+1][2].." 64 0 {display:{Name:"..string3.."},ench:[{id:1,lvl:1}]}"
  92.  
  93.  
  94.     --print(string4)
  95.     commands.exec(string4)
  96.     string4 = "replaceitem block ~8 ~5 ~7 slot.container."..i.." "..directions[i+1][2].." 64 0 {display:{Name:"..string3.."},ench:[{id:1,lvl:1}]}"
  97.  
  98.     commands.exec(string4)
  99. end
  100.  
  101.  
  102. --[[
  103. commands.exec("setblock  ~12 ~6 ~4 tripwire attached=true,north=true,south=true")
  104. commands.exec("setblock  ~11 ~6 ~12 tripwire attached=true,east=true,west=true")
  105. commands.exec("setblock  ~3 ~6 ~11 tripwire attached=true,north=true,south=true")
  106. commands.exec("setblock  ~4 ~6 ~3 tripwire attached=true,east=true,west=true")
  107. --]]
Add Comment
Please, Sign In to add comment