DEV Community

Discussion on: Stop telling people what are the "best" programming languages to learn

Collapse
 
sebbdk profile image
Sebastian Vargr • Edited

I picked up Lua to program Minecraft robots...
It was great, but left me wondering if i should be doing more with my life.

Collapse
 
caelumf profile image
CaelumF • Edited

Computercraft!! Good days.

I remember building a nuclear reactor on a server with ic2 that used electric wrenches and a deployer to safely (regular breaking would only yield a machine block) break the reactor itself. It was pretty cool because it needed current to run; the electric wrenches needed recharging, a buildcraft selective extractor pulled out empty wrenches, recharged them, and put them back in the deployer. A turtle routinely picked up the dropped reactor core and its uranium rods, placed them back and re-inserted the rods. After time for the reactor to heat up, it would generate more power and heat up faster until getting to a level where the wrench collected it again.

This server also had ICBMs. It was essential for a continuous stream of electricity to run the bases' radars, power AA guns and EMPs as a last resort. off-site mining turtle runs were providing enough uranium from slowly hollowing out the planet, but enemy factions were using dynmap to identifiy the underground disruptions and take the cache content and precious mining turtles, so energy reserves needed to account for dry spells.

A single powerhouse would have been a very lucrative target- with an adequate supply of missiles, an enemy could temporarily exhaust the EMP tower arrays and overrun the AA guns for long enough to get a missile directly into the powerhouse and severely limit the base's defences to further missile attack. To account for this, redundant MFSU powerhouses were distributed across the base in access-controlled areas, where even members of the base were not aware of all their locations.

This introduced another problem - how many reactor cores to run at once? when to stop running them? The reactors, although highly efficient, could very happily burn through uranium with no output without some way of telling when all of the distributed powerhouses were full.

MFSU powerhouses had power meters to report their energy levels over the network. This was visible from terminals, and from hand-held PDAs so that I could stay alert and stop an emergency in its tracks.

Doors within the base would be password unlocked and all computers were to use a custom operating system with a secure lock screen, it as the base grew in size and network complexity, I eventually implemented something similar to the TCP protocol, and a large WAN to be able to control the base from afar.

Back to the reactor, and lua.

As reactor heat increased, the power output increases as well, exponentially. Past a certain level there is a small chance fire blocks randomly replace blocks around the reactor -with the complex mechanism to keep the reactor cooled, this was obviously very dangerous, as when heat reaches a terminal point, an explosion would envelop the reactor room and much of the base. But the energy was pretty high at fire levels, and EMP towers were set to use a lot of electricty. If the alternative to dangerously boosting the reactors were successful missile strikes, it was worth doing for short periods of time! I added the ability to enter this mode on my PDA

While my faction was making great technological defence strides, the enemy was more focused on offence.

My brother, at the head of the enemy faction's tech efforts fancied himself as a reverse engineer, and he was pretty good. non-millitary networks had been routinely shut down with protocol exploiting DDoS attacks to hamper progress and we knew he was working on ways past the bases' security. What if he found a way to enable the reactors afterburner mode remotely?

In Computercraft, when messages are sent, their location can be triangulated. So I built a sort of certificate authority- firstly, GPS satellites (higher up gives further broadcast) were positioned far around the map. A computer could register their location with a public key on a specific channel, the satellites would send associated messages to the "CA" with their distance - verified cryptographically with prior exchanged keys - and the CA would triangulate the sender location. MITM or replayability attacks wouldn't be possible because they would clearly show a different origin from the "CA".

The PDA was still vulnerable to those attacks, so most of the time it proxied through nearby trusted "router"s with fixed locations.

What was the next point for my brother to attack? The CA server and satellites became new targets for physical and cyber attacks, and the war waged on...

...then I realized I was probably putting more effort into the game than its makers and I started college and work and other human responsibilities...

but left me wondering if I should be doing more with my life

same.

Really a great game with great mods. I wish there was other games with such battles of engineering that involved real world skills!

Thread Thread
 
sebbdk profile image
Sebastian Vargr • Edited

Nice story, i wish i had gotten more into it when i had the time, that sounds awesome. :)

My scripts were probably simpler, i wrote some duplication/construction scripts for the turtles so they could copy and build things. I also included setup scripts etc. i kept in pastebins so i could configure the turtles for different tasks, supplier, mining, builder, farmer, logging etc.

I thought about making them autonomous by having them receive commands from pastebins that they would also ping back information to.

That way i could create a web GUI and control them with that instead.

But i never got around to it, because of the time it would take.... :D

Thread Thread
 
adam_cyclones profile image
Adam Crockett 🌀 • Edited

This is all way over my head, am I getting to old.. I did write some lua in gmod. Lua not in a gaming context to build apps as actually good as well. But I can see people enjoy it, actually it always seems to bring back memories from anyone who knows what it is. Lua has a very interesting back story you should check it out.

You see it embedded into games as a garbedge collected scripting language for the same reason it was invented, C was hard to write and had to be compiled, companies wanted to hire less skilled sometimes non technical people to write lua and not have to recompile C. Because lua runs in C it can even have C like performance, it also has a good package manager luarocks.

Sadly it's dead due to articles shunning its lack of market share, ignore this, lua is a fantastic language that I can't justify using for anything other than fun which is a shame. But I can name some webservers like nginx that actually script with lua and openresty, tons of games and a bunch more, it's just not known on the web side. Shame.