Jump to content


GamerNebulae's Content

There have been 104 items by GamerNebulae (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#197893 Determine facing of a turtle

Posted by GamerNebulae on 08 November 2014 - 09:33 AM in Ask a Pro

Hello everyone,

I was tinkering with a turtle and decided to try a multiple turtle quarry (which I have possibly seen in an old video of Eloraam) and I was wondering about how you could determine the facing of a turtle as efficiently as possible. I thought about moving one way, see what the x- or z-axis would do, but that would be inefficient. Is there another way?



#191474 Error bioss:366 'end' expected in my security program please help!

Posted by GamerNebulae on 17 August 2014 - 09:59 PM in Ask a Pro

first of all, you put your code in the [ CODE ] [ / CODE ] brackets. The error means you forgot an end somewhere. I would suggest using indentations in your code and you would see in in no-time.



#191459 How to put comas between valors in a function

Posted by GamerNebulae on 17 August 2014 - 08:04 PM in Ask a Pro

View PostAnavrins, on 17 August 2014 - 05:56 PM, said:

-snip-

Yeah, I never understood the string manipulation of Lua well.



#191442 How to put comas between valors in a function

Posted by GamerNebulae on 17 August 2014 - 04:39 PM in Ask a Pro

Here's the function:

function comma(text)
    local textTable = {}
    for char in string.gmatch(text, ".") do
        textTable[#textTable + 1] = char
    end

    local commaCount = math.floor(#text / 3)
    if (#text % 3 == 0) then
        commaCount = commaCount - 1
    end

    local base = #textTable - 2
    for i = 0, commaCount - 1 do
        table.insert(textTable, (base - (i * 3)), ",")
    end

    local commaText = ""
    for k,v in pairs(textTable) do
        commaText = commaText..v
    end

    return commaText
end

EDIT: fixed a bug where numbers beyond one billion weren't readable (commas in wrong places)



#191434 How to put comas between valors in a function

Posted by GamerNebulae on 17 August 2014 - 02:55 PM in Ask a Pro

View PostsEi, on 17 August 2014 - 02:29 PM, said:

-snip-

I have been working on this and if the OP waits an hour or two I will post a solution.



#191412 Duck Antenna

Posted by GamerNebulae on 17 August 2014 - 09:18 AM in Ask a Pro

View PostBomb Bloke, on 17 August 2014 - 02:31 AM, said:

-snip-

I tried to read that beforehand, but if I open the documentation link I get a 404. So that's why I asked the question here.



#191380 Duck Antenna

Posted by GamerNebulae on 16 August 2014 - 11:26 PM in Ask a Pro

View Postincinirate, on 16 August 2014 - 11:24 PM, said:

-snip-

My question was more in the sense of: what are the functions and how can I use them?



#191377 Duck Antenna

Posted by GamerNebulae on 16 August 2014 - 11:13 PM in Ask a Pro

Small question about the duck antenna. How the hell does it work?



#187905 Annoying bug

Posted by GamerNebulae on 15 July 2014 - 12:44 PM in Ask a Pro

View Posttheoriginalbit, on 15 July 2014 - 12:32 PM, said:

-snip-

Pardon me then. I have been trying to learn Java and C# which are consistent languages, whilst Lua has 3 ways to write something. Read theoriginalbit's answer please.



#187901 Annoying bug

Posted by GamerNebulae on 15 July 2014 - 12:18 PM in Ask a Pro

You're not declaring a function the right way. The correct way is this:
function load(path)
  --#Code here...
end



#186775 ComputerCraft Mining Turtle Gravel check ideas?

Posted by GamerNebulae on 03 July 2014 - 08:05 PM in Ask a Pro

View Posthusplante, on 03 July 2014 - 06:55 PM, said:

-snip-

Just to shorten the code, I always use the keyword "not". It basically means "false". Example:
statement = false
if (not statement) then
  print("Statement was "..statement)
end
--#Output: Statement was false

The problem with your code at the moment is, it will run into a piece of gravel and if the stack of gravel is higher than 2, then it will not work. So please just use my code, otherwise it will not work.



#186708 ComputerCraft Mining Turtle Gravel check ideas?

Posted by GamerNebulae on 03 July 2014 - 01:34 PM in Ask a Pro

First of all, since you are new on the forums, always paste code in between the [.CODE] [/CODE] tags (without the dots). I made a branching program a long time ago and it still works fine. This is how it runs (assuming that you want it to wait when gravel falls down):
function notMoving()
	    while not turtle.forward() do
			    turtle.dig()
			    sleep(1)
	    end
end

While it cannot move forwards, it will dig in front of himself and he will then wait. If he cannot move again, then he will repeat the same thing over and over and over again.



#186280 Get pressure from Pneumaticcraft

Posted by GamerNebulae on 30 June 2014 - 06:07 PM in Ask a Pro

We've had this problem on the forums before. The problem is that it's only possible with machines (as far as I am concerned) and to read the pressure from a pipe, you need to use the Pressure Gauge Tubes (as far as I know, I do not play with the mod) and convert the redstone signal to the pressure. In the tool-tip of the pipe it says the formula.



#185887 Need help with sensor door.

Posted by GamerNebulae on 27 June 2014 - 08:10 PM in Ask a Pro

View PostKingMinecrafter, on 27 June 2014 - 04:54 PM, said:

-snip-

You could just use this if you want to clear 1 line:
m.setCursorPos(1,y)
m.clearLine()



#185865 Need help with sensor door.

Posted by GamerNebulae on 27 June 2014 - 04:43 PM in Ask a Pro

You only have to write it once to a monitor. You don't have to constantly write it over and over again. It's getting stuck in the while-loop.



#185742 Need help with sensor door.

Posted by GamerNebulae on 26 June 2014 - 10:47 PM in Ask a Pro

What the hell is wrong exactly?! :S



#185690 IC2 + ComputerCraft

Posted by GamerNebulae on 26 June 2014 - 05:26 PM in Ask a Pro

View PostLoneWolf, on 26 June 2014 - 05:25 PM, said:

-snip-

First of all: get some basic experience, that's the only tip I give you right now.



#185682 IC2 + ComputerCraft

Posted by GamerNebulae on 26 June 2014 - 04:51 PM in Ask a Pro

Well... euhm... There is not really a short answer to that...



#185677 help needed on program trying to get pnumaticcraft pressure

Posted by GamerNebulae on 26 June 2014 - 04:39 PM in Ask a Pro

I presume you mean the Advanced Pressure Gauge Tube. The problem you are thinking about is non-existent. You need to convert the redstone signal to a number. You can do this with this formula:
pressure = rs.getAnalogInput(side) / (2/3)



#185662 help needed on program trying to get pnumaticcraft pressure

Posted by GamerNebulae on 26 June 2014 - 03:12 PM in Ask a Pro

Let me clarify a bit. The methode I gave you, textutils.serialize(table), is a method to print out a table without a for-loop and I changed the print to print out the table in that manor. Pressure is a table you get by "asking" a peripheral called "valve" to get you the result of the method getPressure(). That appears to be a table. So if you got the variable pressure and use the code I gave you, you're set.

valve = peripheral.wrap(side) --#Please change side to the side where the peripheral is touching the computer.
print(textutils.serialze(valve.getPressure()))



#185646 help needed on program trying to get pnumaticcraft pressure

Posted by GamerNebulae on 26 June 2014 - 02:04 PM in Ask a Pro

First you say you get that the result is a table and now it's nil? Are you sure you did not make a mistake?



#185638 help needed on program trying to get pnumaticcraft pressure

Posted by GamerNebulae on 26 June 2014 - 01:07 PM in Ask a Pro

What is the output when you do this:
print(textutils.serialize(pressure))



#185547 [SOLVED] String manipulation (Solution in post)

Posted by GamerNebulae on 25 June 2014 - 10:54 PM in Ask a Pro

View PostCometWolf, on 25 June 2014 - 10:10 PM, said:

-snip-

Thanks for the push in the right direction! :) This is how I fixed it:
function shorten(amount)
    print(string.sub(tostring(amount), 1, string.find(tostring(amount), "%p") + 1))
end



#185533 Pulling Enchant Names from Enchanted Books

Posted by GamerNebulae on 25 June 2014 - 09:16 PM in Ask a Pro

Probably what is wrong then is that the version of OpenPeripherals is a little outdated.



#185532 Keyword Protected Door

Posted by GamerNebulae on 25 June 2014 - 09:15 PM in Ask a Pro

This is already an implementation to your code.