I am not sure, as I borrowed the code. All I know is, it works perfectly as is besides for the return issue. I can change the password==password to any password that I want. Example "password==yogi". Its just reading from the prompt and compairing to a preset. At least, that is the way that I have understood it. I am using "password==Jerry" right now. You know, keeping it simple.
I actually have no idea why they set it up as the following, as the pass1 variable is does not appear to be called on anywhere else in the script, but I know that it doesnt work at all if I dont leave it in.
I am just looking to replace return with somthing more along the lines of
"Application.ExitScript();". That is lua, and it does exactly what it says it does. I dont have to return an undefined value in lua. Oh, and if I define return, the script crashes completely.
And yeah, I see what you are getting at because in pretty much every other language, that wouldnt work. But in this case, it does. Meh, I have been out of the JS
game too long.
Thank you for the quick reply btw.
I also wish to clarify a few things.
First; When I say that I borrowed the script, I mean that I got it from a JS
coding website that I am using to relearn what I once knew. I just modified the script to fit my needs. I suppose by defination that makes me a script kiddie, but that hardly fits the way I normally do things. Borrowing code is just somthing that I do on my way to learn. I do not make a habit of it.
Second; The unmodified version was using an alert prompt, but I find two prompts to get one thing done to be excessive and annoying. That is why I am looking for a way to simply stop the execution in its tracks. The alert box did that just fine, but again, it was annoying.
Third; Before anyone points out the obvious, of course I know that all someone would have to do to get the password is to view the source code. For the most part, the site is off the grid anyway. I just want to keep prying eyes away should some random person stumble upon it. I am not trying to keep anyone whom knows anything about coding out, as I already know that wouldnt work. I can use a JS
encoder or somthing, but that would only slow someone down.