Jump to content




Peripheral line 74, too long without yielding


  • You cannot reply to this topic
3 replies to this topic

#1 HedShot15

  • New Members
  • 2 posts

Posted 26 August 2017 - 10:43 AM

I am a starter in lua. I wrote this script to use on our smp forge server for the stargates: https://pastebin.com/PnVPDLG1 When it's running it works, but when, for example, I go through the stargate to another dimension, or just far enough to unload the chunks which the computer and the stargate is in, and I come back to this: https://i.imgur.com/EAgwanr
I even tried to copy the peripheral api to the computer root, make a new line after line 74 and add sleep(0.1) there, but it didn't work.
SG Craft, to my knowledge, loads the surrounding chunks as soon as dialling starts, and it would be great to have the computer start as soon as dialling, if not already.
I am looking forward to your answers.

#2 Wilma456

  • Members
  • 187 posts
  • LocationGermany

Posted 26 August 2017 - 05:19 PM

Change sleep(0) (Line 88) to sleep(0.1)

#3 The Crazy Phoenix

  • Members
  • 136 posts
  • LocationProbably within 2 metres of my laptop.

Posted 26 August 2017 - 07:45 PM

You don't need the sleep(0) on line 151, os.pullEvent already yields on its own.

#4 HedShot15

  • New Members
  • 2 posts

Posted 26 August 2017 - 08:33 PM

View PostWilma456, on 26 August 2017 - 05:19 PM, said:

Change sleep(0) (Line 88) to sleep(0.1)

View PostThe Crazy Phoenix, on 26 August 2017 - 07:45 PM, said:

You don't need the sleep(0) on line 151, os.pullEvent already yields on its own.
Thanks for your answers, it works!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users