Jump to content


remiX's Content

There have been 469 items by remiX (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#92485 word value NEED HELP

Posted by remiX on 01 March 2013 - 05:53 PM in Ask a Pro

 nobody1717, on 01 March 2013 - 05:31 PM, said:

 GopherAtl, on 27 February 2013 - 09:08 PM, said:

 nobody1717, on 27 February 2013 - 08:41 PM, said:

--snip

that is, conservatively, 50x more broken than the code in the OP, which had only the one minor error you noted in your follow-up post 2 minutes later.

Besides the capital letters (im too lazy to edit them out)
What is wrong with it?

Looks like you wrote it on your phone :P

a problem besides the capital letters is the table, each letter needs to be encased with inverted commas



#92492 Googol - More Than Just a Search Engine

Posted by remiX on 01 March 2013 - 06:20 PM in Programs

When updating LibCompress.lua it errors out with io:71: not enough space to write to file.

I have 65.8gbs free...



#92590 Googol - More Than Just a Search Engine

Posted by remiX on 02 March 2013 - 06:32 AM in Programs

Wow, this is awesome work :P Finds everything and anything!



#92744 Weird result in string split function

Posted by remiX on 02 March 2013 - 07:17 PM in Ask a Pro

Isn't the fact that he's using the string api and a variable named string also messing something up?



#93089 [Question]How do I turn rednet messages into redstone signals?

Posted by remiX on 04 March 2013 - 03:59 AM in Ask a Pro

View PostSenmori, on 04 March 2013 - 12:49 AM, said:

You might want to check out the Rednet, Os.pullEvent(), and Redstone API pages.

As for how to do it, well if I gave you the code then you wouldn't learn anything.

I would suggest waiting for an event(os.pullEvent() or rednet.receive()) until a certain message is received and if that message is what you want then do a certain action(redstone signals).

If you don't want to learn then click the spoiler for an idea of how to do it :
Spoiler

senderID is a number, not a string



#93104 [Error][Fixed]startup:20: attempt to compare nil with number

Posted by remiX on 04 March 2013 - 05:25 AM in Ask a Pro

Remove the write(version.readAll()) and then it will work



#93115 [Error][Fixed]startup:20: attempt to compare nil with number

Posted by remiX on 04 March 2013 - 06:01 AM in Ask a Pro

View PostBubba, on 04 March 2013 - 05:33 AM, said:

Just in case you were wondering why it didn't work, you used http.get as opposed to http.request which is the one I used. They return different values.

No, the problem is that doing readAll() causes it go be at the very last line (which is nil if read) and then he does another readAll() which returns nil.
It's like doing readLine() and then readLine() again - the second readLine() will read the second line and not the first.



#93121 [Error][Fixed]startup:20: attempt to compare nil with number

Posted by remiX on 04 March 2013 - 06:29 AM in Ask a Pro

View PostBubba, on 04 March 2013 - 06:27 AM, said:

View PostremiX, on 04 March 2013 - 06:01 AM, said:

View PostBubba, on 04 March 2013 - 05:33 AM, said:

Just in case you were wondering why it didn't work, you used http.get as opposed to http.request which is the one I used. They return different values.

No, the problem is that doing readAll() causes it go be at the very last line (which is nil if read) and then he does another readAll() which returns nil.
It's like doing readLine() and then readLine() again - the second readLine() will read the second line and not the first.

Ah yes. My mistake. Please ignore my response: foolish http noob here.

Not only http :D Also with fs/io api for opening files for reading



#93346 Progressive mob arena!

Posted by remiX on 04 March 2013 - 06:15 PM in Ask a Pro

Read comments

Spoiler



#93448 Bottles of beer on the wall!

Posted by remiX on 05 March 2013 - 01:29 AM in General

It's a shame that it doesn't work ;P



#93454 [Discontinued] Nut Os

Posted by remiX on 05 March 2013 - 02:05 AM in Operating Systems

Hectic html coding :D



#93489 Redpulse Without Computer Sleeping

Posted by remiX on 05 March 2013 - 04:48 AM in Ask a Pro

So basically you want it to be able to send redstone signals for X amount of seconds while you are still able to do certain things on the computer? Looks like you need to use parallel api.
This api basically allows you to run multiple functions simultaneously, allowing users to have a great advantage for functions.

PS, using the shell.run you need quotes around everything
shell.run("redpulse right 1 20")



#93506 Shorter if statement

Posted by remiX on 05 March 2013 - 05:43 AM in Ask a Pro

View PostLancerX, on 05 March 2013 - 05:28 AM, said:

Implementing your own ternary() function is pretty straightforward and a nice addition to your utils API. You do have your own utils toolkit, right?

-- ternary, because even Java has one
--	cond: condition to eval
--	tVal: return val if cond == true
--	fVal: return val if cond == false
--	returns tVal or fVal
function ternary(cond, tVal, fVal)
	if cond then
	  return tVal
	else
	  return fVal
	end
end

-- example:
item = ternary(isOpenSlot(slot), itemToStock(), nil)


function ternary(cond, tVal, fVal)
	return cond and tVal or fVal
end



#93518 Shorter if statement

Posted by remiX on 05 March 2013 - 06:57 AM in Ask a Pro

View PostLancerX, on 05 March 2013 - 06:11 AM, said:

@remiX: Cool, I just started with Lua/CCraft this weekend, I'm still picking up a lot of the idioms.

Heh :)

You don't really need to make a function, because you just need to do this:
item = isOpenSlot(slot) and itemToStock() or nil
It does the same thing, but no need for a function then



