mIRC Home    About    Download    Register    News    Help

Print Thread
#5473 08/01/03 03:04 AM
Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
ok i made this script -
Code:
on *:text:register*:?: {
  var %register = $read(register.txt)
  if (!$2) {
    notice $nick Error: Please specify your password.
    notice $nick Usage: regsiter <password>
    notice $nick Notice: You must use this nick when you come back to this server.
  }
  elseif ($nick isin %register) {
    notice $nick Error: Nick all ready registered please pick another nick.
    notice $nick Usage: register <password>
  }
  elseif ($nick !isin %register) {
    write register.txt $nick $2
    notice $nick Thank you for registering.
    notice $nick Notice: Your password is $2 remember this for later use.
    notice $nick Notice: To login type: /msg $me login <password>
  }
}

this script works now i just want this one to work with it -
Code:
on *:text:login*:?: {
  var %register = $read(registered.txt)
  var %online = $read(online.txt)
  if (!$2) {
    notice $nick Error: Please specify your password.
    notice $nick Usage: login <password>
  }
  elseif ($nick isin %register) && ($2 isin %register) {
    write %online $nick
    notice $nick Welcome back $nick $+ .
    notice $nick Please idel in #FutureWeb
  }
  elseif ($nick !isin %register) && ($2 !isin %register) {
    notice $nick Error: Nickname or password incorect.
    notice $nick Usage: login <password>
  }
}

idk whats wrong with the login one its really irtating me -_-
confused :tongue:


Need amazing web design for low price: http://www.matrixn3t.net
Joined: Dec 2002
Posts: 395
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Dec 2002
Posts: 395
$read(file) reads a _random_ line from a file.

Joined: Dec 2002
Posts: 83
A
Babel fish
Offline
Babel fish
A
Joined: Dec 2002
Posts: 83
Try $read(file, s, $nick) or $read(file, w, $nick)

Joined: Jan 2003
Posts: 44
L
Ameglian cow
Offline
Ameglian cow
L
Joined: Jan 2003
Posts: 44
also make sure you have spaces around all operators and parenthesis.

not doing that causes the most wicked errors.

also, check your main status window, mirc will list errored lines in that window.

Joined: Dec 2002
Posts: 397
A
ATMA Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Dec 2002
Posts: 397
i tired the , w, $nick) still doesnt work right it gives sends me the error -
+6:14:37a -WebBot- Error: Nickname or password incorect.
+6:14:38a -WebBot- Usage: login <password>
i still cant figur it out


Need amazing web design for low price: http://www.matrixn3t.net
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Out of curiosity, why not use an INI file, and make maters eaier? If you are geared toward a hard file for saving the data, but wtill want the reverance ability, just use an INI file.

Quick and easy as $readini(users.ini, Users, $nick)

If the result is $null, they are not registered, else they are and the value holds the password.

-KingTomato
http://www.kingtomato.com/
AIM: otamoTgniK


-KingTomato
Joined: Dec 2002
Posts: 16
A
amr Offline
Pikka bird
Offline
Pikka bird
A
Joined: Dec 2002
Posts: 16
I believe you have set the variables to read different text files

the register one uses register.txt, however, the login one uses registered.txt

hope this works smile


Link Copied to Clipboard