AnonymusHochgenuss

stationname

Jun 3rd, 2024
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 0 0
  1. tArgs = { ... }
  2. if peripheral.find("Create_Station") then
  3.  trainstation = peripheral.find("Create_Station")
  4. else
  5.  print("no station found")
  6.  return
  7. end
  8. if #tArgs <= 0 then
  9.  print("usage: stationname get/set new")
  10.  return
  11. end
  12. action = tArgs[1]
  13. if action == "set" then
  14.  new = tArgs[2]
  15.  trainstation.setStationName(new)
  16.  print("new Station Name: "..trainstation.getStationName())
  17.  sleep(0.1)
  18.  trainstation.setStationName(new)
  19. elseif action == "get" then
  20.  print(trainstation.getStationName())
  21. else
  22.  print("unknown action")
  23.  print("usage: stationname get/set new")
  24. end
Advertisement
Add Comment
Please, Sign In to add comment