This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
houseofkraft's profile picture

My Celluar System programs exit's by itself when i try to send a text

Started by houseofkraft, 19 August 2016 - 12:30 PM
houseofkraft #1
Posted 19 August 2016 - 02:30 PM
I am having a problem where in my celluar system when i try to send a text through it, the program exit's by itself

Code:
term.clear()
print("Cell Service Active")
rednet.open("top")
id, message = rednet.receive()
if message == "ticketadd" then
   print("Please put in ticket. Press Enter to continue")
   enter = read()
   if fs.exists("/disk/blahblah") then
   print("Vaild, Adding Data...")
   shell.run("mkdir",id)
   local file = fs.open("/",id,"/Data","w")
   file.writeLine("300MB")
   file.close()
   os.reboot()
   end
if message == "sendtext" then
   if fs.exists("/",id) == true then
	  rednet.send(id, "activated")
   else
	  rednet.send(id, "noactivated")
  
end
end
end

Thank You!
Bomb Bloke #2
Posted 20 August 2016 - 01:09 AM
Seems you want to introduce a loop; one along the lines of "while true do" should allow you to repeat a given chunk of code indefinitely.

http://lua-users.org/wiki/ControlStructureTutorial
houseofkraft #3
Posted 21 August 2016 - 02:59 PM
Ok I will try that