Jump to content




Computercraft turorial series


  • You cannot reply to this topic
15 replies to this topic

#1 Hackingroelz

    Peripheral Designer

  • Members
  • 213 posts
  • Locationthe Nether(lands)

Posted 11 March 2012 - 02:16 PM

I started a little series of Computercraft tutorials.

Tutotrial 1:
Spoiler


#2 Advert

    Custom Title

  • Moderators
  • 459 posts
  • LocationLondon

Posted 11 March 2012 - 04:01 PM

I really don't see why you can't post them here.

#3 Polyryph

  • New Members
  • 4 posts

Posted 20 March 2012 - 05:30 AM

Thanks for the tutorial, I found it very helpful..

Though i'm new to this mod, i've spent a lot of time coding Lua before, but of course not in this format and i'm unsure if the format is the same.

I do have a question, as this 'lock would allow anyone in, even if they just press enter immediately, is there a way to make it somewhat more like a lock? In the sense that, if they get their name wrong they can't gain access.
For eg; pass = "*name*" or pass = "*name* , *name* , *name* .. etc "
Somewhere within the code?

I guess what i'm asking ultimately is, is that possible and how would I write in multiple 'passwords' for multiple users.

Essentially, i'm not really locking anyone out.. But it would be nice for the users to be forced to actually type their name as opposed to not and still gaining access to the location.

Once again, thanks for the better understanding of the computercraft lua format and your time =)

Kind regards.

#4 Advert

    Custom Title

  • Moderators
  • 459 posts
  • LocationLondon

Posted 20 March 2012 - 11:02 AM

View PostPolyryph, on 20 March 2012 - 05:30 AM, said:

Thanks for the tutorial, I found it very helpful..

Though i'm new to this mod, i've spent a lot of time coding Lua before, but of course not in this format and i'm unsure if the format is the same.

I do have a question, as this 'lock would allow anyone in, even if they just press enter immediately, is there a way to make it somewhat more like a lock? In the sense that, if they get their name wrong they can't gain access.
For eg; pass = "*name*" or pass = "*name* , *name* , *name* .. etc "
Somewhere within the code?

I guess what i'm asking ultimately is, is that possible and how would I write in multiple 'passwords' for multiple users.

Essentially, i'm not really locking anyone out.. But it would be nice for the users to be forced to actually type their name as opposed to not and still gaining access to the location.

Once again, thanks for the better understanding of the computercraft lua format and your time =)

Kind regards.

Hi Polyryph, you should post your questions in the Ask A Pro forum, as more people will see your post, and you won't derail other people's threads.

#5 Polyryph

  • New Members
  • 4 posts

Posted 21 March 2012 - 03:19 AM

View PostAdvert, on 20 March 2012 - 11:02 AM, said:

View PostPolyryph, on 20 March 2012 - 05:30 AM, said:

Thanks for the tutorial, I found it very helpful..

Though i'm new to this mod, i've spent a lot of time coding Lua before, but of course not in this format and i'm unsure if the format is the same.

I do have a question, as this 'lock would allow anyone in, even if they just press enter immediately, is there a way to make it somewhat more like a lock? In the sense that, if they get their name wrong they can't gain access.
For eg; pass = "*name*" or pass = "*name* , *name* , *name* .. etc "
Somewhere within the code?

I guess what i'm asking ultimately is, is that possible and how would I write in multiple 'passwords' for multiple users.

Essentially, i'm not really locking anyone out.. But it would be nice for the users to be forced to actually type their name as opposed to not and still gaining access to the location.

Once again, thanks for the better understanding of the computercraft lua format and your time =)

Kind regards.

Hi Polyryph, you should post your questions in the Ask A Pro forum, as more people will see your post, and you won't derail other people's threads.

Duly noted. Thank you =)

#6 iZINC

  • Members
  • 4 posts
  • LocationRight behind you...

Posted 03 April 2012 - 06:28 PM

would it possible for a video series at some point?

#7 Noodle

  • Members
  • 989 posts
  • LocationSometime.

Posted 03 April 2012 - 09:39 PM

Videos would be nice.
Could make an in-game tutorial.
Then again, people can read the one already made.

#8 EmTeaKay

  • Members
  • 115 posts

Posted 04 April 2012 - 06:28 PM

Don't for get to add this to the top and bottom. Makes it so you can't Ctrl+T out.
local oldPull = os.pullEvent;
os.pullEvent = os.pullEventRaw;
[Code Here]
os.pullEvent = oldPull;


#9 Aerik

  • New Members
  • 15 posts

Posted 06 April 2012 - 06:39 PM

Very nice and helpful! I would definitely love to see further parts being posted in this thread :)/>

#10 Teraminer

  • New Members
  • 175 posts
  • LocationDon't look behind you..

Posted 19 April 2012 - 05:36 PM

View PostEmTeaKay, on 04 April 2012 - 06:28 PM, said:

Don't for get to add this to the top and bottom. Makes it so you can't Ctrl+T out.
local oldPull = os.pullEvent;
os.pullEvent = os.pullEventRaw;
[Code Here]
os.pullEvent = oldPull;
If you put at the top
os.pullEvent = os.pullEvent
Would it be wrong?

#11 Wolvan

  • New Members
  • 384 posts
  • LocationIn the TARDIS

Posted 19 April 2012 - 07:49 PM

View PostTeraminer, on 19 April 2012 - 05:36 PM, said:

View PostEmTeaKay, on 04 April 2012 - 06:28 PM, said:

Don't for get to add this to the top and bottom. Makes it so you can't Ctrl+T out.
local oldPull = os.pullEvent;
os.pullEvent = os.pullEventRaw;
[Code Here]
os.pullEvent = oldPull;
If you put at the top
os.pullEvent = os.pullEvent
Would it be wrong?
Nope it is just that you would overwrite a global variable that will stay even if the program ends. That means that it will be in all other programs. You wouldn't be possible to CTRL+T them. oldPull just resets the os.pullEvent again and makes it possible to terminate.


@Polyryph
yep just add
if input == "yourPass" then
[code to open door]
else
print("You are not allowed to enter! Leave!")
sleep(3)
os.shutdown()
end

#12 Teraminer

  • New Members
  • 175 posts
  • LocationDon't look behind you..

Posted 19 April 2012 - 07:53 PM

and what is that ; in the end of os.pullEvent/Raw

#13 Wolvan

  • New Members
  • 384 posts
  • LocationIn the TARDIS

Posted 20 April 2012 - 10:49 AM

Ehh yeah. Don't really know why it is there. It doesn't really belong there

#14 djblocksaway

    Epic Coderz

  • New Members
  • 397 posts
  • LocationAustralia

Posted 20 April 2012 - 01:36 PM

this tutorial is good for noobs and people that are new to computercraft

good job :)/>

#15 cant_delete_account

  • Members
  • 484 posts

Posted 20 April 2012 - 03:55 PM

View PostTeraminer, on 19 April 2012 - 07:53 PM, said:

and what is that ; in the end of os.pullEvent/Raw
I think some people get it confused with Java. xD

#16 EmTeaKay

  • Members
  • 115 posts

Posted 20 April 2012 - 05:55 PM

View PostTeraminer, on 19 April 2012 - 07:53 PM, said:

and what is that ; in the end of os.pullEvent/Raw
That's how I found it. I assumed it was the only way to do it.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users