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  

#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



#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 :]



#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.



#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?



#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)



#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



#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



#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")



#93454 [Discontinued] Nut Os

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

Hectic html coding :D



#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



#93346 Progressive mob arena!

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

Read comments

Spoiler



#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



#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.



#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



#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



#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?



#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!



#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...



#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