Jump to content


virtualayu's Content

There have been 31 items by virtualayu (Search limited from 29-March 23)


By content type

See this member's


Sort by                Order  

#9998 [Question] Is there a way to create a variable based on input?

Posted by virtualayu on 20 April 2012 - 03:53 PM in Ask a Pro

you can do that : "variableName" = io.read() like user = io.read and pass = io.read()



#9117 [Lua] Counter

Posted by virtualayu on 13 April 2012 - 05:14 AM in Ask a Pro

Your other code is decrementing vars and send a redstone signal so it already does what you want....



#9092 [Lua] Counter

Posted by virtualayu on 12 April 2012 - 10:44 PM in Ask a Pro

I think your other counter that i help you to code do it you just have to put this code in your new counter's code. If you wan't me to help just ask me.



#9091 I need help with programming a computer!

Posted by virtualayu on 12 April 2012 - 10:34 PM in Ask a Pro

Wgat kind of energy? From what mod? Redpower, buildcraft, industrialcraft?



#9065 help with counter

Posted by virtualayu on 12 April 2012 - 03:50 PM in Ask a Pro

yes if you use multiple colors but in this case he use only one color and his program is very simple.
so he don't have to make variables with conbined colors...



#9037 ComputerCraft Pixel Art [3D ART]

Posted by virtualayu on 12 April 2012 - 06:56 AM in Media

nice job ^^ now you have a giant computer, floppy monitor, wifi modules and an enorm disk ^^ (but not a working one XD)

ps : did you see that your disk is too big to get in the floppy ? XD



#9035 [Question] ComputerCraft Lua Emulator for iPads and iPods

Posted by virtualayu on 12 April 2012 - 06:53 AM in General

and on my ipone ^^ there is not much app for programming lua... and they didn't work ^^



#9033 help with counter

Posted by virtualayu on 12 April 2012 - 06:44 AM in Ask a Pro

first :

redstone.setBundledOutput("back", colors.white,true)
sleep(.5)
redstone.setBundledOutput("back", colors.white,false)

this is not how bundled cables works...
try :

rs.setBundledOutput("back", colors.white)
sleep(.5)
rs.setBundledOutput("back", rs.getBundledInput("back") - colors.white,) -- this is how set off a bundled cable...

you can't say true or false... it's not that simple^^
and use rs.set or rs.get is simple than redstone.set ....

in your first line why did you wrote uum = "uum" ??? no need... you say uum = 0 if the file don't exist and say uum = tonumber(count.readline()) if it does... so why did you declare it in the first place?? (thats not a big deal but is 100% useless)

in order to be clear please in an "if" write the variables in the right order... "if i == uum then" not "if uum == i then" (again not a big deal it don't change the program but it's easyer to read ^^)



I assume that your program is called "get", am i right?
don't end your program by calling it again... just make a loop ^^
after getting values in your file and closed it, put this : while true do
and at the end put an end to close the loop

so the correct code for all of this should be :
Spoiler



#9017 hamish1001 programs

Posted by virtualayu on 12 April 2012 - 02:31 AM in Programs

please admins do something about hammish1001 he never coded anything... he just go on other forums and appropriate others work... seriously....

hammish1001... what did you think??? you do that to pretend having friends and pretend to know about coding???

did you really think we'll never see that you steal code from others? You may know that the community is not that big and most of users of forum are on multiples forum... so it's inevitable that someone recognize his code...



#8964 Super Lock 2000 (like a door lock but opens every direction)

Posted by virtualayu on 11 April 2012 - 07:03 PM in Programs

View Postthesbros, on 11 April 2012 - 05:41 PM, said:

View PostMysticT, on 11 April 2012 - 05:01 PM, said:

View Postdjblocksaway, on 11 April 2012 - 09:57 AM, said:

Hamish is a code stealer this door lock was made by me
please delete this thread as hamish is a code stealer and im pretty sure taking peoples codes and reposting as urs isnt allowd :P/>
-----------------
Stealing Codes Is Wrong :D/>
----------------
The Original Post (By me)
http://www.computerc...7-easy-lock-11/


compare the codes and you will see that he has taken my code :)/>
Wow, looks like hamish can travel through time XD
Your post was made on 30 March 2012 - 10:58 AM
And hamish's was made on 22 March 2012 - 07:45 PM
So, how could he steal your code if it wasn't posted yet?
So, djblocksaway, you could be stealing hamish's code.

if you take a closer look at the pastebin of the 1.1 of djblocksaway's code, he posted it on pastebin on 21 march .... and the 1.0 on 18 march ...
so we can say that djblocksaway posted it first...
i don't know how hamish had this code but it is an exact copy of djblocksaway's code...



#8883 Logistic Pipe's Is it possible?

Posted by virtualayu on 11 April 2012 - 01:37 AM in Ask a Pro

using redpower 2 you can make something like you want...
i'm programing a program who count how many item i have when they are sorting in differents chest...
and i will program it in order that i can ask to get some items and how many, and it will pick up the items in the chest and give it to me.
but not done ^^



#8723 [solved]my item counter prog break when it reach 60...

Posted by virtualayu on 10 April 2012 - 12:03 AM in Ask a Pro

effectivelly ^^ i'm not very familliar with the "while true do" things ^^ i removed the calling of "loop()" and now it work perfectly ^^ Thanks a lot!!!

now i will add code for decrementing count when we take items in the chest...



#8688 [solved]my item counter prog break when it reach 60...

