Jump to content




Autostart throws attempt to index ? but running startup does not


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

#1 Joeld98

  • Members
  • 17 posts
  • LocationEast Coast United States

Posted 22 October 2016 - 02:01 AM

My advanced computer is starting after a server reboot but errors with attempt to index ? (a nil value) when it tries to access the monitors the first time. If I run startup from the command prompt it works fine.

It's a basic billboard program using 4 network connected monitors (8X6). Should the network devices be accessible on boot?


http://pastebin.com/BJDjbGQu

#2 Bomb Bloke

    Hobbyist Coder

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

Posted 22 October 2016 - 02:33 AM

Just off the top of my head, does it make a difference if you add a sleep(0) to the top of the script?

#3 Joeld98

  • Members
  • 17 posts
  • LocationEast Coast United States

Posted 22 October 2016 - 12:00 PM

No difference. I've tried adding sleep steps up to 15 in the startup and in my billboard program.

When the server restarts or when I issue a reboot command I get the nil error at line 114 which is the first attempt to use a monitor.

I'll do some more testing to try to isolate it.

#4 Bomb Bloke

    Hobbyist Coder

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

Posted 22 October 2016 - 01:40 PM

I suppose another guess at a workaround might be to throw something like this under line five:

if #monitor < 4 then
  sleep(10)
  os.reboot()
end

Edited by Bomb Bloke, 22 October 2016 - 01:41 PM.


#5 Joeld98

  • Members
  • 17 posts
  • LocationEast Coast United States

Posted 24 October 2016 - 09:14 PM

I had a disk drive attached to the computer. As soon as I remove it the computer was able to start and find the monitors without throwing an error.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users