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

On - Automatic Computer Activator

Started by LDDestroier, 31 March 2015 - 09:49 PM
LDDestroier #1
Posted 31 March 2015 - 11:49 PM
On - automatic computer activator
—————————————————————————————————-

install it with:
pastebin get W4GLNE39 startup
or
pastebin get W4GLNE39 on

or even

std ld on on


__________________________________________

Now supports colors on advanced computers!

Also supports normal computers just as well!

Now can turn computers OFF! (bum bum buuumm)

General info:
SpoilerA lot of the time, when a server restarts, or the chunk a computer is in is unloaded, computers deactivate. This may not be a problem for some, but for anyone hosting something like a computercraft server (say, an admin wants a chat server), you don't want to have to manually click on each computer to turn it on.

Maybe you want to activate a thousand computers at once. Maybe.

Anyway, you can do just that with 'On', a program that seeks computers connected through network cable and turns them on. Yes, I know it's a simple, easily reproducible program, but on the other hand, shut up.

Feature list:
Spoiler+ Turns all connected computers on (requires that computers on cable network are connected; right click on modem)
+ Lists computer names and IDs in a file (defaultly called '/complist')
+ Allows the ability to reboot all computers connected with the press of a button
+ Can be ran in the background when run, and after ran

+ Supports colors for advanced computers as of 4/2/2015 (good god, this is old)
+ Has animations! Togglable for those too weak to handle moving text, or if it's annoying.
+ Can turn computers on…and also off! Togglable in the file.
+ List of computers rolls over to the right to fill the whole screen with info!



Screenshots:
Spoiler'On' can keep high-up or otherwise unreachable computers from turning off, such as rednet repeaters or remote door locks





'ON' can power up a great deal computers at once in one click





'On' does not, and cannot, work wirelessly, you goit





'On' lists all connected computers and their IDs, and can reboot them with 'R'





As you can see, this is totally superior to anything you puny mortals can conjure up. *snort*

FAQ:
SpoilerQ: Why aren't my computers turning on?
A: The reason mainly has to do with a bug in ComputerCraft, where you have to sometimes right click twice on the on'd computer's wired modem. It's weird, I know. I think it has to do with loaded chunks.


Q: It locks up the terminal in CCEmuRedux/CCLite!
A: I don't remember ever having this issue, but it could crop up. Update your emulator to the latest version, and it should work just fine. Not that you'd ever need something like this in an emulator, but that's besides the point.




Please list any bugs you find or features you suggest so that I can dismiss them and roll my eyes sarcastically.
Edited on 29 July 2016 - 06:09 AM
InDieTasten #2
Posted 31 March 2015 - 11:51 PM
+1 for humorous post
Geforce Fan #3
Posted 01 April 2015 - 12:31 AM
I was gonna do this…
KingofGamesYami #4
Posted 01 April 2015 - 12:37 AM
Presenting… Off. Exactly the same as On, but with 100% more uselessness! xD

I give you an internet point for originality.
LDDestroier #5
Posted 01 April 2015 - 11:40 AM
Presenting… Off. Exactly the same as On, but with 100% more uselessness! xD

I give you an internet point for originality.

Haha, I love internet satire.
LDDestroier #6
Posted 01 April 2015 - 12:02 PM
Just added screenshots. Now you can view how sexy my program is before you inevitably download it. Go ahead. You know you want to. I'm 153% sure that my math is correct.
Edited on 02 April 2015 - 01:06 AM
LDDestroier #7
Posted 01 April 2015 - 07:49 PM
I have fixed the rapidly refreshing screen, added the ability to run in the background, and made it list all computers in a text file called "/complist".
LDDestroier #8
Posted 02 April 2015 - 12:02 AM
I have greatly increased resiliance to modem spamming (rapidly turning one or more modems on and off), as it would, before, crash the program.
InDieTasten #9
Posted 02 April 2015 - 12:06 AM
Oh my gosh, you are getting this to a sell-able software product :'D
LDDestroier #10
Posted 02 April 2015 - 01:44 AM
Oh my gosh, you are getting this to a sell-able software product :'D

