Jump to content


Luca_S

Member Since 09 Nov 2014
Offline Last Active Yesterday, 04:09 PM
*****

Posts I've Made

In Topic: ATLX-L3L1 Compiler

20 January 2019 - 04:08 PM

Really nice tool! I think this is already useful at it's current state. It makes it easier to see where errors are and it also can catch (some) runtime errors, which could make it useful to check bigger projects.You might want to think about releasing the part of the program that's already working just as an error checker.

In Topic: Can't end program using error() function in parallel? What alternative ca...

05 January 2019 - 07:50 AM

View PostBambel Boar, on 05 January 2019 - 05:53 AM, said:

I also numbered the lines which I know is not common practice but it parses fine and it helps me to explain what I'm talking about above.
If you need line numbers you can upload your code to pastebin and it will allow people to easily download your code to ComputerCraft if necessary.

Ending your program with error() is not a really good idea in most cases, for the usage case I would recommend something like this:
if #args < 1 then
  printUsage()
  return
end

Instead of putting the while loop around parallel.waitForAny, I would you recommend you that you put it in each function, like this:
function send()
  local bRunning = true
  while bRunning do
    -- Current send() code
  end
end
function receive()
  while true do
    -- Current receive() code
  end
end

By using this you can always exit the send function by using:
bRunning = false

In Topic: buttons

04 January 2019 - 11:57 AM

Take a look at "Posting a Good Question" and "Get Help Faster" here otherwise you probably won't get many answers.

Also you shouldn't start by working on an OS, if you want to do it properly an OS is a very complicated and big project. It is better to start out with a few smaller projects, to gain experience first.

In Topic: Corrupt-A-Wish!

23 November 2018 - 04:37 PM

Granted, you have an incredibly fast connection, but all sites rate limit you to 50kB/s

I wish for a golden crown

In Topic: Question regarding read()

05 October 2018 - 09:15 PM

Another option would be to queue a char and key event and then call the next program while being careful not to yield. But that only works if the program you are trying to call does not yield(call os.pullEvent, os.pullEventRaw or coroutine.yield) before calling read():

while true do
  os.queueEvent("char", "y")
  os.queueEvent("key", keys.y)
  os.queueEvent("key", keys.enter)
  shell.run("YourProgram")
end