Jump to content




ComputerCraft Beta Versions - Download and Discussion (1.74pr37, released June 22nd)


  • This topic is locked This topic is locked
525 replies to this topic

#361 Lignum

  • Members
  • 558 posts

Posted 31 January 2015 - 06:44 PM

Things I've found:
  • If there's a file called .no_disk_startup, the computer won't boot from disk. In addition to that, command computers can't boot from disk at all.
  • Edit's ctrl menu text is now shorter on pocket computers.
  • The commands api, of course.
  • Exec program that executes commands (just like you would on a command block).
  • textutils.serialiseJSON - Serialises a table to JSON
  • You can now divide and multiply vectors.
  • The string metatable hack no longer works.

Edited by Lignum, 31 January 2015 - 06:45 PM.


#362 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 31 January 2015 - 06:48 PM

I'd love to see a JSON unserializer to go with the new serializer.

#363 ElvishJerricco

  • Members
  • 803 posts

Posted 31 January 2015 - 09:05 PM

local bEnableDiskStartup = (commands == nil) and not fs.exists( ".no_disk_startup" )

This is indeed weird... There's always been the safety net that if a computer were to be taken over maliciously, a startup disk would save you. It's not really a big deal. I mean how malicious can you get with highly sandboxed computers in a video game? But it's an interesting change in philosophy.

#364 Shnupbups

  • Members
  • 596 posts
  • LocationThat place over there. Y'know. The one where I am.

Posted 31 January 2015 - 11:21 PM

Great, now viruses just have to make a blank file called '.no_disk_startup' and then almost nothing will save you. Especially if you don't have access to the server files...

Anyway, the command computers are awesome, so there's that.

Edited by Shnupbups100, 31 January 2015 - 11:21 PM.


#365 Bomb Bloke

    Hobbyist Coder

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

Posted 31 January 2015 - 11:39 PM

A startup disk is only helpful if a griefer decides to install a Ctrl+T-ignoring startup script, as opposed to, say, wiping the drive or stealing the whole computer block. The latter options are far easier for them to perform, and I would be highly surprised if anyone here has had a griefer take the former option.

Seems to me that the best protection remains as "physical" - that is to say, surround systems you're worried about with warded blocks or whatever.

Every case I've seen reported where the owner of a system has needed a startup disk to get back in has involved them overriding os.pullEvent then making a mistake in their own code, locking them out of their own computer. They most often serve as a safety net against user error, not malicious activity! So for those who like developing "secure scripts" (imagine a finger-waggling action to go with that particular set of quotes), I recommend against using the new file until you're sure there's no errors to weed out!

#366 ElvishJerricco

  • Members
  • 803 posts

Posted 01 February 2015 - 05:11 AM

Well, perhaps it would be best if instead of having a ".no_disk_startup" file, we just have a ".no_startup" file, to prevent computers from being able to be taken over while preventing disk startup files.

The downsides are obvious. It slightly defeats the original intent of ".no_disk_startup", but I think it's better than letting a system be taken over.

Edited by ElvishJerricco, 01 February 2015 - 05:11 AM.


#367 Shnupbups

  • Members
  • 596 posts
  • LocationThat place over there. Y'know. The one where I am.

Posted 01 February 2015 - 07:27 AM

<snip> never mind me, 'twas an accident

Edited by Shnupbups100, 01 February 2015 - 07:28 AM.


#368 dan200

  • Administrators
  • 542 posts
  • LocationCambridge, England

Posted 01 February 2015 - 08:24 AM

View PostElvishJerricco, on 31 January 2015 - 09:05 PM, said:

local bEnableDiskStartup = (commands == nil) and not fs.exists( ".no_disk_startup" )

This is indeed weird... There's always been the safety net that if a computer were to be taken over maliciously, a startup disk would save you. It's not really a big deal. I mean how malicious can you get with highly sandboxed computers in a video game? But it's an interesting change in philosophy.

This is a very good point. I'll remove the feature, it's not worth plugging a small security hole by introducing a bigger one! Disk startup remains disabled on command computers though, otherwise it would be trivial for non-admin users to use them and takeover a server.

#369 Bomb Bloke

    Hobbyist Coder

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

Posted 01 February 2015 - 09:40 AM

I dunno, I kinda like the idea of being able use startup disks with creative-mode computers (if only because networking a single disk drive to multiple computers is an easy way to make them share the one startup file). Would you consider adding an eg ".use_disk_startup" file-check for creative-mode computers, just so the option's there?

#370 dan200

  • Administrators
  • 542 posts
  • LocationCambridge, England

Posted 01 February 2015 - 10:25 AM

You can just put shell.run( "disk/startup" ) in startup to opt-in to that

#371 Bomb Bloke

    Hobbyist Coder

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

Posted 01 February 2015 - 02:02 PM

D'oh! How do I manage to miss these things....

Anyway, here's a cute little "proof-of-concept" script. Plonk down a command computer somewhere (a decent distance from anything important to you) and execute:

pastebin run ZbZiB9GR

It's a bit messy and crude, but it could be polished up into something pretty cool. :)

Oh, how about more disk space for command computers?

