http://www.squidoo.c...ft-mod-tutorial
Exactly the same as the tutorial here, but the formatting for the sections that are in code here is messed up. It pretty much looks like someone copy/pasted the OP.
Where you aware of this?
No I was not aware of this. Thanks for sharing, I'll see what action I can take about this. I also added a Creative Commons license.
That's an idea I may consider, but for commands and all that stuff check the Wiki and help files.
I should have been more specific. I didn't actually mean the commands, I meant using them ingame. Examples help someone wrap their head around even the simplest subject. You're right though, there IS enough information available, but I've not found many examples without having to watch a 7 min Youtube video which only has about 25 seconds of floppy info in it. It's kind of silly really. (I'll probably make a YouTube video once I figure out everything I can do with them.)
Here's a question for ya: Can floppies hold more than one program? Is there a limit like in real life?
Atm I'm using script from Cookiebal's Chicken farm as a reference and making a quarry control system.. but I've yet to try using 'if', 'or', or 'else'.
(Forgot about the examples in the OP) Should be fun learning through trial and error, do you have any computercraft projects you are currently working on?
------------------------------------------------------- Finally ran into some trouble on those if statements :tongue.gif:
if redstone.getInput("back",true) then
print ("The quarry is currently on! Try turning it off.")
else
print ("Quarry is off, powering.")
redstone.setInput("back",true)
end
Yet this doesn't power the wire. (I'm using redwire not bundled wires)
I am currently upgrading the information on the wiki so it will explain all these things. So far I have Floppy Disks almost done. I hope what I have written has explained enough by now, if not please say so as we do still have a lot of work to be done on the wiki as well as how we require user feedback on the material (I'm not the only working on it but I seem to be doing most of the detailed explanations and such).
What is on the floppies and how they work is exactly the same as your computer's filesystem. There is a dedicated folder for each floppy as well as each computer in the world's save folder.
I currently do not have any active projects for Lua, but I do have one that's on hold as I have been busy recently under personal business as well as how I'm trying to learn C++. I should also update the wiki page for the pullEvent system as that is a really great tool that Dan has blessed us with . That basically allows us to wait for an input to happen, and if that input happens then do this. Events can be from the user pushing a button to a disk being inserted or removed from a disk drive.
I am currently upgrading the information on the wiki so it will explain all these things. So far I have Floppy Disks almost done. I hope what I have written has explained enough by now, if not please say so as we do still have a lot of work to be done on the wiki as well as how we require user feedback on the material (I'm not the only working on it but I seem to be doing most of the detailed explanations and such).
What is on the floppies and how they work is exactly the same as your computer's filesystem. There is a dedicated folder for each floppy as well as each computer in the world's save folder.
I currently do not have any active projects for Lua, but I do have one that's on hold as I have been busy recently under personal business as well as how I'm trying to learn C++. I should also update the wiki page for the pullEvent system as that is a really great tool that Dan has blessed us with . That basically allows us to wait for an input to happen, and if that input happens then do this. Events can be from the user pushing a button to a disk being inserted or removed from a disk drive.
I updated my post right as you posted so I think you missed the problem I added. >_<
I think I'm going to do some indepth tutorials on each subject(that I understand), and in the future stick them into one video with a menu in it. Would it be okay to embed the seperate videos in the wiki later on? I don't want to advertise my channel, i just figured it might help.
@ anyone who develops for this mod or redworks, someone should create a plugin for notepad++ to make a sort of IDE for writing lua scripts for computercraft.
vary helpful tutorial got me started on Lua
But you need to redo the whole thing lol they updated the forum
/: hate the new update cant use gif's for pics anymore
Hey I need some help with a audio disk player but I keep getting errors. Heres my current program with a few alterations I have tried:
Code 1:
if hasAudio(right, side) then
playAudio(right, side)
Print("Now playing music")
sleep(30)
term.clear()
Print("Stoping music")
stopAudio(right, side)
textutils.slowprint("Ejecting disk")
eject(right, side)
else
Print("no music disk is in the disk drive")
end
ERROR: startup:1: attempt to call nil
Code 2:
hasAudio(right, side) then
playAudio(right, side)
Print("Now playing music")
sleep(30)
term.clear()
Print("Stoping music")
stopAudio(right, side)
textutils.slowprint("Ejecting disk")
eject(right, side)
else
Print("no music disk is in the disk drive")
end
ERROR: bios:206" [string "startup"]:1: unexpected symbol
I will be updating this post with any fixes i find until somebody replies to this post with all the problems.
Also this may be a possibility; I read the wiki on the disk api that you could use music discs (the default ones) in the drives. Is that not the case and its somehow possible to create music on a floppy?
Although I already knew all this stuff, this is great for begining lua programmers. It is hard to find good resources that teach begining lua. This post is great!
+1
Oh my, I never received any notifications for any replies Please excuse my absences. I would have loved to make more documentation and all but I have recently come across some health problems and I have been very busy with school. I can not promise anything in the near future but I hope to do some more work this summer! Any questions I'll try to get back to ASAP as always.
~Onionnion
Hey I need some help with a audio disk player but I keep getting errors. Heres my current program with a few alterations I have tried:
Code 1:
if hasAudio(right, side) then
playAudio(right, side)
Print("Now playing music")
sleep(30)
term.clear()
Print("Stoping music")
stopAudio(right, side)
textutils.slowprint("Ejecting disk")
eject(right, side)
else
Print("no music disk is in the disk drive")
end
ERROR: startup:1: attempt to call nil
Code 2:
hasAudio(right, side) then
playAudio(right, side)
Print("Now playing music")
sleep(30)
term.clear()
Print("Stoping music")
stopAudio(right, side)
textutils.slowprint("Ejecting disk")
eject(right, side)
else
Print("no music disk is in the disk drive")
end
ERROR: bios:206" [string "startup"]:1: unexpected symbol
I will be updating this post with any fixes i find until somebody replies to this post with all the problems.
Also this may be a possibility; I read the wiki on the disk api that you could use music discs (the default ones) in the drives. Is that not the case and its somehow possible to create music on a floppy?
Your syntax (programming grammar) is really messed up. The correct way for the first code would be:
if hasAudio("right")==true then
disk.playAudio("right")
print("Now playing music")
sleep(30)
term.clear()
print("Stopping music")
disk.stopAudio("right")
textutils.slowprint("Ejecting disk")
disk.eject("right")
else
print("no music disk is in the disk drive")
end
Try taking a look over that and what's different and also try seeing if you can find the mistakes with the second script. Remember, programming/scripting is all about solving problems!
i need some help, when i typ on my computer: lua. it enters the prompt thing, then i typ: cd rom/programs/custom, then it says: :27: [string "lua"]:1: '=' expected
Those are the computer's commands, not Lua commands. Lua is the scripting language and is separate from the programs you run such as 'cd' or 'ls'. The Lua program just lets you enter Lua commands and to experiment with Lua step-by-step, or command-by-command. If you're in Lua and want to get out of it, just enter 'exit()'.
vary helpful tutorial got me started on Lua
But you need to redo the whole thing lol they updated the forum
/: hate the new update cant use gif's for pics anymore
I might as well resubmit the whole post I guess. Will look into it, just been so busy lately.
I like this mod (even though i am not proficient with lua :P) and was wondering if you all could help me. Here is my code for a basic password system(as i wanted to create my own). please tell me where any flaws might lay. also i keep getting an error saying:
bios:206: [string "startup"]:11: 'do' expected
I assume the 11 refers to a line number but i see a 'do' in that line. unsure as to how this is fixed
I like this mod (even though i am not proficient with lua ) and was wondering if you all could help me. Here is my code for a basic password system(as i wanted to create my own). please tell me where any flaws might lay. also i keep getting an error saying:
bios:206: [string "startup"]:11: 'do' expected
I assume the 11 refers to a line number but i see a 'do' in that line. unsure as to how this is fixed
i = 0
b = false
while i != 3 do
print("Password: ")
p = read()
if p == PASSWORD then
b = true
i = 3
else
print("Incorrect Password")
i = i+1
t = 3-1
print("You have: " t "more attempts")
end
end
if b != true then
os.shutdown()
end
It looks like you're mixing up the unequal-to signs for C and Lua. In Lua, unequal-to is represented with '~=', so all you really have to do with replace every '!=' with '~='.
I had actually figured out there was some sort of syntax error with the "not equals" operator. I simply changed the syntax to read "equals" (obviously altering the program slightly) but it functions now. I am familiar with c and java so this is slightly different :P.
Do you happen to know how to use the print() function to handle multiple data types (idk how to explain this)
for instance in java i would say | System.out.println("You have: " + t + "attempts."); to execute a print string where t is a calculated value
or in c++ i would say | cout << "You have: " << t << "attempts." << endl;
i would like to do the same thing with this.
Would you consider doing a tutorial on Disk commands and all things floppy?
[insert floppy eared bunny picture]
No I was not aware of this. Thanks for sharing, I'll see what action I can take about this. I also added a Creative Commons license.
That's an idea I may consider, but for commands and all that stuff check the Wiki and help files.
I should have been more specific. I didn't actually mean the commands, I meant using them ingame. Examples help someone wrap their head around even the simplest subject. You're right though, there IS enough information available, but I've not found many examples without having to watch a 7 min Youtube video which only has about 25 seconds of floppy info in it. It's kind of silly really. (I'll probably make a YouTube video once I figure out everything I can do with them.)
Here's a question for ya: Can floppies hold more than one program? Is there a limit like in real life?
Atm I'm using script from Cookiebal's Chicken farm as a reference and making a quarry control system.. but I've yet to try using 'if', 'or', or 'else'.
(Forgot about the examples in the OP)
Should be fun learning through trial and error, do you have any computercraft projects you are currently working on?-------------------------------------------------------
Finally ran into some trouble on those if statements :tongue.gif:
Yet this doesn't power the wire. (I'm using redwire not bundled wires)
LOL i'm tired, I used input instead of output.
What is on the floppies and how they work is exactly the same as your computer's filesystem. There is a dedicated folder for each floppy as well as each computer in the world's save folder.
I currently do not have any active projects for Lua, but I do have one that's on hold as I have been busy recently under personal business as well as how I'm trying to learn C++. I should also update the wiki page for the pullEvent system as that is a really great tool that Dan has blessed us with . That basically allows us to wait for an input to happen, and if that input happens then do this. Events can be from the user pushing a button to a disk being inserted or removed from a disk drive.
I updated my post right as you posted so I think you missed the problem I added. >_<
I think I'm going to do some indepth tutorials on each subject(that I understand), and in the future stick them into one video with a menu in it. Would it be okay to embed the seperate videos in the wiki later on? I don't want to advertise my channel, i just figured it might help.
But you need to redo the whole thing lol they updated the forum
/: hate the new update cant use gif's for pics anymore
this is not working for my. i am getting atempt to call nil error. and i have no idea why.
i enter
redstone.setoutput("left", true)
and i get that error...
1. Technicpack.net won't respond when I try to download.
2. Manually downloading it and setting it up just gets me an error the second I open a world.
Damn you Minecraft and you're annoying intolerance to mods!!!
Code 1:
if hasAudio(right, side) then
playAudio(right, side)
Print("Now playing music")
sleep(30)
term.clear()
Print("Stoping music")
stopAudio(right, side)
textutils.slowprint("Ejecting disk")
eject(right, side)
else
Print("no music disk is in the disk drive")
end
ERROR: startup:1: attempt to call nil
hasAudio(right, side) then
playAudio(right, side)
Print("Now playing music")
sleep(30)
term.clear()
Print("Stoping music")
stopAudio(right, side)
textutils.slowprint("Ejecting disk")
eject(right, side)
else
Print("no music disk is in the disk drive")
end
ERROR: bios:206" [string "startup"]:1: unexpected symbol
Also this may be a possibility; I read the wiki on the disk api that you could use music discs (the default ones) in the drives. Is that not the case and its somehow possible to create music on a floppy?
+1
~Onionnion
Your syntax (programming grammar) is really messed up. The correct way for the first code would be:
Try taking a look over that and what's different and also try seeing if you can find the mistakes with the second script. Remember, programming/scripting is all about solving problems!
Those are the computer's commands, not Lua commands. Lua is the scripting language and is separate from the programs you run such as 'cd' or 'ls'. The Lua program just lets you enter Lua commands and to experiment with Lua step-by-step, or command-by-command. If you're in Lua and want to get out of it, just enter 'exit()'.
I might as well resubmit the whole post I guess. Will look into it, just been so busy lately.
bios:206: [string "startup"]:11: 'do' expected
I assume the 11 refers to a line number but i see a 'do' in that line. unsure as to how this is fixed
Thanks for your help in advance
-----------------------------------------------------------
PASSWORD = "programming"
print("Loading System . . .")
sleep(2)
print("Loading Files . . .")
sleep(2)
print("Complete!")
sleep(1)
i = 0
b = false
while i != 3 do
print("Password: ")
p = read()
if p == PASSWORD then
b = true
i = 3
else
print("Incorrect Password")
i = i+1
t = 3-1
print("You have: " t "more attempts")
end
end
if b != true then
os.shutdown()
end
It looks like you're mixing up the unequal-to signs for C and Lua. In Lua, unequal-to is represented with '~=', so all you really have to do with replace every '!=' with '~='.
I had actually figured out there was some sort of syntax error with the "not equals" operator. I simply changed the syntax to read "equals" (obviously altering the program slightly) but it functions now. I am familiar with c and java so this is slightly different :P.
Do you happen to know how to use the print() function to handle multiple data types (idk how to explain this)
for instance in java i would say | System.out.println("You have: " + t + "attempts."); to execute a print string where t is a calculated value
or in c++ i would say | cout << "You have: " << t << "attempts." << endl;
i would like to do the same thing with this.