Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

payonel

Developer
  • Content Count

    172
  • Joined

  • Last visited

  • Days Won

    14

Posts posted by payonel

  1. lua doesn't have preemptive threads, you have to have all threads (including the main thread) play cooperatively, everyone has to yield and place nice. plus, your code has some mistakes

    1. heatget() calls heatget, it does not return a function pointer. thread.create(ptr) takes a function ptr. I think you meant thread.create(heatget)

    2. heatget() never yields, you need something like os.sleep(0) in it.

    3. having one thread print and a different thread read user input will cause the cursor to print over itself, and it'll look messy. you want your printing thread to be sleeping while you're taking user input. This might not be a multi-threaded program you need

    4.I dont see a reason to call event.pull() before io.read() -- event.pull is going to block until ANY event, and io.read will then read key events. You could lose the first key press this way. I would just have io.read alone

  2. test things like `term.read()` in the lua shell, it'll help you see what is returned from it

    io.read() does not return a newline (nor does io.stdin:readLine(true))

    term.read() includes the newline in the return string (same as io.stdin:readLine(false)

    local pw = (term.read({pwchar='*'}) or ""):gsub("\n$", "")

     

    my use of {pwchar='*'} gets the same job done as your term.read(nil, false, nil, '*'), i just dont like the long param form of calling term.read

     

     

    now, why is it this way? because it has been this way for years.

  3. On 5/15/2019 at 11:46 AM, XyFreak said:

    When I tried to update my test instance I noticed that no new version of OC has been uploaded to curseforge yet.

    That means that the timer bug is still a thing in your OpenOS installations

    So the "fix" is to downgrade OC (and reinstall OpenOS afterwards) or do the thing at the bottom of my post here  

     

    That would explain why @ZeroNoRyouki runs into issues as well as all of your "calibration stuck" issues.

    I'm sorry but that is something I can't fix.

    Hello - sorry I don't have 1.7.5 out yet. That should be soon. In the meantime, rather than downgrading OC, I would recommend you just patch openos manually on each machine (tedious, sorry)

    (with an internet card, do this from your OC machine on the command line)

    wget -f https://raw.githubusercontent.com/MightyPirates/OpenComputers/master-MC1.12/src/main/resources/assets/opencomputers/loot/openos/lib/event.lua -O /lib/event.lua
    reboot

     

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.