Posted by virtualayu on 09 April 2012 - 06:44 PM in Ask a Pro

nobody have an idea??? or a counter who already work for me (i will analize it, and maybe found an answer ^^)



#8632 [solved]my item counter prog break when it reach 60...

Posted by virtualayu on 09 April 2012 - 02:41 AM in Ask a Pro

i add the "break" but it do the same ... and anyway i think if we call a function it will automaticly break the loop but i'm not sur... ^^

when the program stop it just write : 178 ... i really don't know what it is... an error code?



#8555 [solved]my item counter prog break when it reach 60...

Posted by virtualayu on 08 April 2012 - 06:37 PM in Ask a Pro

i made a little prog who count items when they pass in a item dtector (redpower). this work pretty well until he reach 60...
60 for all counting, if i just give dirt it go to 60 if i give dirt coal and cobble it go like 20 of each one ...
and i really don't know why....

my code : http://pastebin.com/22fJssey

i try with all thing about the reading or writing the fille in comment and it do the same so the problem is'nt from that...

any ideas???



#8543 Write to specific line

Posted by virtualayu on 08 April 2012 - 04:03 PM in Ask a Pro

View PostWolvan, on 08 April 2012 - 12:04 PM, said:

View Postluanub, on 08 April 2012 - 09:24 AM, said:

I've been doing it by capturing the contents of the file in a table. then using table commands to edit the table, and finally updating the file to match the new edited table.
OK Great to hear you managed it
hum... it's not luanub who opened this topic^^ it's ComputerCraft11 and we didn't know if he managed it... ^^



#8460 Help in advanced programing

Posted by virtualayu on 08 April 2012 - 03:20 AM in Ask a Pro

using events in you code will pause your program until an "event" (key press, change redstone status...) with that you can ask a question and your program will continue after the user respond to that question

in example you can ask if they wan't to open a door, and test if the key is "Y" so open it or if it's "N" don't do anything ....



#8459 How to use slow print?

Posted by virtualayu on 08 April 2012 - 03:10 AM in Ask a Pro

or you can do "oldschool" ^^ like
write("H")
sleep(0,1)
write("e")
sleep(0,1)
write("l")
sleep(0,1)
write("l")
sleep(0,1)
write("o")

but it's a lot of code ^^



#8455 need help in programming a computer

Posted by virtualayu on 08 April 2012 - 02:58 AM in Ask a Pro

function not funtion
and maybe i'm wrong but i think you can't create a function named clear() , i'm not sure...
anyway it'll be better to name it clearScreen() or something like that but it's just for an easy reading of your code...

and i really don't understand why you use local term to declare a function or a variable.... your program is so small... you don't need it... and declaring local vars is only if you declare it inside a function... (maybe i'm wrong?) declaring a variable like you did is useless because it will be declare as a global one anyway... (aigain i'm maybe wrong... XD)



#8450 Write to specific line

Posted by virtualayu on 08 April 2012 - 02:35 AM in Ask a Pro

i think you'll have open the file in write mode then read line by line until you reach the lineyou want then write your line... maybe i'm wrong i'd never tested to read a line in write mode... ^^

And i think it's not possible to search in a file... again maybe i'm wrong ^^ maybe you can read each line and test them to see if it's the right one ...
but i never use the file:write thing... i use only the fs api and i learn it recently so i'm not sur about what i'm saying XD...



#8315 Buildcraft controls programs

Posted by virtualayu on 07 April 2012 - 04:06 AM in Programs

Well... ^^ maybe later ^^ i plain to modify my programs and add rednet in the futur in order to centralize everyting on 1 computer but this will be better ^^



#8194 Buildcraft controls programs

Posted by virtualayu on 06 April 2012 - 03:50 PM in Programs

Well i changed the pastebin link with my new code.
Now on the first use it say First use and ask for all the colors.
Then he write everything in a configuration file named tankConf.ini
after that at every launch of the program it will read the conf file and apply it.

So now you can do your wire configuration like you want and even change it if you want you juste have to delete the conf file.

if you have a bug, a comment or an advice tell me ^^.



#8131 Buildcraft controls programs

Posted by virtualayu on 06 April 2012 - 03:48 AM in Programs

i finaly made it... ^^ it takes me somthing like 6 or 7 hours of hard coding, but i made it (by my self XD yeah^^)
It was really really difficult for me... This is my first "real" program (my first one was a pasword program ^^) and i'm a beginner on lua.

Now in my place it's almost 6:00 am so i will make the translate and post it tomorrow.
Now i'm tired so i'm going to sleep but i'll go with a real good feeling of fulfillment!! ^^



#8032 Buildcraft controls programs

Posted by virtualayu on 05 April 2012 - 01:20 PM in Programs

i think a can create a *.ini file with that command : conf = fs.open("conf.ini", "w")
and i write data inside with : conf.writeLine("..waterColor1..") conf.writeLine("..waterColor2..") etc with the part who ask what color we want
and at the start of the code i check if the file conf.ini exist and read it with : if fs.exists("conf.ini") == true then waterColor1 = conf.readLine() waterColor2 = conf.readLine() ...etc

what dou you think about something like that?



#8023 RockLegend2's Coded Triple-Lock Security Door

Posted by virtualayu on 05 April 2012 - 12:02 PM in Programs

may i propose you to use this ingame tutorial?
it is the one poposed in the tuto section of this forum it's a verygood one and a good start with bundled cables ^^

http://www.computerc...torial-in-game/