Axe Software Forums
  Quest Developer Forum
  changing strings


Author Topic:   changing strings
Gwerradon posted 25-05-2003 03:11 BST     
how do i make it so....

When the program loads, it asks you to login.

now then...

When the play logs in using the default password, i want him/her to be able to choose an option where they can change the password, so when they login, they can type

passwrd, instead of the default, password.

so far i have this.... but it doesnt work :(

' "Password Manager"
' Created with QDK 3.12

define game <Password Manager>
asl-version <311>
start <Account>
game author <RavenStormUK Development>
game version <0.1>
game copyright <Copyright � 2003 RavenStormUK Development>
game info <ASL scripted password manager to store all your passwords.>
startscript msg <|n|n .|cr..........................|cb.|n |bWelcome to Password Manager 0.1|xb|n .|cr..........................|cb.>
end define

define synonyms
end define

define room <Account>
alias <Account>
prefix <You have accessed your>
indescription <:>
end define

define procedure <login>
msg <|nEnter your Login ID:|n>
enter <password>
if ( password = password ) then goto <Account> else {
msg <|n|b|crINVALID PASSWORD|xb|cb>
do <login>
}
end define


help! =(

Gwerradon posted 25-05-2003 03:27 BST          
ok i messed around with that and got it right. all i need to know now, is how to change it so that when the player saves the "game" (lol), the next time he/she logs in they can enter the password they set instead of the default
Alex posted 25-05-2003 11:41 BST          
This line:

if ( password = password ) then goto <Account> ...

should read:

if ( #password# = password ) then goto <Account>

- otherwise the condition is always true, as the text "password" is always equal to the text "password", which means the player could never type in the wrong password!

Gwerradon posted 25-05-2003 14:38 BST          
yeah i figured that out lol. im just trying to figure out how to program it so that the user can change the password
I think Im Back posted 27-05-2003 12:00 BST          
I was bored so I made this, basically does logging in. You can easily create something for when the player makes his character, it makes an object with the player's name and gives it a property of pw="their password". Then assign other variables, which can be stored in the player object for convenience(this way all the players stats and such are one object, and all those properties can be copied from the object to the player entity in a quest game), assign the variables in the same piece of code where it moves them to the room Account.

Man I kick Ass...

' "Password Manager"
' Created with QDK 3.12

define game <Password Manager>
asl-version <311>
start <Login>
game author <RavenStormUK Development>
game version <0.1>
game copyright <Copyright � 2003 RavenStormUK Development>
game info <ASL scripted password manager to store all your passwords.>
startscript msg <|n|n .|cr..........................|cb.|n |bWelcome to Password Manager 0.1|xb|n

.|cr..........................|cb.>
end define

define synonyms
end define

define room <Account>
alias <Account>
prefix <You have accessed your>
indescription <:>
end define

define room <Login>
alias <Login>
prefix <Please>
indescription <:>
script {
enter <id>
if exists <#id#> then {
msg <Enter password for the #id# account.|n>
enter <pw>
if ( #pw# <> $objectproperty(#id#; pw)$ ) then {
msg <Incorrect Password.>
goto <Login>
}
else {
msg <Password Correct. |n|nLogging In...>
goto <Account>
}
}
else {
msg <No account exists named #id#.|n>
goto <Login>
}
}
end define

define room <Admin>
alias <Admin Area>
prefix <The>
indescription <:>
define object <I think I'm Dead>
properties <pw=ZOMBIE; suffix=owns you!>
end define
end define

Gwerradon posted 27-05-2003 13:43 BST          
ok so wots the login id and pass then? :S
Computer Whizz posted 30-05-2003 01:28 BST          
User: I think I'm Dead
Password: ZOMBIE

All you need to do is create an object and have the object with a password property. As shown in "I think I'm back"'s example.

Computer Whizz

Gwerradon posted 01-06-2003 05:38 BST          
' "Password Manager"
' Created with QDK 3.12

define game <Password Manager>
asl-version <311>
start <Login>
game author <RavenStormUK Development>
game version <0.1>
game copyright <Copyright � 2003 RavenStormUK Development>
game info <ASL scripted password manager to store all your passwords.>
startscript msg <|n|n .|cr..........................|cb.|n |bWelcome to Password Manager 0.1|xb|n

.|cr..........................|cb.>
end define

define synonyms
end define

define room <Account>
alias <Account>
prefix <You have accessed your>
indescription <:>
end define

define room <Login>
alias <Login>
prefix <Please>
indescription <:>
script {
enter <id>
if exists <#id#> then {
msg <Enter password for the #id# account.|n>
enter <pw>
if ( #pw# <> $objectproperty(#id#; pw)$ ) then {
msg <Incorrect Password.>
goto <Login>
}
else {
msg <Password Correct. |n|nLogging In...>
goto <Account>
}
}
else {
msg <No account exists named #id#.|n>
goto <Login>
}
}
end define

define room <Admin>
alias <Admin Area>
prefix <The>
indescription <:>
define object <I think I'm Dead>
properties <pw=ZOMBIE; suffix=owns you!>
end define
end define

Gwerradon posted 01-06-2003 05:38 BST          
u sure thats right because i cant play it, it has an error message
I think Im Back posted 01-06-2003 16:21 BST          
It works perfectly, the problem is...

When copying the asl from these forums, the party where it's like...

startscript msg <|n|n .|cr..........................|cb.|n |bWelcome to Password Manager 0.1|xb|n

.|cr..........................|cb.>
end define

There shouldn't be a blank line in the middle of that. That's just the forums formatting the text. Just open your asl file that you pasted the text into with notepad, find that part, and make it so it's all on one line. Fixes the error.

I think Im Back posted 01-06-2003 16:22 BST          
The party? Man, who can tell what I've been up to?
Gwerradon posted 03-06-2003 08:23 BST          
actually the problem was that

startscript msg <|n|n .|cr..........................|cb.|n |bWelcome to Password Manager 0.1|xb|n

.|cr..........................|cb.>


should be startscript msg <|n|n .|cr..........................|cb.|n |bWelcome to Password Manager 0.1|xb|n

.|cr..........................|cb.

(no > at end)

I think Im Back posted 03-06-2003 08:56 BST          
Actually, no it wasn't. That fixes the problem, because it was caused by an extra '>'. But having the brackets open isn't a solution, it makes it incomplete.
Computer Whizz posted 04-06-2003 03:08 BST          
If you would have followed ITIB's instructions (removed the return) making it all one line - it would have fixed it.

You should know by now everything (well - close enough for a generalization) is opened with <'s and closed by >'s. Without a closing > it should report a missing > (or too many <'s) and not work - unless Alex missed something there.

Computer Whizz

Gwerradon posted 04-06-2003 21:24 BST          
well it worked for me