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

#421 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 31 March 2015 - 11:19 AM

For pepole interested in tab-completition it is split in textile api and bios read() function with a little inbetween inside lua and edit programs. Interesting read for sure will see how far I can make it dance. It should be doable to make it autocomplete filenames, paths and program names for shell. This will be fun to code!

Edit: Both gray colors are usable. That makes a huge difference. Feel the color! Oh and key_up and mouse_up will be fun to test.

Edited by wojbie, 31 March 2015 - 11:29 AM.


#422 Bomb Bloke

    Hobbyist Coder

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

Posted 31 March 2015 - 11:45 AM

The notes from the "whatsnew" app read (taken from the link provided by MKlegoman, as I can't even get the current pr to launch - I assume it's working for you guys?!):

Quote

+* Added tab-completion to the "edit" and "lua" programs.
+* Added textutils.complete(), and a completion function parameter to read().
+* Added "key_up" and "mouse_up" events.
+* Non-advanced terminals now accept both grey colours.
+* Added a "Run" button to the edit program on Advanced terminals.
+* Turtles now respect server spawn protection (configurable).
+* Added a turtle permissions API for mod authors.
+* Command Computers can no longer be broken by survival players.
+* Fixed the "pick block" key not working on ComputerCraft items in creative mode.
+* Added a "_CCVERSION" constant.


#423 Bomb Bloke

    Hobbyist Coder

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

Posted 31 March 2015 - 01:57 PM

Ah, that's better - pr14 is booting fine. :)

Auto-complete seems to be working well enough, though I'm a little surprised it's not active in the shell.

Command Computers are now indeed immune to survival-mode players (... and turtles, tnt, pistons + presumably everything else). The only thing left is perhaps removing their peripheral functions so that survival mode players can't eg restart or shut them down, perhaps.

The behaviour on "up" events works such that you must initially press down while the computer's GUI is active, and in the case of mouse events you must specifically click over the GUI, in order for them to fire when you let go. They don't automatically fire if the user closes the GUI, nor do you get a mouse_up event if the cursor isn't within the GUI's area on release. Minor niggles which're quite possible for scripters to code around, and it'll be interesting to see some drag'n'drop interfaces coded with them.

All in all, lookin' good! :)

#424 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 31 March 2015 - 03:51 PM

Updated the diff on GitHub from pr13 to pr14! Just follow the link for another surprise!

#425 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 31 March 2015 - 03:59 PM

Hmm. getTextColour and getBackgroundColour eh? That will make some parts of code less complicated.

I am with love with this auto-completion system. Got half-finished prototype for shell auto-completion function. After i finish it i will post if for other pepole to test. And i didn't crashed once on this test version. Makes me feel bad. Test versions are supposed to crash thats when you are testing stuff :D.

#426 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 31 March 2015 - 06:00 PM

Well, in addition to getting the terminal colors I'd say: improve all paintutils functions! Make them set the colors back to what it was when they are done drawing.

EDIT: total derp. That would brake a lot of scripts. I think I had something in mind for those function though, but I don't remember what...

Edited by MKlegoman357, 31 March 2015 - 08:41 PM.


#427 ElvishJerricco

  • Members
  • 803 posts

Posted 31 March 2015 - 07:03 PM

Wonderful update. Are there any plans to bring auto complete to the shell?

#428 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 31 March 2015 - 07:22 PM

Here is prototype of shell auto complete i am working on.

http://pastebin.com/iAisZ9VA

Right now it only lists all programs on empty input.
If it recognizes one of 4 basic programs it will suggest what is needed next and if there is space after program name it then will give you list of options.
Right now it only recognizes dj,monitor,pastebin and gps.

Most of code is based on my extended-shell project. And that project is full of spagetti code so starting clean is a good idea.

Edited by wojbie, 31 March 2015 - 07:23 PM.


#429 Bomb Bloke

    Hobbyist Coder

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

Posted 31 March 2015 - 08:20 PM

View PostMKlegoman357, on 31 March 2015 - 06:00 PM, said:

Well, in addition to getting the terminal colors I'd say: improve all paintutils functions! Make them set the colors back to what it was when they are done drawing.

That, um, would break a lot of scripts which rely on the current behaviour. Is it really a good idea?

#430 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 31 March 2015 - 08:26 PM

View PostMKlegoman357, on 31 March 2015 - 06:00 PM, said:

Well, in addition to getting the terminal colors I'd say: improve all paintutils functions! Make them set the colors back to what it was when they are done drawing.
Well what if i want to start drawing in another color after they are done? They change change color back at the end and then I change it to something else i want. Thats two changes instead of one. Kinda ineffective.

Sidenote: Anyone running beta server? That would be great way to test SMP part of update.

Edited by wojbie, 31 March 2015 - 08:27 PM.


