AnonymusHochgenuss

trainstation

Jun 10th, 2024 (edited)
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. tArgs = { ... }
  2. if peripheral.find("Create_Station") then
  3.  trainstation=peripheral.find("Create_Station")
  4. else
  5.  print("no trainstation found")
  6.  return
  7. end
  8. if #tArgs <= 0 then
  9.  print("missing Arguments")
  10.  print("usage: trainstation assemble/disassemble")
  11.  return
  12. elseif #tArgs > 1 then
  13.  print("to much arguments. checking only the first")
  14. end
  15.  
  16. if tArgs[1] == "assemble" then
  17.  print("trying to assemble train")
  18.  if trainstation.assemble() then
  19.   print("success")
  20.  else
  21.   print("error")
  22.  end
  23. elseif tArgs[1] == "disassemble" then
  24.  print("trying to disassemble train")
  25.  if trainstation.disassemble() then
  26.   print("success")
  27.  else
  28.   print("error")
  29.  end
  30. elseif tArgs[1] == "setAssemblyMode" then
  31.  print("trying to enter Assembly Mode")
  32.  if trainstation.setAssemblyMode() then
  33.   print("success")
  34.  else
  35.   print("error")
  36.  end
  37. else
  38.  print("command not found")
  39.  print("command: "..tArgs[1])
  40. end
Advertisement
Add Comment
Please, Sign In to add comment