Sellable? Um, not only is a quick lua program not sellable, but I'm a huge advocate of open-source stuff.

I MEAN thanks.

EDIT: I think I found a typing style for the forums. Sarcastic, witty, and Stephen Colbert-esque.
Edited on 02 April 2015 - 01:04 AM
InDieTasten #11
Posted 02 April 2015 - 03:10 AM
Oh my gosh, you are getting this to a sell-able software product :'D

Sellable? Um, not only is a quick lua program not sellable, but I'm a huge advocate of open-source stuff.

I MEAN thanks.

EDIT: I think I found a typing style for the forums. Sarcastic, witty, and Stephen Colbert-esque.
:D/> I think that was hilarious. Even if I didn't meant it sarcastic, sell-"able" doesn't mean, you should sell, rather than you COULD sell it. Me myself am also on the light, non-proprietary side of software development^^
Edited on 02 April 2015 - 01:11 AM
LDDestroier #12
Posted 02 April 2015 - 05:49 PM
Finally got another big update! Here's a list of what I remember changing:

+Advanced computers now have extra colors (took a lot of shit on my part)
+Added little animations that can be toggled in the code, to make sure computercraft hasn't crashed or something (they look cool, okay?)
+Added a more standard config section of the code.

New config items:
+ 'animations' - toggles whether animations are enabled or disabled (boolean)
+ 'onOrOff' - toggles whether the program should turn computers on or off (string ["on" or "off"])
+ 'spoofMode' - Toggles whether it should fake some non-real computers into the list, to test it on emulator and stuff. (boolean)
+ 'loadBarChar' - Just tells it what character it should have in the loading bar animation I added. (string [single character, please])
+ 'background' - Determines whether it should run On in the background and have a shell running when you start it. You can use 'exit' to go back. (boolean)

Those are the config items, don't even touch anything else unless you want to redownload.

EDIT: Just found a bit more graphics bugs and fixed them.
Edited on 02 April 2015 - 05:30 PM
LDDestroier #13
Posted 02 April 2015 - 08:40 PM
My god!! Just fracking did it. If you were experiencing errors or problems over the past ten minutes or so, it's because I was actively fixing them and they should be okay now.
Here's a new changelist.
+Spinning line animation on computers in the list will turn into a * when the corresponding computer is off.
+If there are too many computers on the screen to display one on top of another, it now GOES TO THE RIGHT SIDE. It only does that once however, and doesn't roll over again on monitors…yet. I have no idea why one would do that anyway, to be honest.

EDIT: I also found a…bug. A bug where on a computer, when you exit, it grays out the font…even on normal computers. Someone please look into it and find out how to exploit it, I don't want to.

EDIT EDIT: Crap, found an actual, bad bug. Just a minute.
Edited on 04 April 2015 - 02:18 PM
InDieTasten #14
Posted 02 April 2015 - 11:00 PM
I think I have to start crying :'D
LDDestroier #15
Posted 02 April 2015 - 11:55 PM
FINALLY!!! It's been a few HOURS, but I did it. Here's a modest list of changes which took me very long:

-Text grays out when you exit program, even on regular computer
+List of computers will now overflow to the right when it runs out of space. This can go on forever, assuming you have infinite monitor space.
-Bugs fixed

I hope it was all worth it. It looks awesome on an advanced computer.

Ask me if I'm happy. Then look at my signature.

EDIT: Crap! It doesn't scroll forever.
EDIT EDIT: Stupid me, the monitor was too small. Tee hee.
Edited on 04 April 2015 - 02:18 PM
wieselkatze #16
Posted 04 April 2015 - 01:12 PM
Greetings, I'll just give my two cents for this program.
I have to say that I've not tried it yet, but I probably would if I see this one feature implemented that I'm going to suggest right now.
How about relays? Sure, you could just put another computer running "On" as the startup script in the network, but that wouldn't be as cool as a relay.
My perception would be that the main computer can 'see through' the relay and list all the computers behind it. Like if there was no relay at all.
Of course it'd be nice if you could put relays behind relay and so on…
I'd really see a benefit from this as some bases, like mine, tend to become relatively big, where the 256 cable limit would become a problem.

