Jump to content


blipman17's Content

There have been 62 items by blipman17 (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#202491 Advanced Computer and wireless Turtles

Posted by blipman17 on 08 January 2015 - 07:37 AM in Ask a Pro

shell.run()
should work

http://computercraft.../wiki/Shell.run



#202475 OO Lua

Posted by blipman17 on 08 January 2015 - 12:26 AM in Ask a Pro

forum makes it harder sometimes :P

thank you!



#202474 Readin power from an energycell.

Posted by blipman17 on 08 January 2015 - 12:24 AM in Ask a Pro

I'm currently watching a stream with Fireball1725 and Direwolf20, direwolf has said that his code is buggy.
I presume he will make a better release later.
so, just hold on.

He also said that he releases each version of his code under a different pastebin URL.



#202472 HELP With cooking, etc. program.

Posted by blipman17 on 08 January 2015 - 12:22 AM in Ask a Pro

me giving you the good code is also nice. :P
KingOfGamesYami did it right, it's {...} instead of {..}



#202471 OO Lua

Posted by blipman17 on 08 January 2015 - 12:19 AM in Ask a Pro

I see that "template" is highlighted blue.
Is that because it's a keyword? or is it higlighted because it's a template name?

Will take a look at those tutorials tomorrow, it's late now.

thank you for replying



#202467 HELP With cooking, etc. program.

Posted by blipman17 on 08 January 2015 - 12:09 AM in Ask a Pro

if you try to do something like
bake 30 cake
as a program you could get 30 and cake using
vars = {...}
then you got the values you started the program in a table



#202466 OO Lua

Posted by blipman17 on 07 January 2015 - 11:59 PM in Ask a Pro

After returning from learning java at scool, I started to look at Lua again.
Good old lua.
And now I want to get around object-oriented programming in lua
  • but I don't get if there is something like a standard constructor, or if you just have to make one and call it something like new()? [answered]
  • how do you define an object? [answered]
  • how do you properly use metatables?
  • are there any important convensions regarding objects and lua?
the things I do know (just checking) are:
  • instance variables are stored in an arraylist, passed back by the constructor.
  • inheritance uses metatables.
  • ":" is used instead of the "." in java.
  • "self" is used instead of "this" from java.



#193861 Inputs with keys

Posted by blipman17 on 17 September 2014 - 09:41 PM in Ask a Pro

when people have loops like
local i = 0
while i < 5 do
i = i + 1
print("potatoes")
end

they use the i from info as a variable that is just used for one moment to stop the loops.

everyone coud do also
local counter = 0
while counter < 5 do
counter = counter + 1
print("potatoes")
end

since the name is not important.
The name i is not important.
It is only important that there is a variable that stops loops like "while do", "for do" and "repeat until" loops.
the name often used for such a variable is i.



#193858 Computercraft

Posted by blipman17 on 17 September 2014 - 09:31 PM in Ask a Pro

name the program startup, so it would automatically start if you open the computer and stay on until minecraft restart.



#193855 Lua help

Posted by blipman17 on 17 September 2014 - 09:26 PM in Ask a Pro

View PostBomb Bloke, on 17 September 2014 - 12:41 PM, said:

If there's no command to get them all at once, then that means you have to do them one ata time. Loops can be used so that you don't actually have to type one command for each rod, though.

putting that into a function makes it a lot easyer.

something else, you could do is putting it into a table, and then you could read it out



#193851 Help please my code won't work.

Posted by blipman17 on 17 September 2014 - 09:19 PM in Ask a Pro

okay, let's go through your problem.

you just stated two errors;
attempted to call nil.
Bios339:[string"mall"] expected

the first one has a number behind it, or before or something.
that number is the number at what line the error happened.
that would help us a lot in helping you.

the second error is an error with openblocks, which I don't know anything usefull about.



#193847 need suggestions on a proper way of saving A LOT ov variables

Posted by blipman17 on 17 September 2014 - 09:01 PM in Ask a Pro

thanx



#193821 need suggestions on a proper way of saving A LOT ov variables

Posted by blipman17 on 17 September 2014 - 05:48 PM in Ask a Pro

KingofGamesYami said:

automagically

Would you like to teach me the magic behind it? :)

