Computer Craft

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Niluminum

New Member
Jul 29, 2019
14
0
0
I just started a town on with towny on a server. im looking to setup my town rules and banned players on a monitor. so far ive gotten it configured the way i want, all i need now is to make it appear for an infinity amount of time, because it seems every 5-10 mins the monitor will auto clear itself. i wondering what i need to put into my code to allow it to not auto clear and allow my writing to stay on the monitor infinitly. my code is below

http://pastebin.com/YVDhVxYd
 
Is the area chunk loaded? If not are you naming the script "startup"?
The problem you are having might very well be that the computer stops running when players leaves the area and it doesn't restart when someone comes back.
 
the script is named townrules, and the area should be chunk loaded
Try renaming it "startup". This will ensure it is automatically run whenever the server restarts, chunk is loaded etc.

That or you can make another script called "startup" with the code:
Code:
shell.run("townrules")
 
the script is named townrules, and the area should be chunk loaded

Yeah, having it chunk loaded doesn't matter. When you restart the server it terminates all the CC threads essentially stopping all programs.
It stops even if you save the program as startup, but of course saving the program as startup means you wont have to manually run the program each restart.
 
how do i make my code appear automatically on a monitor without my touching it?
By naming it startup. Like I said before, this will cause the computer to run the script again once the chunk the computer is in gets loaded again(due to chunkloading from players or from server restarts).

Make sure you also label the computer. Type in:
Code:
label set computerlabelnameofyourchosing
I dont think computers loose their programs if unloaded/server restarted, but this will allow you to pick up and move the computer while it remembers the scripts.
 
Last edited:
... make it appear for an infinity amount of time, because it seems every 5-10 mins the monitor will auto clear itself. ...
Hm, interesting. Never heared about this before.

Try renaming it "startup". This will ensure it is automatically run whenever the server restarts, chunk is loaded etc. ...
Startup should do the trick, even when not chunk loaded the display will refresh when you come near the monitor.

If it's really some weird bug, you could put your code in a loop that prints it again after 5min, e.g.:
Code:
while true do
  -- your code
  os.sleep(300) -- sleeps for 300 seconds
end