- ComputerCraft | Programmable Computers for Minecraft
- → jay5476's Content
jay5476's Content
There have been 301 items by jay5476 (Search limited from 10-February 22)
#157234 Unable to end a program
Posted by
jay5476
on 19 December 2013 - 02:56 AM
in
Ask a Pro
Death, on 18 December 2013 - 11:43 PM, said:
Here's a nice fix to your code
local pullEvent = os.pullEventRaw
pullEvent = os.pullventRawwith
os.pullEvent = os.pullEventRaw
Heat must be getting to everyone
theoriginalbit, on 19 December 2013 - 02:18 AM, said:
Edit: Air conditioner is at other end of the house :/
#154959 [CC]Code Cleanup
Posted by
jay5476
on 03 December 2013 - 05:06 AM
in
Forum Games
you assign the return value to a lower case 'x' and then later try to use an uppercase 'X'
if " 2+2" == "4" then
print("4")
end
yes its real simple :/
#154708 ComputerCraft Standards
Posted by
jay5476
on 01 December 2013 - 03:39 AM
in
General
Well if there was a standard for everything wouldn't it just be perfect... but there isn't, take minecraft for an example forge is having trouble porting to minecraft 1.7 because mojang changed a lot of its coding and then forge has to be familiarised with it same as al minecraft modders. people cant just stick to one thing... you tell someone to do it there not exactly going to do it, so what about all the people that coed before coming on this forum how are they supposed to know
#154702 [1.57] disk.isPlaying(string side) or os.pullEvent( "disk_stopedPlaying" )
Posted by
jay5476
on 01 December 2013 - 01:38 AM
in
Suggestions
Well maybe do a music event
Return music,side,name,(start or end)
That way people can just time disks by events
Return music,side,name,(start or end)
That way people can just time disks by events
#154562 Vms?
Posted by
jay5476
on 30 November 2013 - 01:13 AM
in
Ask a Pro
DO NOT DISABLE _G
Read this: http://www.lua.org/pil/14.3.html
I suggest you learn enviroments better ( I dont claim to know them that well either ) but what i would suggest is an enviroment that simply does not have averse to _G but without basic functions that nearly every program depends on (eg. print) the computer will shut down with no warning or error message
( since it cannot print )
Maybe a soloution is this
Read this: http://www.lua.org/pil/14.3.html
I suggest you learn enviroments better ( I dont claim to know them that well either ) but what i would suggest is an enviroment that simply does not have averse to _G but without basic functions that nearly every program depends on (eg. print) the computer will shut down with no warning or error message
( since it cannot print )
Maybe a soloution is this
f = fs.open(filename,"r")
content = f.readAll()
f.close()
env = {print = _G.print} -- etc.
program,err = loadstring(content)
if program then
setfenv(program,env)
program()
else
print(err)
error()
end
PM me if you need help with this, ill be glad to hel you out
#154560 Fs (API), what is that?
Posted by
jay5476
on 30 November 2013 - 12:55 AM
in
Ask a Pro
Well most commonly people use it with their turtle program's to keep track of where it is in case of a shutdown and having to start from the start( cant give some code here )
But an example i can give is a password lock
Edit: Basically if a password file doesn't exist yet then it will create the file and write the password to it otherwise it will read from the password file and then store it in the variable called pass and then compare later on
But an example i can give is a password lock
repeat
if fs.exists("password") then
fileHandle = fs.open("password","r") -- open file in read mode
local pass = fileHandle.readAll() -- read everything in the file
fileHandle.close() -- make sure to close
else
write("Enter new password: ")
local pass = read("*")
fileHandle = fs.open("password","w") -- open file in write mode
fileHandle.write(pass) -- store password in the file
fileHandle.close() -- again close the file
end
term.clear()
term.setCursorPos(1,1)
write("Enter Your Password: ")
input = read("*")
until input == pass
Edit: Basically if a password file doesn't exist yet then it will create the file and write the password to it otherwise it will read from the password file and then store it in the variable called pass and then compare later on
#154526 Enchantable Turtles
Posted by
jay5476
on 29 November 2013 - 09:04 PM
in
Suggestions
Idk about this... efficient on a turtle which breaks blocks instantly hows that work?
#154434 How do you program
Posted by
jay5476
on 28 November 2013 - 11:15 PM
in
Ask a Pro
MadBudderKing, on 28 November 2013 - 06:13 PM, said:
Hi, im new. I want to know how to program. I know that computercraft uses lua, but are some basics of lua that I need to know?
Thanks
Thanks
- ComputerCraft | Programmable Computers for Minecraft
- → jay5476's Content