Like those functions, I was planning on writing something like that for tomorrow



#193818 need suggestions on a proper way of saving A LOT ov variables

Posted by blipman17 on 17 September 2014 - 05:21 PM in Ask a Pro

Then i'm going to write a few small functions for that. Since I want to have some API's I got to save data constantly.
Some turtle navigation stuff and such which should be crash safe.
Also , i want different computers to save their info also, on every computer, at any possible time



#193810 need suggestions on a proper way of saving A LOT ov variables

Posted by blipman17 on 17 September 2014 - 03:27 PM in Ask a Pro

Seems like a neat way. Much cleaner than using any funky API.

Just one question about using
textutils.serialise(data)
Would that give a readable format?

And, do you need to read the whole file, unserialise the wole thing, add something, serialise and overwrite the old one?
Just to add one thing?
Seems to me like a lot of hassle, expecially if you have a large database



#193690 need suggestions on a proper way of saving A LOT ov variables

Posted by blipman17 on 16 September 2014 - 03:03 PM in Ask a Pro

Hi,

I just wanted to know if there was any way to save tables, and other variables the proper way in computercraft.
in case the server goes down or something.

I've been looking at JSON API for CC, but still...
Does anyone have a neat way of saving data?
If needed, I'll write my own.
I just want to know I'm doing it the right way.



#177737 Server RAM usage monitor program

Posted by blipman17 on 10 May 2014 - 06:03 AM in Ask a Pro

The peoblem is that cc is sandboxed, but it can use the iternet. If you get a plugin that shows the serverdata on the internet it could get its data from there



#177736 Pulling value out of table

Posted by blipman17 on 10 May 2014 - 05:56 AM in Ask a Pro

This might help.
http://www.computerc...nd-not-a-table/



#176926 Verifying that two files are the same

Posted by blipman17 on 05 May 2014 - 05:42 PM in Ask a Pro

what about a file that stores the exact quantity every single letter is used in your code? and compare your current code with it? It would as far as I know a bit faster that hashing. Although the possibility for an equal amounth of all characters is more likely than with a good hashing algorithm.



#176921 Need Help Coding

Posted by blipman17 on 05 May 2014 - 05:34 PM in Ask a Pro

does it give an error?
if yes, then what error?
if no, what exact actions don't work?
until when does your code still work as intended?

we don't know exactly what you want, even if it seems so simple to you.



#176864 Need Help Coding

Posted by blipman17 on 05 May 2014 - 08:14 AM in Ask a Pro

Why are you letting your turtle go so much down? I mean, you want him to go to the left wnd right, right?



#176862 not (yet) real object oriented stuff

Posted by blipman17 on 05 May 2014 - 08:07 AM in Ask a Pro

I think i got it, thank you all for your effort. I'm off to a few hours of trail and error.



#176816 not (yet) real object oriented stuff

Posted by blipman17 on 04 May 2014 - 10:40 PM in Ask a Pro

Thank you, I think that I am starting to understand what I am able to do. The method to tackle this kind of things is in metatables? declaring a metatable redefines an operand of everything in that table? If so, you can let a program write its own metatable and re-use it?



#176785 not (yet) real object oriented stuff

Posted by blipman17 on 04 May 2014 - 07:47 PM in Ask a Pro

starting to read a bit about chunks. see you in a bit. ;)



#176772 not (yet) real object oriented stuff

Posted by blipman17 on 04 May 2014 - 06:46 PM in Ask a Pro

I'm sorry, I think I stated my question wrong.
How do you bind a value to the scope of a program, and after executing be able to get the value back once you execute the program another time.
And how could you make that last impossible for other programs?
or am I asking something impossible?

edit:

I know what the Vector API does and don't want to use it because I don't need to.
It doesn't have anything in common with my problem.