Advertisement
Cardwell

SpawnerController V2

May 23rd, 2022 (edited)
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.60 KB | None | 0 0
  1. --Alle variabler
  2. local Spawner_ZombieP = "1"
  3. local Spawner_Blaze = "2"
  4. local Spawner_Spider = "3"
  5. local Spawner_Enderman = "4"
  6. local Spawner_Slime = "5"
  7. local Spawner_Skeleton = "6"
  8. local Spawner_Witch = "7"
  9.  
  10. --Toggle variabler
  11. local ZombieP_state = 0
  12. local Blaze_state = 0
  13. local Spider_state = 0
  14. local Enderman_state = 0
  15. local Slime_state = 0
  16. local Skeleton_state = 0
  17. local Witch_state = 0
  18.  
  19. rednet.open("back")
  20.  
  21.  
  22. while true do
  23.     term.clear()
  24.     term.setCursorPos(1,1)
  25.     print("Programmer:")
  26.     if ZombieP_state == 0 then print("1. Skru PÅ Zombie Piglin spawner")
  27.     elseif ZombieP_state == 1 then print("1. Skru AV Zombie Piglin spawner")
  28.     end
  29.     if Blaze_state == 0 then print("2. Skru PÅ Blaze spawner")
  30.     elseif Blaze_state == 1 then print("2. Skru AV Blaze spawner")
  31.     end
  32.     if Spider_state == 0 then print("3. Skru PÅ Spider spawner")
  33.     elseif Spider_state == 1 then print("3. Skru AV Spider spawner")
  34.     end
  35.     if Enderman_state == 0 then print("4. Skru PÅ Enderman spawner")
  36.     elseif Enderman_state == 1 then print("4. Skru AV Enderman spawner")
  37.     end
  38.     if Slime_state == 0 then print("5. Skru PÅ Slime spawner")
  39.     elseif Slime_state == 1 then print("5. Skru AV Slime spawner")
  40.     end
  41.     if Skeleton_state == 0 then print("6. Skru PÅ Skeleton spawner")
  42.     elseif Skeleton_state == 1 then print("6. Skru AV Skeleton spawner")
  43.     end
  44.     if Witch_state == 0 then print("7. Skru PÅ Witch spawner")
  45.     elseif Witch_state == 1 then print("7. Skru AV Witch spawner")
  46.     end
  47.     term.setCursorPos(1,15)
  48.     write("Kjør program: ")
  49.  
  50.     UserInput = read()
  51.  
  52.     if UserInput == Spawner_ZombieP and ZombieP_state == 0 then
  53.         term.clear()
  54.         term.setCursorPos(1,1)
  55.         rednet.broadcast("Spawner_ZombiePToggle")
  56.         ZombieP_state = ZombieP_state + 1
  57.        
  58.     elseif UserInput == Spawner_ZombieP and ZombieP_state == 1 then
  59.         term.clear()
  60.         term.setCursorPos(1,1)
  61.         rednet.broadcast("Spawner_ZombiePToggle")
  62.         ZombieP_state = ZombieP_state - 1
  63.     end
  64.  
  65.     if UserInput == Spawner_Blaze and Blaze_state == 0 then
  66.         term.clear()
  67.         term.setCursorPos(1,1)
  68.         rednet.broadcast("Spawner_BlazeToggle")
  69.         Blaze_state = Blaze_state + 1
  70.  
  71.     elseif UserInput == Spawner_Blaze and Blaze_state == 1 then
  72.         term.clear()
  73.         term.setCursorPos(1,1)
  74.         rednet.broadcast("Spawner_BlazeToggle")
  75.         Blaze_state = Blaze_state - 1
  76.     end
  77.  
  78.     if UserInput == Spawner_Spider and Spider_state == 0 then
  79.         term.clear()
  80.         term.setCursorPos(1,1)
  81.         rednet.broadcast("Spawner_SpiderToggle")
  82.         Spider_state = Spider_state + 1
  83.  
  84.     elseif UserInput == Spawner_Spider and Spider_state == 1 then
  85.         term.clear()
  86.         term.setCursorPos(1,1)
  87.         rednet.broadcast("Spawner_SpiderToggle")
  88.         Spider_state = Spider_state - 1
  89.     end
  90.  
  91.     if UserInput == Spawner_Enderman and Enderman_state == 0 then
  92.         term.clear()
  93.         term.setCursorPos(1,1)
  94.         rednet.broadcast("Spawner_EndermanToggle")
  95.         Enderman_state = Enderman_state + 1
  96.  
  97.     elseif UserInput == Spawner_Enderman and Enderman_state == 1 then
  98.         term.clear()
  99.         term.setCursorPos(1,1)
  100.         rednet.broadcast("Spawner_EndermanToggle")
  101.         Enderman_state = Enderman_state - 1
  102.     end
  103.     if UserInput == Spawner_Slime and Slime_state == 0 then
  104.         term.clear()
  105.         term.setCursorPos(1,1)
  106.         rednet.broadcast("Spawner_SlimeToggle")
  107.         Slime_state = Slime_state + 1
  108.  
  109.     elseif UserInput == Spawner_Slime and Slime_state == 1 then
  110.         term.clear()
  111.         term.setCursorPos(1,1)
  112.         rednet.broadcast("Spawner_SlimeToggle")
  113.         Slime_state = Slime_state - 1
  114.     end
  115.     if UserInput == Spawner_Skeleton and Skeleton_state == 0 then
  116.         term.clear()
  117.         term.setCursorPos(1,1)
  118.         rednet.broadcast("Spawner_SkeletonToggle")
  119.         Skeleton_state = Skeleton_state + 1
  120.  
  121.     elseif UserInput == Spawner_Skeleton and Skeleton_state == 1 then
  122.         term.clear()
  123.         term.setCursorPos(1,1)
  124.         rednet.broadcast("Spawner_SkeletonToggle")
  125.         Skeleton_state = Skeleton_state - 1
  126.     end
  127.     if UserInput == Spawner_Witch and Witch_state == 0 then
  128.         term.clear()
  129.         term.setCursorPos(1,1)
  130.         rednet.broadcast("Spawner_WitchToggle")
  131.         Witch_state = Witch_state + 1
  132.  
  133.     elseif UserInput == Spawner_Witch and Witch_state == 1 then
  134.         term.clear()
  135.         term.setCursorPos(1,1)
  136.         rednet.broadcast("Spawner_WitchToggle")
  137.         Witch_state = Witch_state - 1
  138.     end
  139. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement