Jump to content




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


  • You cannot reply to this topic
2 replies to this topic

#1 houseofkraft

  • Members
  • 170 posts
  • LocationUSA

Posted 19 August 2016 - 01: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!

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 20 August 2016 - 12: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...ructureTutorial

#3 houseofkraft

  • Members
  • 170 posts
  • LocationUSA

Posted 21 August 2016 - 01:59 PM

Ok I will try that





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users