This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
HedShot15's profile picture

Peripheral line 74, too long without yielding

Started by HedShot15, 26 August 2017 - 09:43 AM
HedShot15 #1
Posted 26 August 2017 - 11: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.
Wilma456 #2
Posted 26 August 2017 - 06:19 PM
Change sleep(0) (Line 88) to sleep(0.1)
The Crazy Phoenix #3
Posted 26 August 2017 - 08:45 PM
You don't need the sleep(0) on line 151, os.pullEvent already yields on its own.
HedShot15 #4
Posted 26 August 2017 - 09:33 PM
Change sleep(0) (Line 88) to sleep(0.1)
You don't need the sleep(0) on line 151, os.pullEvent already yields on its own.
Thanks for your answers, it works!