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

[SOLVED]startup shell.run not running every time? help!

Started by Pugz, 29 July 2012 - 12:22 AM
Pugz #1
Posted 29 July 2012 - 02:22 AM
Well it's just a small problem that will probably be my fault but I thought I would ask a pro just in-case. I have a simple startup:

shell.run("monitor", "right", "uiTest")

This is "uiTest"


print("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
print("X									><				   				 X")
print("X									><									X")
print("X							   	 ><									X")
print("X									><									X")
print("X							 	   ><									X")
print("X									><									X")
print("X									><									X")
print("X									><									X")
print("X									><									X")
print("X									><									X")
print("X									><									X")
print("X									><									X")
print("X									><									X")
print("X									><									X")
print("X									><									X")
print("X									><									X")
print("X									><									X")
print("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")

Please note that all I'm trying to do is to create a UI style interface with options and information, I have tried everything from nesting this in [[ ,,, ]] to redirecting it to the monitor with nothing but headaches with new lines (a post was made earlier lol) and through all of this I keep getting the same issue, works fine the first time loading and then the second time it would fail to show?

I change the file from the server in Notepad++ and re-upload it, goto the console and hit "reboot" I get nothing? many reboots still nothing. Then when i remove the PC and place it back again and go into the console to start the custom startup program it works? is this a bug? I wouldn't want to post a bug report if it isn't.

Any clues?

EDIT: Sorry added a little more detail to the post.
EDITEDIT: Wow ok I don't know why the code for the uiTest is messing up but you get the idea of the box ui.
Tiin57 #2
Posted 29 July 2012 - 05:18 AM
Close lines 2-17 in uiTest with

")
Lyqyd #3
Posted 29 July 2012 - 06:38 AM
Close lines 2-17 in uiTest with

")

They are closed that way.
Tiin57 #4
Posted 29 July 2012 - 07:00 AM
Oh. I didn't see the scroll bar. Woops. :-|
Rsstn #5
Posted 29 July 2012 - 10:14 AM
works fine the first time loading and then the second time it would fail to show?

So, what you are trying to say is that when you start the computer the first time, the 'startup' program runs correctly and the code above works as expected, but when you start the computer a second/third/fourth time, the 'startup' program doesn't run at all?
If that is what you mean, then this isn't a problem with the code.
Can you run the 'startup' program manually? If so, then this is most likely a bug.
Pugz #6
Posted 29 July 2012 - 12:24 PM
Close lines 2-17 in uiTest with

")

Sorry about that, for some reason the code tags mess up the positioning of the ASCII :ph34r:/>/>


works fine the first time loading and then the second time it would fail to show?

So, what you are trying to say is that when you start the computer the first time, the 'startup' program runs correctly and the code above works as expected, but when you start the computer a second/third/fourth time, the 'startup' program doesn't run at all?
If that is what you mean, then this isn't a problem with the code.
Can you run the 'startup' program manually? If so, then this is most likely a bug.

OK just an update, but yes that's how it's happening at the moment. Logged onto the server then did a reboot on the PC with the shell.run("monitor", "right", "uiTest") nothing, after a few reboots still nothing. I then removed the PC and replaced it, clicked on it to start the startup but this time nothing was displayed? I then clicked on the PC to start the uiTest from there, using monitor right uiTest and it does show up on the monitor just fine! then a reboot and nothing.

Please note that running the shell.run("monitor", "right", "uiTest") from the custom startup program will display "Running uiTest on right monitor" in the console but still nothing is displayed on the monitor from the uiTest that has nothing but print values.
Mendax #7
Posted 29 July 2012 - 12:29 PM
Close the print lines. It has to be like

print("Hi")
on each line. It doesn't run quite like JSON…
Pugz #8
Posted 29 July 2012 - 12:34 PM
Close the print lines. It has to be like

print("Hi")
on each line. It doesn't run quite like JSON…

The print lines are all closed even though they are messed up on the OP code :S I tried to fix it but it just keeps going wrong. here I will attach the uiTest file I'm using for future reference.
Pugz #9
Posted 30 July 2012 - 02:15 AM
Ok hi again all, just to update that I have solved the issue for now. It would seem that the programs or shell.run() doesn't quite like to be run right after the OS has booted up, solution is to put a fancy "stuff is loading" and then allow it to sleep for 1-5 second before you run your shell.run().

All sorted and making great progress with my project xD thanks to everyone for their help.