~ wieselkatze
Lyqyd #17
Posted 04 April 2015 - 04:19 PM
Keep the language clean, please.
InDieTasten #18
Posted 04 April 2015 - 06:37 PM
Greetings, I'll just give my two cents for this program.
I have to say that I've not tried it yet, but I probably would if I see this one feature implemented that I'm going to suggest right now.
How about relays? Sure, you could just put another computer running "On" as the startup script in the network, but that wouldn't be as cool as a relay.
My perception would be that the main computer can 'see through' the relay and list all the computers behind it. Like if there was no relay at all.
Of course it'd be nice if you could put relays behind relay and so on…
I'd really see a benefit from this as some bases, like mine, tend to become relatively big, where the 256 cable limit would become a problem.

~ wieselkatze
This doesn't work, unless you out extra software on the computers, that do the relaying ;)/> This program functions much like wake-on-lan, you cannot send messages through a computer, if he doesn
t want to. You could just install a derived version of "Relay" to the relaying computers as startup. But automagically as far as I understood your post isn't possible.
wieselkatze #19
Posted 04 April 2015 - 09:55 PM
This doesn't work, unless you out extra software on the computers, that do the relaying ;)/> This program functions much like wake-on-lan, you cannot send messages through a computer, if he doesn
t want to. You could just install a derived version of "Relay" to the relaying computers as startup. But automagically as far as I understood your post isn't possible.

I think you might have misunderstood my post - that was my exact suggestion for him to make.
Hence why I said "this one feature that I'm going to suggest right now"
LDDestroier #20
Posted 04 April 2015 - 10:49 PM
Greetings, I'll just give my two cents for this program.
I have to say that I've not tried it yet, but I probably would if I see this one feature implemented that I'm going to suggest right now.
How about relays? Sure, you could just put another computer running "On" as the startup script in the network, but that wouldn't be as cool as a relay.
My perception would be that the main computer can 'see through' the relay and list all the computers behind it. Like if there was no relay at all.
Of course it'd be nice if you could put relays behind relay and so on…
I'd really see a benefit from this as some bases, like mine, tend to become relatively big, where the 256 cable limit would become a problem.

~ wieselkatze

Hmm, I think I know what you mean. Adding remotely-on'd computers to each list? Sounds a bit hard to do. I'll try it.

EDIT: Too hard dammit. I'm not good at any networking.
Edited on 04 April 2015 - 10:35 PM
ze_robot #21
Posted 20 April 2015 - 07:38 PM
Nice program.

If you have Thermal expansion installed you can make it so you don't have to manually start ANY computers up.

On the computer that's running on, build this:
Spoiler

That's a thermal expansion autonomous activator set to right click when it receives a signal. You should be able to replace the cable w/ a piece of redstone.

Then set "startup" to:

redstone.setOutput("INSERT SIDE W/ TORCH HERE",true)
shell.run("INSERT PROGRAM NAME HERE")
fishmeal #22
Posted 27 May 2015 - 10:30 PM
Nice program.

If you have Thermal expansion installed you can make it so you don't have to manually start ANY computers up.

On the computer that's running on, build this:
Spoiler

That's a thermal expansion autonomous activator set to right click when it receives a signal. You should be able to replace the cable w/ a piece of redstone.

Then set "startup" to:

redstone.setOutput("INSERT SIDE W/ TORCH HERE",true)
shell.run("INSERT PROGRAM NAME HERE")
I was trying to do something like this, but with the "On" script you have to type 'r' in order to actually reboot any machines.
What part of the script would I remove/change in order to have 'startup' just go straight into rebooting all machines, without asking me to type x,b or r first?
I tried my hand at deleting things, but only managed to break it. I am extremely noobish to CC.
Bomb Bloke #23
Posted 28 May 2015 - 01:13 AM
Without digging too far into things, it looks like a simple-ish way of automating it might be to change this block (around line 373):