#431 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 31 March 2015 - 08:42 PM

View PostBomb Bloke, on 31 March 2015 - 08:20 PM, said:

View PostMKlegoman357, on 31 March 2015 - 06:00 PM, said:

Well, in addition to getting the terminal colors I'd say: improve all paintutils functions! Make them set the colors back to what it was when they are done drawing.

That, um, would break a lot of scripts which rely on the current behaviour. Is it really a good idea?

View Postwojbie, on 31 March 2015 - 08:26 PM, said:

View PostMKlegoman357, on 31 March 2015 - 06:00 PM, said:

Well, in addition to getting the terminal colors I'd say: improve all paintutils functions! Make them set the colors back to what it was when they are done drawing.
Well what if i want to start drawing in another color after they are done? They change change color back at the end and then I change it to something else i want. Thats two changes instead of one. Kinda ineffective.

Yeah, I derped on this part...

#432 dan200

  • Administrators
  • 542 posts
  • LocationCambridge, England

Posted 02 April 2015 - 10:13 AM

Posted a new version, this is the current state of the changelog:

New Features in ComputerCraft 1.74:
* Added tab-completion to "edit", "lua" and the shell.
* Added textutils.complete(), fs.complete(), shell.complete() and shell.setCompletionFunction().
* Added an autocomplete parameters to read().
* Added "key_up" and "mouse_up" events.
* Non-advanced terminals now accept both grey colours.
* Added term.getTextColour(), term.getBackgroundColour() and term.blit().
* Improved the performance of text rendering on Advanced Computers.
* Added a "Run" button to the edit program on Advanced Computers.
* Turtles now respect server spawn protection (configurable).
* Added a turtle permissions API for mod authors.
* Command Computers can no longer be broken by survival players.
* Fixed the "pick block" key not working on ComputerCraft items in creative mode.
* Fixed the "edit" program being hard to use on certain European keyboards.
* Added a "_CCVERSION" constant.


#433 SquidDev

    Frickin' laser beams | Resident Necromancer

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

Posted 02 April 2015 - 11:01 AM

The shell completion looks really good. Thanks so much for adding this. Just so people know, blit allows you to draw one line to the terminal in the format blit(sText, sForeground, sBackground) using hex as the colours. I don't know what the performance gains are but I'm guessing they are pretty good.

Thanks Dan!

#434 Alekso56

  • Members
  • 62 posts

Posted 02 April 2015 - 11:08 AM

here be diff

#435 Bomb Bloke

    Hobbyist Coder

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

Posted 02 April 2015 - 12:04 PM

blit errors the window API in a rather messy way if you try to go outside the bounds of a window with it... It also allows colour rendering on a non-advanced computer! :P

Great to see autocomplete in the shell. :)

#436 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 02 April 2015 - 12:19 PM

Thanks for the diff. I am really interested in new shell autocomplete. It looks like instead of making next version of extended shell all I will have to do is to make patch containing extra autocomplete functions. And way it's setup I can see programs adding autocomplete data to shell automatically during first run.

#437 CrazedProgrammer

  • Members
  • 495 posts
  • LocationWageningen, The Netherlands

Posted 02 April 2015 - 12:26 PM

This is amazing!

I love the auto completion and the new mouse_up and key_up events.
Is using term.blit faster than using term.set______Color and term.write()?
If so, I'm going to make use of it in my Surface API.

#438 Bomb Bloke

    Hobbyist Coder

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

Posted 02 April 2015 - 12:36 PM

I suspect it'll depend on the scenario; say you want to write "This is a line of text", using white text on a black background. Using blit, it might go something like this:

local myText = "This is a line of text"
term.blit(myText, string.rep("f", #myText), string.rep("0", #myText))

That's rather inconvenient compared to using term.write, and becomes moreso as your text gets longer and starts to cover multiple lines.

But if you want to do rainbow colours, then:

term.blit("RAINBOW!","01234567","89abcdef")

That's a lot easier than what you'd previously've needed to do, and will almost certainly execute faster, too.

#439 Wojbie

  • Members
  • 631 posts
  • LocationKinda lost

Posted 02 April 2015 - 01:13 PM

I just realized. Way shell auto-complete its setup currently its impossible to make complicated auto-completition due to fact that and program is auto-completing 2nd word in argument list it will not be able to consider arguments entered before.. Per example program redstone has 3 possible arguments in first spot. Probe set and pulse. And each one of those has slightly different arguments after them. Well it will be fun to modify for my likes after all.
Anyone tested new window code? Is it faster after this change?

#440 dan200

  • Administrators
  • 542 posts
  • LocationCambridge, England

Posted 03 April 2015 - 10:32 PM

Posted pr18. Includes tab-completion for almost all built-in programs.





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users