Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-11-2010, 10:27 AM
iSlayer iSlayer is offline
Snk for manager
iSlayer's Avatar
Join Date: Feb 2010
Location: Room 7, Era Hotel, Era
Posts: 202
iSlayer will become famous soon enough
Thumbs down [Help] Password Protected Door

Hey guys what codes would I need to make a password protected door? I am not very good at scripting so I need some help!

Would it be like:

FunctionPlayerChats()
{
"password here"
setlevel2=secret.nw
}

I know it's horrible x-x, can someone help me fix it up?
__________________
Snk for manager




Quote:
Originally Posted by Admins View Post
Snk for manager of Era
Reply With Quote
  #2  
Old 06-11-2010, 10:31 AM
iSlayer iSlayer is offline
Snk for manager
iSlayer's Avatar
Join Date: Feb 2010
Location: Room 7, Era Hotel, Era
Posts: 202
iSlayer will become famous soon enough
This script would probably stuff up graal because it's so bad
__________________
Snk for manager




Quote:
Originally Posted by Admins View Post
Snk for manager of Era
Reply With Quote
  #3  
Old 06-11-2010, 11:20 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
PHP Code:
function onPlayerChats() {
  if (
player.chat == "the password") {
    
player.setLevel2("mylevel.nw"3232);
  }

I feel bad giving code without explaining it but I think you need to learn the basics of scripting first or you wouldn't understand the explanation anyway.
__________________
Reply With Quote
  #4  
Old 06-11-2010, 11:41 AM
iSlayer iSlayer is offline
Snk for manager
iSlayer's Avatar
Join Date: Feb 2010
Location: Room 7, Era Hotel, Era
Posts: 202
iSlayer will become famous soon enough
Well I was close! Just missing some (
__________________
Snk for manager




Quote:
Originally Posted by Admins View Post
Snk for manager of Era
Reply With Quote
  #5  
Old 06-11-2010, 01:01 PM
LordSquirt LordSquirt is offline
|Mêrçy|
LordSquirt's Avatar
Join Date: Dec 2008
Location: NY
Posts: 958
LordSquirt is a name known to allLordSquirt is a name known to allLordSquirt is a name known to allLordSquirt is a name known to all
I like your dedication
__________________
Reply With Quote
  #6  
Old 06-11-2010, 03:03 PM
Gothika Gothika is offline
Global News Team
Gothika's Avatar
Join Date: Mar 2006
Location: Newcastle, England
Posts: 2,425
Gothika is a splendid one to beholdGothika is a splendid one to beholdGothika is a splendid one to beholdGothika is a splendid one to beholdGothika is a splendid one to behold
Quote:
Originally Posted by iSlayer View Post
This script would probably stuff up graal because it's so bad
Just work on your if statements a bit then you'll get the hang of things.
__________________


Reply With Quote
  #7  
Old 06-11-2010, 04:29 PM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
I feel like explaining it for him

PHP Code:
function onPlayerChats() {
  if (
player.chat == "the password") {
    
player.setLevel2("mylevel.nw"3232);
  }

Now function onPlayerChats is self explainitory for the function is of when a player is to speak.
the if statement is where the condition for your doors password is set.

In this case if you were to say "the password" or whatever you set it to.
Your players level would then be set to the level, x and y coordinates in said level.

Hope this helps you understand it a bit more.
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #8  
Old 06-11-2010, 05:23 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Here's a fun example of keeping a password secure. Let's say you have a password, "test" and you don't want any other scripter to know that the password is "test." You could do:
PHP Code:
function onPlayerChats() {
  if (
md5(player.chat) == "098f6bcd4621d373cade4e832627b4f6") {
    
setlevel2("testlevel.nw"3030);
  }

Now simply say "test", and it'll warp you to testlevel.nw. Since there is no way to "decrypt" md5 other than brute force, this is a secure way to store odd passwords such as the password "aU4vOlz1" since they are not easily brute forced.

If you want to know the md5 of a string, you can do echo(md5("test"));
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #9  
Old 06-11-2010, 05:46 PM
Mark Sir Link Mark Sir Link is offline
Kevin Azite
Mark Sir Link's Avatar
Join Date: Sep 2005
Posts: 1,489
Mark Sir Link is just really niceMark Sir Link is just really nice
Send a message via AIM to Mark Sir Link
http://tools.benramsey.com/md5/
Reply With Quote
  #10  
Old 06-11-2010, 05:48 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by Mark Sir Link View Post
Which is a "rainbow table", not an actual decryption. Rainbow tables are large databases of words that have been encrypted into md5 and the word + the hash is stored, so if someone searches for the word, it can find the hash. It's not applicable for "decrypting" passwords that are unique though, like the one I stated above, "aU4vOlz1". It will only return results for stupid passwords like "cat", "dog", "1111", "1112" etc.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #11  
Old 06-27-2010, 11:48 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
great, keep advertising obsolete hash functions because they might not break down retardedly in your specific use case maybe
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:12 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.