Thread: [Essentials Script] Password Gift
View Single Post
Old March 4th, 2012 (1:28 PM). Edited March 4th, 2012 by FlipelyFlip.
FlipelyFlip FlipelyFlip is offline
Arr teh Pirate
Join Date: Feb 2012
Location: Bregenz
Age: 25
Gender: Male
Nature: Relaxed
Posts: 44
Send a message via ICQ to FlipelyFlip Send a message via Windows Live Messenger to FlipelyFlip Send a message via Skype™ to FlipelyFlip
@Awkward Squirrle:
The switch-thingy is still in
I'm just checking if the defined switch is true or not. If a password sets the switch to true, it'll be for all other passwords which uses this switch to true (:
And about the chomp, I've only worked with the included standard stuff from rgss. I haven't seen all new methods and functions for arrays and hashes. So I fought it would be better for me at first to work with standard than with the included stuff. But don't worry, I'm still testing and working to get all new stuff (:

@Ho-oh 112:
you mean to setup it in an event without a pre-defined password? I can put it in, it's not really a problem.

@all other who requested an online-function:
I have to say it would go over my actual scripting knowledge. I will add it, but it will take time until I know how the online function works ._.


(btw: please call me flip or flipy, easier to write and it's a shorter form)


For a password not defined in the hash, you can also use this one:

# Module Password
# password = "password"
# minlength = minimum of letters or symbols to enter
# maxlength = maximum of letters or symbols to enter
module Password
  def self.enter(password, minlength, maxlength)
    pass = pbEnterText(_INTL("Enter the password"),minlength,maxlength)
    if pass.scan(/\r/) == ["\r"]
      slicing = pass.size - 1
    if pass == password
      Kernel.pbMessage(_INTL("Correct password!"))
      return true
      Kernel.pbMessage(_INTL("Incorrect password."))
      return false

to use it, just use the conditional branch script and type in: Password.enter("password", minlength, maxlength).
"password" = password used
minlength = minimum amount of characters
maxlength = maximum amount of characters

and thats it (:

Reply With Quote