Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- local m = peripheral.wrap("right")
- if (#args ~= 0) then
- if (args[1] == "file") then
- print("Bestand verzenden op kanaal 99")
- print("Naam: ".. args[2])
- f = fs.open(args[2],"r")
- m.transmit(99,99,"file|".. args[2] .."|".. f.readAll())
- print("Bestand verstuurd")
- elseif (args[1] == "shell") then
- print("Shell commando verzenden op kanaal 99")
- print("Commando: ".. args[2])
- if (args[3]~=nil) then
- print("Arguments: ".. args[3])
- m.transmit(99,99,"shell|".. args[2] .."|".. args[3])
- else
- m.transmit(99,99,"shell|".. args[2])
- end
- print("Commando verstuurd")
- end
- else
- print("gebruik: send99 [actie] [naam] <argument>")
- print("actie = file OF shell")
- print("naam = file om te verzenden OF shell commando om uit te voeren (zoals een verzonden file)")
- print("argument = optioneel bij het versturen van een shell commando om 1 variabel mee te geven.")
- end
Advertisement
Add Comment
Please, Sign In to add comment