MightyPirates / OpenComputers

Home of the OpenComputers mod for Minecraft.
https://oc.cil.li
Other
1.59k stars 431 forks source link

If you turn off a robot (stuck in a loop) - you can no longer turn on any robots from that point on the world #191

Closed Sabster closed 10 years ago

Sabster commented 10 years ago

And while I'm at it; CTRL-T to terminate programs don't work either.

I was testing programs - had a robot run into obsidian (was testing the program - for when you have an iron pick, and hit obsidian) - I not only couldn't terminate the program, when I turned off the robot.

This is repeatable. Create a loop - turn off the robot; and then try turning it back on (using the lastest version 1.2.4.97 - for MC 1.7.2)

Sabster commented 10 years ago

I placed a robot in the world - turned it off - and no robot will turn back on... :( I'm in creative mode...

fnuecke commented 10 years ago

I'm afraid I can't reproduce this.

Also try the latest dev build (I can't reproduce in that build, either, but who knows).

Sabster commented 10 years ago

going to try it right now - but here's what I did:

Here's the shell program I was working on (so you can see the code I'm writing) - basically, I'm trying to make the tryMove function 'bounce' off bedrock.

I'm using 1.2.4.97 - 1.7.2 - latest forge. Creative mode Place robot on ground put bedrock in front of robot - (3 high)

run "shell 5" - it is supposed to move up - forward 1 step - dig up and down - repeat until the end; then drop down and stop. The problem is, you hit the bedrock and I'm trying to make the code so it hits the bedrock - detects if it's a "block" and swings at it (if it can't remove what's in front of it, and it detects as a block - that means the tool can't remove that particular block (like bedrock)) - at that point, I want it to 'blow off' that command and go to the next step until the end of the program. It doesn't - and if you turn off the machine, no robot will turn on from that point.

I'm going to try the latest dev build - and see what happens... Let you know shortly.

Date: Tue, 1 Apr 2014 08:43:14 -0700 From: notifications@github.com To: OpenComputers@noreply.github.com CC: tyrellan@hotmail.com Subject: Re: [OpenComputers] If you turn off a robot (stuck in a loop) - you can no longer turn on any robots from that point on the world (#191)

I'm afraid I can't reproduce this.

What system is this on (i.e. using the natives or LuaJ?) What's the exact script you're using? Anything in the logs after trying to turn the robot on? Does the Analyzer say anything when used on the robot after trying to turn it on? Also try the latest dev build (I can't reproduce in that build, either, but who knows).

— Reply to this email directly or view it on GitHub.

Sabster commented 10 years ago

Nope - does it on the latest dev build as well.

So again:

place robot put stack of obsidian in front of robot shell 5 robot will move up - try and move forward but hit the bedrock - turn off power and from that point on, no robot will turn on...

Date: Tue, 1 Apr 2014 08:43:14 -0700 From: notifications@github.com To: OpenComputers@noreply.github.com CC: tyrellan@hotmail.com Subject: Re: [OpenComputers] If you turn off a robot (stuck in a loop) - you can no longer turn on any robots from that point on the world (#191)

I'm afraid I can't reproduce this.

What system is this on (i.e. using the natives or LuaJ?) What's the exact script you're using? Anything in the logs after trying to turn the robot on? Does the Analyzer say anything when used on the robot after trying to turn it on? Also try the latest dev build (I can't reproduce in that build, either, but who knows).

— Reply to this email directly or view it on GitHub.

fnuecke commented 10 years ago

You still only answered ~15% of my questions ;-)

Sabster commented 10 years ago

sorry; was half asleep:

1) Using the natives (we didn't modify anything - except to turn fuel off in the cofigs. 2) the actual code causing the issue:

--[[ tryMove(f, u or d) ]]-- local function tryMove(side) if r.move(side) == false then local _, what = r.detect(side) if r.detect(side) and what == "solid" and r.swing(side) == false then --[[ obsidian ]]-- io.write("Bedrock found! :( \n") return else while not r.move(side) do r.swing(side) end end end end

3) I don't see anything in the logs - The only 'warning' or 'error' message is this - most of it is loading the mod; unloading the mod - etc...

[15:59:19] [Client thread/WARN] [OpenComputers/]: Mod OpenComputers is missing the required element 'version' and a version.properties file could not be found. Falling back to metadata version 1.2.4.97

I had started a new log - but it's still too big to paste at pastebin :(

4) This is what the analyzer said from a 'defunct' robot:

[16:13:59] [Client thread/INFO]: [CHAT] §6Owner§f: Sabster76 [16:13:59] [Client thread/INFO]: [CHAT] §6Name§f: Robot [16:13:59] [Client thread/INFO]: [CHAT] §6Experience§f: 57650.38 (Level 30) [16:13:59] [Client thread/INFO]: [CHAT] §6Last error§f: kernel:510: boot/01_os.lua:4: ./shell.lua:5: module 'robot' not found: no field package.preload['robot'] no file './robot.lua' no file '/lib/robot.lua' no file '/usr/lib/robot.lua' no file '/home/lib/robot.lua' [16:13:59] [Client thread/INFO]: [CHAT] §6Number of connected components§f: 4/8 [16:13:59] [Client thread/INFO]: [CHAT] §6Total stored energy§f: 199782.99/200000.00 [16:13:59] [Client thread/INFO]: [CHAT] §6Component name§f: computer [16:13:59] [Client thread/INFO]: [CHAT] §6Address§f: 1cdb7d79-2d58-4a5c-b5cd-8f5f23044904

Hope that's better - I work graveyard so I was just going to sleep :)

Date: Tue, 1 Apr 2014 12:11:03 -0700 From: notifications@github.com To: OpenComputers@noreply.github.com CC: tyrellan@hotmail.com Subject: Re: [OpenComputers] If you turn off a robot (stuck in a loop) - you can no longer turn on any robots from that point on the world (#191)

You still only answered ~15% of my questions ;-)

What system is this on (i.e. using the natives or LuaJ?)

What's the exact script you're using? An actual minimal code sample, please. Anything in the logs after trying to turn the robot on? Does the Analyzer say anything when used on the robot after trying to turn it on?

— Reply to this email directly or view it on GitHub.

Sabster commented 10 years ago

GAH! I found the problem

My program was called 'shell.lua' - it was overriding YOUR 'shell.lua' - so as soon as I renamed it to 'MyAPI.lua' - all the turtles started turning on!

So, you may want to add: "don't be dumb like Sabster was, and create programs named after our programs - they will override!" :)

fnuecke commented 10 years ago

Oooh, so you put that script in the [saves]/opencomputers/rom/Lua folder? Yeah, that explains that. I see the include path for libraries still tries the working directory first - the PATH has been adjusted quite a while back to not be that way, but I forgot to also apply that to the package search path as well. Thanks for reporting this and figuring it out!