#93522 [(?) to 1.5+] queueEvent doesn't work before yield/pullEvent

Posted by remiX on 05 March 2013 - 07:21 AM in Bugs

Works for me... tested with latest version of CCEmu

[attachment=1042:s.PNG]

(Used the very first code you supplied)



#93705 Reading Varible from File? - Even Possible?

Posted by remiX on 05 March 2013 - 07:18 PM in Ask a Pro

Yes, but at the beginning of your program, use os.loadAPI("config") to load the file and then the variables inside will become global - remember not to make it local debug = true in the config file because then they will not be accessible from your programLol. I had typed everthing out but forgot to click post. Btw, I don't think you need to do config.debug, just debug, isn't it?



#93932 Splitting a massive string to print with

Posted by remiX on 06 March 2013 - 05:52 PM in Ask a Pro

You can store the whole thing in a string and use an awesome function made by TheOriginalBit which splits it into a table with the desired length of each line. You can find it in his Extended Library api. Check it out at the programs section.



#93935 Pythagorean Theorem Calculator

Posted by remiX on 06 March 2013 - 06:05 PM in Programs

View PostCastleMan2000, on 06 March 2013 - 10:24 AM, said:

View Postbjornir90, on 02 March 2013 - 09:08 AM, said:

View Postpingoleon60, on 01 March 2013 - 01:02 PM, said:

Oh ******* great program !
Cheater mode enabled lol.

In France, I'm in "4ème", and it's when we do Pythagorean Theorem :D I only need to translate your program ^^
Thanks you man !Now, do a function which it check if the triangle have a right angle

Ahlala le théorème de pythagore.... le plus chiant je pense .... Bon courage pour ta 4eme !

Not sure if it will be in italic but i'm not sure for tge BBcode :/
The BBcode for italics is [ i ] (text) [ / i ] (remove the spaces)

[i]text[/i]

No need for spaces :]



#93936 Bored

Posted by remiX on 06 March 2013 - 06:09 PM in General

View PostSuicidalSTDz, on 06 March 2013 - 12:32 PM, said:

So I got bored again (I know, shocker..) so I looked through pastebin and found this small paste :D

http://pastebin.com/u3vJizKf

Just kinda funny to paste such little code...

It's by a guest, how do we know you didn't make it? :P

Oh look at this pastebin link, what a waste



#93948 Splitting a massive string to print with

Posted by remiX on 06 March 2013 - 07:13 PM in Ask a Pro

View PostLyqyd, on 06 March 2013 - 06:23 PM, said:

View PostremiX, on 06 March 2013 - 05:52 PM, said:

You can store the whole thing in a string and use an awesome function made by TheOriginalBit which splits it into a table with the desired length of each line. You can find it in his Extended Library api. Check it out at the programs section.

If it is the same function I am thinking of, it was not written by him, but is actually an example function found in the PIL. The one I'm thinking of is the one that's been floating around the forums for quite some time.  I simply don't wish it to be misattributed if that is the case.

Oh, sorry if that is the case. He has it licensed in his api and told me that he did make it.



#94012 Turtles, and monitors

Posted by remiX on 07 March 2013 - 04:20 AM in Ask a Pro

View Postkoslas, on 06 March 2013 - 09:51 PM, said:

I tried on a turtle "mon = peripheral.wrap("back")" but it gave me an error saying nil. Is it possible to get turtles to print to a monitor, as I want it to print it's fuel level, or would I have to use rednet to send the fuel level to a computer, and that computer prints it on the monitor?

I'm sure it is possible for a turtle to print on a monitor, but the I'm seeing a problem that will definitely arise:
Your turtle will be moving... so yeah rednet would be the best option



#94022 Can I please get help with my code, that will probably confuse?

Posted by remiX on 07 March 2013 - 05:22 AM in Ask a Pro

Tell us what you have done to fix the issue, if you have tried anything.

Have you tried to make dest = 3?



#94027 Universal turtle inventory hlep.

Posted by remiX on 07 March 2013 - 05:37 AM in Ask a Pro

All you need to do is
local version = os.version():gsub( "TurtleOS ", "") -- or whatever it says on a turtle, lol forgot :D/>
print(version)

--Output:
1.5 -- or whatever version you're using
-- then use this with tonumber(version) to compare it with another number

if tonumber(version) < 1.5 then
	print( "Old version!" )
else
	-- valid
end



#94045 Displaying user input on a monitor.

Posted by remiX on 07 March 2013 - 07:22 AM in Ask a Pro

View Postboudragon, on 07 March 2013 - 06:42 AM, said:

OK! So... after having to start all over... and re-write EVERYTHING... I managed to get it all working! Just one FINAL question. The monitor updates just fine for everything... but when I am in the command prompt and type say "edit FILE"... it pulls up the edit screen with data on both the terminal and the monitor but the monitor looks kinda funky. Any idea how to fix that?

Kinda funny? What do you mean kinda funny? Explain or post a screenie lol

Maybe it's because the monitor is bigger than 51x19



#94054 Lua programming problem. (locked door code)

Posted by remiX on 07 March 2013 - 07:35 AM in Ask a Pro

View PostUnforgivingOne, on 07 March 2013 - 07:23 AM, said:

Figured it out!
Mistake I corrected here but not when inputting it into my program in-game. at line 10: term.setCursorpos( 1 , 1 )
I had term.setCursospos

So the code put on here should work perfectly :)

Yeah, thought so - I couldn't find any problems with the posted code... :P