Edited by Bomb Bloke, 01 February 2015 - 02:04 PM.


#372 Exerro

  • Members
  • 801 posts

Posted 01 February 2015 - 06:42 PM

I've also done some testing and found that running commands causes a coroutine yield, so by running every command in an individual coroutine you can get some decent building speeds. Not sure if this puts a lot of strain on the server, but running ~100 at a time would be fine I'm sure.

I'm definitely going to make a world edit API with these new computers, and some kind of game engine... an RPG game engine maybe... imagine the possibilities.

Edit: further testing has shown that commands (after being executed) fire "task_completed" events, which determines what the command call returns (true or false, "Command failed"). I have, however, created a setblock command that also takes replace_block as an optional parameter which causes it to only replace blocks of a certain type at the cost of a bit of lag. Now for boxes, spheres and cylinders...

Edited by awsumben13, 01 February 2015 - 07:43 PM.


#373 SquidDev

    Frickin' laser beams | Resident Necromancer

  • Members
  • 1,427 posts
  • LocationDoes anyone put something serious here?

Posted 01 February 2015 - 07:49 PM

View Postawsumben13, on 01 February 2015 - 06:42 PM, said:

I've also done some testing and found that running commands causes a coroutine yield, so by running every command in an individual coroutine you can get some decent building speeds. Not sure if this puts a lot of strain on the server, but running ~100 at a time would be fine I'm sure.

I'm definitely going to make a world edit API with these new computers, and some kind of game engine... an RPG game engine maybe... imagine the possibilities.

You can also use execAsync (or async.functionName) to get a similar effect I think.

When 1.8 comes out we can use fill instead, which should speed up drawing even more.

I'm wondering if commands.getBlockInfo could return NBT as well? I'm not that well versed on Forge/Minecraft internals so I don't know how feasible this is.

I am very excited about this update though! Thanks Dan!

Edited by SquidDev, 01 February 2015 - 07:50 PM.


#374 dan200

  • Administrators
  • 542 posts
  • LocationCambridge, England

Posted 01 February 2015 - 07:53 PM

View Postawsumben13, on 01 February 2015 - 06:42 PM, said:

I've also done some testing and found that running commands causes a coroutine yield, so by running every command in an individual coroutine you can get some decent building speeds. Not sure if this puts a lot of strain on the server, but running ~100 at a time would be fine I'm sure.

I'm definitely going to make a world edit API with these new computers, and some kind of game engine... an RPG game engine maybe... imagine the possibilities.

Edit: further testing has shown that commands (after being executed) fire "task_completed" events, which determines what the command call returns (true or false, "Command failed"). I have, however, created a setblock command that also takes replace_block as an optional parameter which causes it to only replace blocks of a certain type at the cost of a bit of lag. Now for boxes, spheres and cylinders...

Yep, commands.async.whatever() or commands.execAsync( "whatever") will do issue the command without waiting for the return value. Should be well documented in the help file

#375 masterdisasterHD

  • Members
  • 172 posts
  • LocationThe Netherlands

Posted 01 February 2015 - 08:30 PM

Any chance of colorable pocket computers in the next version?

#376 pcguru000

  • New Members
  • 1 posts

Posted 01 February 2015 - 08:42 PM

huge thanks to dan for the 1.66 beta update fixing the rendering bug for monitors... was killing my teleportation system to my new dance dance hall :) good work :D

#377 CreeperWiz

  • Members
  • 116 posts
  • LocationOn earth!

Posted 02 February 2015 - 09:59 PM

View PostmasterdisasterHD, on 01 February 2015 - 08:30 PM, said:

Any chance of colorable pocket computers in the next version?
? Like turtles you mean?

Edited by iCoder, 02 February 2015 - 09:59 PM.


#378 Thatparadox

  • Members
  • 12 posts

Posted 03 February 2015 - 02:10 AM

Loving the Command Computer. I can't figure out how you add data to spawn mobs with certain properties (NBT tags).

So if I'm trying to spawn an invincible cow in console it would be: /summon Cow ~0 ~0 ~0 {Invulnerable:1}

I can summon a cow with commands.summon("Cow", x, y, z) but how do I add the {Invulnerable:1} to the code?

Edited by Thatparadox, 03 February 2015 - 02:12 AM.


#379 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 03 February 2015 - 07:12 AM

You can either pass it as a string or use the new textutils.serialiseJSON( table ) to convert a table into JSON. You can also pass the table directly.

EDIT: example:

local parameters = { Invulnerable = 1 }

commands.summon( "Cow 15 75", 50, parameters ) --# yes, you can put all arguments into one string

EDIT 2: you can actually pass a table directly into commands.*. Updated the example.

Edited by MKlegoman357, 03 February 2015 - 07:30 AM.


#380 masterdisasterHD

  • Members
  • 172 posts
  • LocationThe Netherlands

Posted 03 February 2015 - 07:19 AM

View PostiCoder, on 02 February 2015 - 09:59 PM, said:

View PostmasterdisasterHD, on 01 February 2015 - 08:30 PM, said:

Any chance of colorable pocket computers in the next version?
? Like turtles you mean?

Yeah





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users