Advertisement
Cardwell

Untitled

Nov 12th, 2022 (edited)
842
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.75 KB | None | 0 0
  1. --Alle variabler
  2. local Spawner_BlazeH = "1"
  3. local Spawner_BlazeV = "2"
  4. local Spawner_Spider = "3"
  5. local Spawner_Skeleton = "4"
  6.  
  7. --Toggle variabler
  8. local BlazeH_state = 0
  9. local BlazeV_state = 0
  10. local Spider_state = 0
  11. local Skeleton_state = 0
  12.  
  13. rednet.open("left")
  14.  
  15.  
  16. while true do
  17.     term.clear()
  18.     term.setCursorPos(1,1)
  19.     print("Programmer:")
  20.     if BlazeH_state == 0 then print("1. Skru PÅ Blaze H spawner")
  21.     elseif BlazeH_state == 1 then print("1. Skru AV Blaze H spawner")
  22.     end
  23.     if BlazeV_state == 0 then print("2. Skru PÅ Blaze V spawner")
  24.     elseif BlazeV_state == 1 then print("2. Skru AV Blaze V spawner")
  25.     end
  26.     if Spider_state == 0 then print("3. Skru PÅ Spider spawner")
  27.     elseif Spider_state == 1 then print("3. Skru AV Spider spawner")
  28.     end
  29.     if Skeleton_state == 0 then print("4. Skru PÅ Skeleton spawner")
  30.     elseif Skeleton_state == 1 then print("4. Skru AV Skeleton spawner")
  31.     end
  32.     term.setCursorPos(1,15)
  33.     write("Kjør program: ")
  34.  
  35.     UserInput = read()
  36.  
  37.     if UserInput == Spawner_BlazeH and BlazeH_state == 0 then
  38.         term.clear()
  39.         term.setCursorPos(1,1)
  40.         rednet.broadcast("Spawner_BlazeHToggle")
  41.         BlazeH_state = BlazeH_state + 1
  42.        
  43.     elseif UserInput == Spawner_BlazeH and BlazeH_state == 1 then
  44.         term.clear()
  45.         term.setCursorPos(1,1)
  46.         rednet.broadcast("Spawner_BlazeHToggle")
  47.         BlazeH_state = BlazeH_state - 1
  48.     end
  49.  
  50.     if UserInput == Spawner_BlazeV and BlazeV_state == 0 then
  51.         term.clear()
  52.         term.setCursorPos(1,1)
  53.         rednet.broadcast("Spawner_BlazeVToggle")
  54.         BlazeV_state = BlazeV_state + 1
  55.  
  56.     elseif UserInput == Spawner_BlazeV and BlazeV_state == 1 then
  57.         term.clear()
  58.         term.setCursorPos(1,1)
  59.         rednet.broadcast("Spawner_BlazeVToggle")
  60.         BlazeV_state = BlazeV_state - 1
  61.     end
  62.  
  63.     if UserInput == Spawner_Spider and Spider_state == 0 then
  64.         term.clear()
  65.         term.setCursorPos(1,1)
  66.         rednet.broadcast("Spawner_SpiderToggle")
  67.         Spider_state = Spider_state + 1
  68.  
  69.     elseif UserInput == Spawner_Spider and Spider_state == 1 then
  70.         term.clear()
  71.         term.setCursorPos(1,1)
  72.         rednet.broadcast("Spawner_SpiderToggle")
  73.         Spider_state = Spider_state - 1
  74.     end
  75.  
  76.     if UserInput == Spawner_Skeleton and Skeleton_state == 0 then
  77.         term.clear()
  78.         term.setCursorPos(1,1)
  79.         rednet.broadcast("Spawner_SkeletonToggle")
  80.         Skeleton_state = Skeleton_state + 1
  81.  
  82.     elseif UserInput == Spawner_Skeleton and Skeleton_state == 1 then
  83.         term.clear()
  84.         term.setCursorPos(1,1)
  85.         rednet.broadcast("Spawner_SkeletonToggle")
  86.         Skeleton_state = Skeleton_state - 1
  87.     end
  88. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement