Jump to content




[Api] Smigolpol's Password System[V1.2]


14 replies to this topic

#1 smigolpol

  • Members
  • 11 posts
  • LocationPoland

Posted 23 December 2012 - 09:17 AM

Maybe it's not very original idea, but I think It can be useful.

The API


SPS is a system to set, remove and force password anytime you want. Not much more I can tell about it...

Functions:
Spoiler

Pastebin install:
pastebin get Lx8enqbA sps


Example use:
Protected HelloWorld:
os.loadAPI("sps")

sps.setPassword("yourpassword")
sps.security()
print("Hello world!")   --This line will only work if the password is correct

Force use to enter all your passwords:
os.loadAPI("ps")

local list = {
"thecakeisalie",
"ilikecookies",
"passwordnumber3",
"notapassword",
}

for i = 1, #list do
	ps.setPassword(list[i])
	ps.security()
end

term.setTextColor(colors.green)
print("You did it! :D/>/>")
sleep(3)
term.clear()

Features:
  • Universality
  • Color support
  • Multiple use without any errors
Change log:
Spoiler

Thanks for reading! I hope you'll like it.

#2 Oct125

  • Members
  • 49 posts

Posted 23 December 2012 - 11:06 AM

?

#3 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 23 December 2012 - 11:06 AM

Err... post fail?

#4 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 23 December 2012 - 11:31 AM

-snip-

#5 smigolpol

  • Members
  • 11 posts
  • LocationPoland

Posted 24 December 2012 - 09:42 PM

-

#6 smigolpol

  • Members
  • 11 posts
  • LocationPoland

Posted 26 December 2012 - 11:58 PM

The thread has been edited. Try it now...

#7 rick3333

  • Members
  • 30 posts

Posted 14 January 2013 - 10:40 PM

this api is epic. I used it to create a double lock program it is 10 lines

#8 smigolpol

  • Members
  • 11 posts
  • LocationPoland

Posted 17 January 2013 - 06:18 AM

View Postrick3333, on 14 January 2013 - 10:40 PM, said:

this api is epic. I used it to create a double lock program it is 10 lines
Sorry for late reply, but thanks!

#9 mibac138

  • Members
  • 132 posts
  • LocationPoland

Posted 17 January 2013 - 06:56 AM

Preety cool! :)

I think you are from Poland is that right? ;)

#10 smigolpol

  • Members
  • 11 posts
  • LocationPoland

Posted 17 January 2013 - 10:59 PM

View Postmibac138, on 17 January 2013 - 06:56 AM, said:

I think you are from Poland is that right? ;)
Yes. That's right. ;)
And this is just my first API ever. So I didn't think it can get a positive opinion... But anyway seems like it can be useful.

#11 mibac138

  • Members
  • 132 posts
  • LocationPoland

Posted 20 January 2013 - 08:55 AM

:)

#12 NeverCast

  • Members
  • 400 posts
  • LocationChristchurch, New Zealand

Posted 22 January 2013 - 05:55 PM

Under function security(), put

local pe = os.pullEvent
os.pullEvent = os.pullEventRaw

then at the bottom put

os.pullEvent = pe

This prevents people terminating the program.

You might also want to use a while loop instead of recursive calling the checkPassword function, to prevent stack overflow.

Either way, It's very good! Well done.

#13 smigolpol

  • Members
  • 11 posts
  • LocationPoland

Posted 22 January 2013 - 11:55 PM

Thanks for hints and corrections! I wasn't actually going to edit it any more, but I can make a new version when I'll have some time.

View PostNeverCast, on 22 January 2013 - 05:55 PM, said:

You might also want to use a while loop instead of recursive calling the checkPassword function, to prevent stack overflow.
No, this method is good for me, because I can precisely define when the method should loop and when it should end. Well, for now it doesn't overflow, I'll think about it then.

#14 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 23 January 2013 - 12:02 AM

View Postsmigolpol, on 22 January 2013 - 11:55 PM, said:

Well, for now it doesn't overflow, I'll think about it then.
Well if it hits 255 then it will overflow so...

#15 smigolpol

  • Members
  • 11 posts
  • LocationPoland

Posted 24 January 2013 - 04:37 AM

I edited this topic to version 1.2.
The title should be:
[API] Smigolpol's Password System[v1.2]

But the editor doesn't let me save it like that... :huh: :mellow:





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users