- Sky
- Blueberry
- Slate
- Blackcurrant
- Watermelon
- Strawberry
- Orange
- Banana
- Apple
- Emerald
- Chocolate
- Charcoal
redstorm64
-
Content Count
12 -
Joined
-
Last visited
Posts posted by redstorm64
-
-
So I added an end at line 77 in Josh's code and apparently everything works now. As far as I can tell, it's identical to the original code that I posted which is strange... Anyways, I'm just happy it works now. Thanks for the help guys!
-
Yeah, as soon as I add an extra 'end' at the very end, the program will run. However, I am not able to access an of the 'if' statements except for the "moe to" and "exit" sections... I'm beginning to think this is a bug and not a programming error...
-
@JoshTheEnder - Thanks for the help but I'm still getting the same error 'end' expected (to close 'while' at line 17) near <eof>
-
I've got a simple program that won't run due to an apparent missing "end" somewhere in the code. I've looked over the code a ridiculous number of times and can't find anything wrong with it. Hoping somebody is willing to review my code quick to see if I've missed something. I'm hoping I've just overlooked something simple.
I've run the program successfully in parts, with everything included except for the first if statement (line 28 thru 86). As soon as I add that section, I get an error looking for an 'end' to close the while loop at line 17 [see attached].
local component = require("component") local modem = component.modem local term = require("term") local event = require("event") local prgms = {"move to","home","unready","reportPos","exit"} local port = 100 print("Starting Robot Commander...") print("Opening port "..port.."...") modem.open(port) print("Port "..port.." open: :"..tostring(modem.isOpen(port))) os.sleep(1) local select = 0 while prgms[select] ~= "exit" do print("\n\nRobot Commander\n") print("1) Move robot to...") print("2) Send robot home") print("3) Exit robot ready state\n (unable to restart remotely)") print("4) Report robot position") print("5) Exit Robot Commander\n") select = tonumber(io.read()) if prgms[select] == "move to" then local mode local valid = false while valid == false do print("\n(R)elative or (absolute) movement?") mode = io.read() if mode == "r" or mode == "R" then print("Enter x-distance:") xTarget = io.read() print("Enter y-distance:") yTarget = io.read() print("Enter z-distance:") zTarget = io.read() valid = true elseif mode == "a" or mode == "A" then print("Enter x-target:") xTarget = io.read() print("Enter y-target:") yTarget = io.read() print("Enter z-target:") zTarget = io.read() valid = true else print("Error: Must enter 'a' or 'r' for mode...\n") end end valid = false while valid == false do print("\nMode\tx\ty\tz") print(tostring(mode).."\t"..xTarget.."\t"..yTarget.."\t"..zTarget) print("Send command? ('y' or 'n')") option = io.read() if option == "y" or option == "Y" then modem.broadcast(100,1,xTarget,yTarget,zTarget,tostring(mode)) print("Command sent") valid = true elseif option == "n" or option == "N" then print("Please re-select command.") valid = true else print("Error: Must enter 'y' or 'n'") end end end if prgms[select] == "home" then modem.broadcast(port,2) end if prgms[select] == "unready" then modem.broadcast(port,3) end if prgms[select] == "reportPos" then local pos = {} modem.broadcast(port,4) pos = {event.pull(10,"modem")} print(pos[6].." "..pos[7].." "..pos[8]) print("press any key to continue") os.sleep(3) io.read() end if prgms[select] == "exit" then print("Exiting Robot Commander...") os.sleep(1) end end
-
Here is a link to the Github issue Ender mentioned: https://github.com/MightyPirates/OpenComputers/issues/637
this seems like a similar issue to issue #637 on github (tablet wont let me paste link)
Yeah, looks like pretty much the same thing. Unfortunately it doesn't look like there has been a root cause or fix identified yet.
-
Yes, all 3 times this has happened, the robot disappeared right in front of me. It has happened while I've been testing my program so I've always followed the robot to make sure it goes where I expect it to.
-
Anybody else having issues where their robot(s) keep disappearing? I've had it happen several times just while commanding the robot to move around. The first time it disappeared it randomly showed up again several minutes later. The last 2 times it never came back. Very frustrating in smp... Any way this can be fixed? I'm running on 1.4.0.6-rc.1.
-
Your problem is is that the second argument to shell.execute is the environment to run the program in. You are probably looking for os.execute, which doesn't pull shenanigans like this. You give os.execute one string, which is the program name followed by the arguments, the same as in the shell.
os.execute("prgm_name arg1 arg2")
Exactly what I was looking for. Program is working great now, thank you!
-
I'm wondering how to call a program from within another program and pass it arguments. I've gotten close by using the "shell.execute()" command but once it get into the 2nd program it get's a bit unhappy... It doesn't like that I'm "requiring" things at again in the 2nd program... Is there another command I should be using instead of "shell.execute()"?
Here is how I'm using it currently:
shell.execute("prgm_name",{arg1,arg2})
-
Looks like if I use a power converter to supply power to the charger then it resets correctly. Must be just a bug with sending IC2 power directly to the charger.
-
I'm new to OC and am wondering if I'm using the charger block wrong or if there is a bug. Basically, the charger block for charging robots won't stay active after a robot is charged. Even with a constant redstone signal (and IC2 power), the second time I try to recharge a robot, nothing happens. In order to make it work I have to break the charger block and replace it. Something I'm doing wrong?
Loving the mod so far though!!
Unable to craft Disassembler with NEI recipe
in Miscellaneous
Posted
I'm unable to craft the Disassembler with the recipe from NEI. Bug or do I have the wrong recipe somehow? On OC 1.4.06-rc.1.