- ComputerCraft | Programmable Computers for Minecraft
- → virtualayu's Content
virtualayu's Content
There have been 31 items by virtualayu (Search limited from 29-March 23)
#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
#9117 [Lua] Counter
Posted by virtualayu on 13 April 2012 - 05:14 AM in Ask a Pro
#9092 [Lua] Counter
Posted by virtualayu on 12 April 2012 - 10:44 PM in Ask a Pro
#9091 I need help with programming a computer!
Posted by virtualayu on 12 April 2012 - 10:34 PM in Ask a Pro
#9065 help with counter
Posted by virtualayu on 12 April 2012 - 03:50 PM in Ask a Pro
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
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
#9033 help with counter
Posted by virtualayu on 12 April 2012 - 06:44 AM in Ask a Pro
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 :
count = fs.open("counter.txt", "w")
uum = 0
stacks = uum / 64
dc = stacks / 54
count.writeLine(uum)
count.writeLine(stacks)
count.writeLine(dc)
count.close()
end
count = fs.open("counter.txt", "r")
uum = tonumber(count.readLine())
stacks = tonumber(count.readLine())
dc = tonumber(count.readLine())
count.close()
while true do
term.clear()
term.setCursorPos(1,1)
print(" uum : "..uum)
print(" stacks : "..stacks)
print(" double chests : "..dc)
print("What would you like to withdrawl?")
uumm = "uum"
stackss = "stacks"
dcc = "double chests"
i = read()
if i == uumm then
term.clear()
term.setCursorPos(1,1)
print(" uum : "..uum)
print(" stacks : "..stacks)
print(" double chests : "..dc)
print("How much uum?")
x = tonumber(read())
if x > 0 then
rs.setBundledOutput("back", colors.white)
sleep(.5)
rs.setBundledOutput("back", rs.getBundledInput("back") - colors.white)
x = x - 1
uum = uum - 1
end
end
if i == stackss then
term.clear()
term.setCursorPos(1,1)
print(" uum : "..uum)
print(" stacks : "..stacks)
print(" double chests : "..dc)
print("How many stacks?")
x = tonumber(read())
if x > 0 then
rs.setBundledOutput("back", colors.white)
sleep(.5)
rs.setBundledOutput("back", rs.getBundledInput("back") - colors.white)
x = x - (1 / 64)
uum = uum - 1
end
end
if i == dcc then
term.clear()
term.setCursorPos(1,1)
print(" uum : "..uum)
print(" stacks : "..stacks)
print(" double chests : "..dc)
print("How many chests?")
x = tonumber(read())
if x > 0 then
rs.setBundledOutput("back", colors.white)
sleep(.5)
rs.setBundledOutput("back", rs.getBundledInput("back") - colors.white)
x = x - (1 / (64 / 54))
uum = uum - 1
end
end
count = fs.open("counter.txt", "w")
count.writeLine(uum)
count.writeLine(stacks)
count.writeLine(dc)
count.close()
end
#9017 hamish1001 programs
Posted by virtualayu on 12 April 2012 - 02:31 AM in Programs
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
thesbros, on 11 April 2012 - 05:41 PM, said:
MysticT, on 11 April 2012 - 05:01 PM, said:
djblocksaway, on 11 April 2012 - 09:57 AM, said:
please delete this thread as hamish is a code stealer and im pretty sure taking peoples codes and reposting as urs isnt allowd />
-----------------
Stealing Codes Is Wrong />
----------------
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 />
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?
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
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
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
#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
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
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
#8460 Help in advanced programing
Posted by virtualayu on 08 April 2012 - 03:20 AM in Ask a Pro
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
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
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
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
#8194 Buildcraft controls programs
Posted by virtualayu on 06 April 2012 - 03:50 PM in Programs
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
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
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
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/
- ComputerCraft | Programmable Computers for Minecraft
- → virtualayu's Content