mIRC Home    About    Download    Register    News    Help

Print Thread
#174339 05/04/07 09:40 PM
Joined: Feb 2007
Posts: 27
S
s0urce Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2007
Posts: 27
Code:
on *:notice:*:?: { 
if ($1 == .login) {
    %nickscan = $read(c:\users\me..\wd.txt, w, $2)
    if (%nickscan == $+($2,$3)) {
      notice $nick You have been logged in, please enjoy your stay.
      set %loggedin $addtok(%loggedin,$nick,32)
    }
  }
}


The text file looks like : nick password level

Any ideas on how to get it to login the user if the password and username in the txt == the one they send.?

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
/server -m <serverip> <port if needed>

on *:connect:{ nickserv identify nickname password }

those are the typical steps to login in to an IRC server.

Joined: Feb 2007
Posts: 27
S
s0urce Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2007
Posts: 27
uhm... not exactly what I meant, I guess I should have been more specific. I meant that I am making a ascipt for someone for a channel login system and game, I have most everything working except how they login to it. They register with a username and password, and then login with that username and password

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
oh I see. Why not an ini file?
[username]
pass=password

Quote:
if ($ini(file.ini,<username>)) {
if ($readini(file.ini,<username>,pass) == <password given>) msg $nick You are now logged in $nick
else msg $nick Incorrect Password $nick
}
else msg $nick you have not registered $nick

Joined: Feb 2007
Posts: 27
S
s0urce Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2007
Posts: 27
oh well I've never had experience with a ini file but thanks I will look into it!.

OK I see but I think I'll have to work on using the text file because differnt users will have differnt passwords, and the like. And it doesn't appear a ini file allows for that.

Last edited by s0urce; 06/04/07 01:41 AM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Here's a re-write that allows for multiple passwords and an ini file. I also added a few other items that you'd probably be wanting, if you didn't already have them.

P.S.: There are lots of other ways of doing this, including using hash tables or text files. If this is a code that's going to be used fairly frequently, then I would recommend using a hash table, rather than a text or ini file.

If you're interested in this option, let me know and I'll do up a code for you.
Code:
on *:text:.login*:?:{
  check_login $nick $$2
}
on *:notice:.login*:?: { 
  check_login $nick $$2
}
alias check_login {
  if $istok($readini(login.ini,n,$1,pass),$2,32) && !$readini(login.ini,n,$1,logged) {
    notice $nick You have been logged in, please enjoy your stay.
    .writeini -n login.ini $1 logged $true
  }
}
on *:part:#:{
  .writeini -n login.ini $nick logged $false
}
on *:quit:{
  .writeini -n login.ini $nick logged $false
}
on *:kick:#:{
  .writeini -n login.ini $knick logged $false
}
on *:text:!register*:?:{
  var %pass = $readini(login.ini,n,$1,pass)
  %pass = $addtok(%pass,$2,32)
  .writeini -n login.ini $nick pass %pass
}


Joined: Feb 2007
Posts: 27
S
s0urce Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Feb 2007
Posts: 27
Ah sorry guys, I realized how much of a nub I was for posting this now. I just needed to take a break from making the bot to get it.

Thanks for the offer however, RussleB.
Also, thanks to Others who took the time to read this and post a reply, especially DJ_Sol

Last edited by s0urce; 06/04/07 03:06 AM.
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
sure no problem. Yeah so you may have figured out your answer but I just wanted to make sure this was clear.

In an ini file each user would have their own section.

Quote:
[user1]
pass=user1's password
[user2]
pass=user2's password
[user3]
pass=user3's password


/writeini file.ini <username> pass <password>

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I think part of his problem with using ini files, is the fact that there is only 1 password per person, and he wanted to be able to have multiple passwords.
The code I provided shows how he can use ini files and have multiple passwords.

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
oh, yeah there is really no limit.
[username]
pass1=
pass2=
passgame1=
passgame2=

Joined: Apr 2007
Posts: 3
K
Self-satisified door
Offline
Self-satisified door
K
Joined: Apr 2007
Posts: 3
DJ Sol i am looking for the exact code i need to put in the remotes area for logging onto gay.com with Mirc. i had it working before but now i cannot find the code i put in the remote section.
im not sure how to write my own, it was one that i found somewhere.
on a Trillian forum i found the other info for the server and port # and password hash.
it looks like this with the server:password:port# but i dont know the EXACT way to get this to work again without that one snippet.
www.gay.com:v0_151875749e1380f53092fe945c7dddf082cc7313243efc08d456284ea05eeccc8817f21de6cf414ec51a88c3233743c1b620b26f5d8f638006444f8e954a91464d8cc2aea20864:7514


Since it is a password protected IRC channel, its not quite as simple as putting in the username and password in the main startup area. it HAS to be done in the remote area.
i spent a long time getting this to work a while back and i reinstalled windows on that PC i was using without saving those files lol
grrrrrr....
so now ive been looking for this info for like 2 days now so
i figured i would just ASK you since your lil bit of code your replied to that other question with was the simplest thing ive seen to do a login. without a long script of actions that is.
thanks for reading!

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Is the channel password protected or is it the actual server?
At what point do you need to supply the password?
Do you have to supply a user name as well?
if you were logging in manually, how would you know when to put in what information?

I tried the link you provided, and got a response saying that a connection could not be made.

Additionally, your post should've been done as a new topic, since it's not properly related to the original question in this topic.

Joined: Apr 2007
Posts: 3
K
Self-satisified door
Offline
Self-satisified door
K
Joined: Apr 2007
Posts: 3
yes it needs a username and password
it logs into the server www.gay.com from entering that in the normal login popup at Mirc startup or in the server list after editing the right properties.
and the port is 7514
(p.s. that link was just an example of whats SUPPOSED to be entered in the remote file)
Now, this will not allow you to login untill this one code is put in the remote file. it took me 100,000 attempts to get it to work right after hours of searching. I actually found the snippet of the correct sequence on gaygeeks.org i think, but now that is all arased and the site is just starting up again so that info is long gone. the remote file will have the server,username and password hash code, and port number. since gay.com encrypts the regular password to prevent people from using other chat clients to log on. if you had a username you could click this link http://www.gay.com/messenger/get-chat-key.txt and it would generate a long encrypted password that looks like this
status=ok
password=v0_151875749e1380f53092fe945c7dddf082cc7313243efc08d456284ea05eeccc8817f21de6cf414ec51a88c3233743c1b620b26f5d8f638006444f8e954a91464d8cc2aea20864

the remote file doesnt use the "status=ok password "
i dont believe, it MIGHT use the word password as i said i dont remmeber and i know nothing about writing my own. frown
and to answer your question i believe the entire server is password protected, since u need to register to use the site at all.
from there you can log into any chat room you want, here is the chat room list too.... http://www.geocities.com/deloreancowboy/channellist.txt
I found the server and port and list here at http://forums.ceruleanstudios.com/showthread.php?threadid=81174

i know thats alot of junk to paste and post lol sorry but i need to ASK someone since im getting nowhere on my own.



Link Copied to Clipboard