Posted: 27th Apr 2003 20:19
If you add some things you cold use it as a password protecter.

EXAMPLE:
Login: Redostrike
Pass: *********

+ Code Snippet
a=15

do
wait 5
if inkey$() = "" 
  goto ok
else
set cursor a,15
print "*"
a = a + 10
endif
ok:
loop
Posted: 27th Apr 2003 22:53
Common peeps any inprovement any comments?
Posted: 27th Apr 2003 23:47
Umm, maybe you should expand on it by having you insert a password un-starred at the beginning like you are creating an account, and then have you insert your password using the little star thing and check it to see if it is correct.
Posted: 28th Apr 2003 19:30
I'm unsure how to use that in my code, I want an asterisk (*) to appear for each character they press.

Help please?
Posted: 28th Apr 2003 19:44
This code does it but you can't check if the password id typed right. I dontknow how to do that. Sorry.
Posted: 28th Apr 2003 21:36
Could you please show me how to do that with my code please?
I'm a little unsure,
thanks in advance.

+ Code Snippet
INPUT "Name: ", NAME$
INPUT "Password: ", PASSWORD$
INPUT "Retpye Password: ", PASSWORD2$
Posted: 28th Apr 2003 21:45
That is the prob. i dont know i wanted to try this but i dident work. Sorry !
Posted: 28th Apr 2003 21:47
Does someone please know?
Posted: 29th Apr 2003 3:25
You need to run it 2 times and check the strings like:

If pass$ = passb$ Then ...

I'll write up a function a little later when I have time.
Posted: 29th Apr 2003 3:55
i modificated ..your code a little bit...
not case sensitive:

+ Code Snippet
print "Password=";
pass$="WeHaveAProblem"
pass2$=""
while returnkey()=0
   if inkey$()="" then last=0
   if (inkey$()<>"") and (last=0)
      char=asc(lower$(inkey$() ))
      if (char>=97) and (char<=122)
         print "*";
         pass2$=pass2$+chr$(char)
         last=1
      endif
   endif
endwhile
cls
if lower$(pass$)=Lower$(pass2$) then print "Loged on Nasa NetWork... enjoy :D"
Posted: 29th Apr 2003 4:32
Ok, I'm done. (see source)
It's case sensitive and includes spaces.

To use it just do something like:

+ Code Snippet
If password("password", "Enter Password", "Re-enter Password", "Password Ok","Access denied",1) Then .....


You can change the password, messages, and validation (1 for enter twice, 0 for enter once).
Posted: 1st May 2003 6:14
hmmm thats pretty kewl. that would be good for MMOGs or even a single player game with maybe different players and loading games(so someone else doesn't load up and corrupt your game *thinks back to a few past experiences*)

*quickly stores the code into a snippet
Posted: 4th May 2003 16:11
Andrew I'm not quite sure how to incorporate that, I'm new to functions..

could you write a small piece of code that uses the function please?
like lets say:
+ Code Snippet
INPUT "Password please: ", what_var_here?$
Posted: 4th May 2003 17:43
I'm surprised no-one's tried it this way.

+ Code Snippet
Do
	password$ = password$ + entry$():clear entry buffer
	If scancode()=14 then password$=left$(password$,len(password$)-1)
	display$=""
	For x = 0 to len(password$)
		If x>0 then display$=display$ + "*"
	Next x
	Text 170,32,display$
	Sync
Loop

Hope this helps
Posted: 4th May 2003 18:17
Is that in real-time?

Like you press 1, it comes up in a * as you press it?
Posted: 4th May 2003 20:53
It should do that. It also allows you to delete stuff and the number of stars is reduced.
Posted: 4th May 2003 21:53
You need to do:

If password([parameters])
[code goes here]
Endif

Inside the parenthesis you put:

-password string
-message to enter password
-message to reenter password
-message when password is correct
-message when password is incorrect
-validate? (1 for enter twice, 0 for enter once.)

Example:
If password("password", "Enter Password", "Re-enter Password", "Password Ok","Access denied",1) Then .....

@witchbomber

Mine does that too. It also allows reentry of passwords and checks them.
Posted: 4th May 2003 22:51
Yeah I didn't see the source button, but I noticed with yours because you didn't use the entry buffer you missed some characters when typed at speed. However, I might use your idea of a function with Re-enter password etc. In my games I actually just end the program if someone enters an incorrect password! That really needs changing.
Posted: 5th May 2003 2:28
The stars aren't reduced because their still on the screen but if u used an integer to count the number of stars and the used a cls command at the front of the loop and print the num of stars every time it loops.
Posted: 5th May 2003 3:29
I didn't post the whole code because that was lifted from part of a game but in the game I had a cls command. The reason it wasn't in there was because I had other things in there (username, continue button) and I edited these out.