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

Peripheral crashes when running a program on multiple turtles at the same time

Started by Ajt86, 13 June 2014 - 08:43 AM
Ajt86 #1
Posted 13 June 2014 - 10:43 AM
So I am designing a turtle chess game on a server. Both my client and the server run Computercraft 1.63, and there are no other mods installed on the server side.

All 32 turtles use the same program, which when a specific packet is received will restart. If I restart the turtles one-by-one, it all works fine, but when I restart them all at the same time, about 10 - 15 (never the same ones) turtles crash with the same error
peripheral:45: No such method isPresentRemote

I checked the peripheral API at line 45 and it says:

if native.call(sSide, "isPresentRemote", _sSide) then

Code: http://pastebin.com/jbxfxecj

Note: I had to do turtle.equipLeft twice because I found a bug where it doesn't find the modem on my turtles.
Edited on 13 June 2014 - 09:28 AM
Bomb Bloke #2
Posted 13 June 2014 - 12:22 PM
Well that's most odd, and would strongly suggest the problem's within ComputerCraft itself - the issue is that it's mis-identifying the type of modem you're using, leading it to attempt to call a function only available to the wired model.

Assuming it's related to one (some?) of ComputerCraft's previously reported bugs, I'd suggest starting your script off with a one-second sleep instead of the turtle.equipLeft() business. With any luck that'll do the trick.
Ajt86 #3
Posted 13 June 2014 - 12:39 PM
The turtle.equipLeft business has got to do with another error where it would not find the modem, but thanks for the help.

Edit: It worked! Thanks!
Edited on 13 June 2014 - 10:51 AM
Bomb Bloke #4
Posted 13 June 2014 - 12:54 PM
To be clear, I was expecting the sleep to affect both issues, given that they're related.
Edited on 13 June 2014 - 10:55 AM