5 posts
Posted 01 March 2012 - 08:19 AM
OK so I've literally just picked up LUA yesterday, I have about 2 semesters experience with VB.net and decided I wanted to strain my brain.
So I decided to write a chat program and I've hit some road bumps and in the code I've dropped a few notes regarding my problems..
I'm just asking for some pointers for the code overall and how to go about things..
The point is me learning this stuff.
http://pastebin.com/yaP5cURH
454 posts
Location
London
Posted 01 March 2012 - 08:47 AM
Hi there, Naab007!
To help us help you, you should really post your error message!
But from looking at your code, I have a few pointers:
1) You need to call functions, even if you are not passing any arguments!
function a()
end
a -- This will cause an error!
a() -- This is what you want to do.
2) Similarly, when you define a function, you also need to use parenthesis:
function a
end
-- Above will error!
-- You want this:
function a()
end
3) Read the error messages you get! They will almost always point you to the right direction, or tell you what's wrong.
5 posts
Posted 01 March 2012 - 09:46 AM
This isn't the standard error message question, this is how to go about things, how the logic is behind building up blocks and whatnot.
Just tips like you just posted will save my life..
454 posts
Location
London
Posted 01 March 2012 - 10:03 AM
You'll probably want to read this thread, then:
http://www.computercraft.info/forums2/index.php?/topic/144-useful-tutorials-resources/This book will teach you most of the Lua basics:
Programming in LuaNote that some of the functions don't exist in CC.
5 posts
Posted 01 March 2012 - 11:18 AM
Thnx, I do need down to earth feed back, like how you'd do it and why its better than the way I'm doing it..
I'm currently reading up on a lot of lua, and coding after I find useful examples, hence the mess of my code.. albeit I've seen a lot worse code..