KingofGamesYami, on 06 January 2016 - 09:51 PM, said:
- ComputerCraft | Programmable Computers for Minecraft
- → k1ll3rM's Content
k1ll3rM's Content
There have been 7 items by k1ll3rM (Search limited from 29-March 23)
#242592 Getting turtle direction
Posted by k1ll3rM on 07 January 2016 - 03:33 PM in Ask a Pro
Bomb Bloke, on 06 January 2016 - 11:25 PM, said:
Alternatively, Lion4ever came up with a clever solution here.
#242528 Getting turtle direction
Posted by k1ll3rM on 06 January 2016 - 09:46 PM in Ask a Pro
KingofGamesYami, on 06 January 2016 - 09:44 PM, said:
There is no function in computercraft that tells a turtle which way it is facing. You can find which way you are facing by setting up a GPS cluster and using gps.locate(), then moving forward and using gps.locate() again. Depending on the variable which changed, and if it incremented or decremented, you can find if you are moving north / south / east / west.
#242524 Getting turtle direction
Posted by k1ll3rM on 06 January 2016 - 09:40 PM in Ask a Pro
I have been looking for a while for a working function to get the direction my turtle is facing with no luck. So now I gave up on looking for it and decided to ask it here! Is there any easy code for getting the direction as a number (like in the F3 menu)? I'm still fairly new to this so I would like a bit of an explanation/example on how I would use it combined with my own code. Thank you in advance
#206621 Monitor loop not working
Posted by k1ll3rM on 21 February 2015 - 10:15 PM in Ask a Pro
HPWebcamAble, on 21 February 2015 - 08:39 PM, said:
What I think is happening is your program never gets to the loop
I'm bored so I rewrote your program
I used the Parallel API. I'd bet you haven't used it before, but it's pretty simple. Here is the Wiki for it: http://computercraft...allel_%28API%29
I'm bored so I rewrote your program
I used the Parallel API. I'd bet you haven't used it before, but it's pretty simple. Here is the Wiki for it: http://computercraft...allel_%28API%29
mon = peripheral.wrap("right") function list() --#shell.run("ToDoList") No idea what this is. Probably another program of yours? while true do sleep(1) local cTime = os.time() cTime = textutils.formatTime(cTime, false) mon.setCursorPos(10,26) mon.write("Day " .. tostring(os.day())) mon.setCursorPos(1,26) mon.write(atime) end end function getInput() while true do --#loops forever local input = read() --#Waits for input if input == "stop" then break --#stops the loop else print("Unknown Command") end end end while true do --#Continues forever term.clear() term.setCursorPos(1, 1) print("Enter Command:") local input = read() if input == "list" then parallel.waitForAny(list,getInput) --#Basically this allows both to run at the same time. When either stops, the other is also stopped elseif input == "exit" then print("Exiting...") sleep(1) break --#Stops the loop else print("Unknown command") end end
#206642 Monitor loop not working
Posted by k1ll3rM on 21 February 2015 - 11:13 PM in Ask a Pro
k1ll3rM, on 21 February 2015 - 10:15 PM, said:
HPWebcamAble, on 21 February 2015 - 08:39 PM, said:
What I think is happening is your program never gets to the loop
I'm bored so I rewrote your program
I used the Parallel API. I'd bet you haven't used it before, but it's pretty simple. Here is the Wiki for it: http://computercraft...allel_%28API%29
I'm bored so I rewrote your program
I used the Parallel API. I'd bet you haven't used it before, but it's pretty simple. Here is the Wiki for it: http://computercraft...allel_%28API%29
mon = peripheral.wrap("right") function list() --#shell.run("ToDoList") No idea what this is. Probably another program of yours? while true do sleep(1) local cTime = os.time() cTime = textutils.formatTime(cTime, false) mon.setCursorPos(10,26) mon.write("Day " .. tostring(os.day())) mon.setCursorPos(1,26) mon.write(atime) end end function getInput() while true do --#loops forever local input = read() --#Waits for input if input == "stop" then break --#stops the loop else print("Unknown Command") end end end while true do --#Continues forever term.clear() term.setCursorPos(1, 1) print("Enter Command:") local input = read() if input == "list" then parallel.waitForAny(list,getInput) --#Basically this allows both to run at the same time. When either stops, the other is also stopped elseif input == "exit" then print("Exiting...") sleep(1) break --#Stops the loop else print("Unknown command") end end
#206565 Monitor loop not working
Posted by k1ll3rM on 21 February 2015 - 05:58 PM in Ask a Pro
I have a problem with the program I wrote but I have no idea how to fix it! I've been searching everywhere but I can't find a solution. I'm a beginner so I would love to have some help!
The problem is that the monitor is not getting it's clock updated as the loop should do! the program is for an over-complicated To Do List just so I have a little project to work on.
here is the code:
The problem is that the monitor is not getting it's clock updated as the loop should do! the program is for an over-complicated To Do List just so I have a little project to work on.
here is the code:
mon = peripheral.wrap("right") function list() local input2 = read() if input2 == ("stop") then start() else print("Unknown Command") list() end shell.run("ToDoList") while not guess == 3 do sleep(0.3) time = os.time() atime = textutils.formatTime(time, false) mon.setCursorPos(10,26) mon.write("Day " .. tostring(os.day())) mon.setCursorPos(1,26) mon.write(atime) end end function start() term.clear() term.setCursorPos(1, 1) print("Enter Command: ") local input = read() if input == ("exit") then os.reboot() elseif input == "list" then list() start() else print("Unknown Command") start() end end start()
- ComputerCraft | Programmable Computers for Minecraft
- → k1ll3rM's Content