Jump to content




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

help

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

#1 Ajt86

  • Members
  • 42 posts

Posted 13 June 2014 - 09: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 by Ajt86, 13 June 2014 - 10:28 AM.


#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 13 June 2014 - 11:22 AM

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.

#3 Ajt86

  • Members
  • 42 posts

Posted 13 June 2014 - 11:39 AM

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 by Ajt86, 13 June 2014 - 11:51 AM.


#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 13 June 2014 - 11:54 AM

To be clear, I was expecting the sleep to affect both issues, given that they're related.

Edited by Bomb Bloke, 13 June 2014 - 11:55 AM.






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users