if animations then
        parallel.waitForAny(checkForComps, keyPress, animateSpinLines, animateLoadBar)
else
        parallel.waitForAny(checkForComps, keyPress)
end

… to something like:

local function pressR()
	sleep(15)  -- Make sure all chunks that should load have time to do so.
	os.queueEvent("char", "r")  -- Simulate a press of "r".
	os.pullEvent("letMeSleep")  -- Coroutine will go dormant.
end
	
if animations then
        parallel.waitForAny(checkForComps, keyPress, animateSpinLines, animateLoadBar, pressR)
else
        parallel.waitForAny(checkForComps, keyPress, pressR)
end
LDDestroier #24
Posted 28 May 2015 - 01:15 AM
Mm, your request is delicious. Anyhow, I just updated the program to do what you wanted it to do. All you have to do it reinstall it, then change the variable at the top of the program from false to true, then it will reboot the PCs at startup, hopefully.
Edited on 27 May 2015 - 11:18 PM
fishmeal #25
Posted 28 May 2015 - 10:46 PM
Mm, your request is delicious. Anyhow, I just updated the program to do what you wanted it to do. All you have to do it reinstall it, then change the variable at the top of the program from false to true, then it will reboot the PCs at startup, hopefully.
Dude…
You are my hero. You have made our ModSauce server super happy. Thanks. :D/>
LDDestroier #26
Posted 29 May 2015 - 01:29 AM
Mm, your request is delicious. Anyhow, I just updated the program to do what you wanted it to do. All you have to do it reinstall it, then change the variable at the top of the program from false to true, then it will reboot the PCs at startup, hopefully.
Dude…
You are my hero. You have made our ModSauce server super happy. Thanks. :D/>

Holy crap, I did? I'll have to do something about that! Can't have people be happy willy nilly!
But cereally, I'm glad I made a (whole?) server happy with my programming skills, or lack thereof. I really appreciate it! To be honest I didn't think very many people at all look at my programs, despite constant update. :D/>
Lupus590 #27
Posted 19 January 2016 - 08:52 AM
Feature suggestion, run a file after turning on all computers
LDDestroier #28
Posted 19 January 2016 - 01:50 PM
Feature suggestion, run a file after turning on all computers

Done. It's in the config (which I should make more obvious in the menu).
To have a program run on startup, set 'startupProg' to the path of the file (with arguments like "less -d butt -u http://pastebin.com/R4DKXbzm") in the config file ('/.on_conf').
scopeFX #29
Posted 28 July 2016 - 09:47 PM
Thanks for that program! That's exactly what i searched for.
TheRockettek #30
Posted 29 July 2016 - 08:52 AM
But how would you turn on the computer that turns the other computers on automaticaly, when you join that computer would be shutdown so you would have to make another computer turning the computer on that turns the computer on that turns all the computers on.

Paradox Status : On Hold
LDDestroier #31
Posted 30 July 2016 - 06:09 AM
But how would you turn on the computer that turns the other computers on automaticaly, when you join that computer would be shutdown so you would have to make another computer turning the computer on that turns the computer on that turns all the computers on.

Paradox Status : On Hold

You know too much. Take the blue pill like a good citizen.
roger109z #32
Posted 28 August 2016 - 07:52 PM
just saying turning on 1000 computers at once kills servers
like it just murders them
TheRockettek #33
Posted 28 August 2016 - 08:30 PM
When you have thermal expansion, you can just use an autonomous activator d:

#2OBSOLETE4ME
Lupus590 #34
Posted 29 August 2016 - 04:00 PM
When you have thermal expansion, you can just use an autonomous activator d:

#2OBSOLETE4ME

Yeah, but this is cheaper.