mIRC Homepage
Posted By: auger Auto Login - 17/12/02 07:32 PM
ive writen this script to auto login on x when i connect to undernet
auto login
.auto login On:{
%auserid = $$input(Enter Userid,1)
%apass = $$input(Enter Password? for %auserid ,2)
%login = on
if ($$input(Please type password again to confirm:,2) !=== %apass) {
%b Passwords DONOT match. You must enter the same pass each time
unset %a*
}
elseif (%login == on) {
%b Added ( $+ %auserid $+ ) to Auto Login List
}
}
.auto login Off:{
if ( %login == on ) {
%login = off
echo 2 12•2•1• 4 %auserid has been deleted from the auto login list
unset %a*
elseif ( %login == $null ) {
%b No Auto Login set
}
}
}

and i have an on connect event in the remotes, which checks if %login = on and it logs in . but this is only good for one user as the id and pass are saved in variables, how can i adjust this to make it rem more then one id, and also can i use $encode here to encode the pass?
Posted By: Hammer Re: Auto Login - 17/12/02 08:24 PM
There are many ways to store and retrieve data in mIRC script. Each has its uses. For what you are trying to do, the easiest way is probably to use an .ini file. For small amounts of data, an .ini file works very well. It stores data in the following format:
  • [section]
    item=value
For instance:
  • [auger-away]
    undernet=f265f982r

    [auger]
    undernet=h43g6lsd2
    DALnet=oooogabooooga
So, in essence, you can create your own little "database" with common fields for each [nick] that you wish to use, with a few gotcha's. For instance, you have to be careful which characters you are trying to store since some characters will not be stored in an .ini properly. This is usually not a problem because you can use $replace to replace the problem characters with a different, storable-but-unusable character when you store it and reverse the process when you retrieve the data.

You use $readini to get the data out of the .ini file and /writeini to store data inside it. Assume we're using a file formatted like the example above, called passwords.ini:
Code:

  ;      Get the old password from the .ini file
  ;
  var %password = $readini(passwords.ini,$me,$network)
  ;
  ;      Ask the user for a new password
  ;
  var %NewPassword = $$input(Please enter a new password:,eipo,Change Password,%password)
  ;
  ;      Store the new password
  ;
  writeini passwords.ini $me $network %NewPassword
Posted By: auger Re: Auto Login - 21/12/02 06:38 PM
thanx
ill try what uve said, and post if what happens
Posted By: auger Re: Auto Login - 22/12/02 07:34 PM
I tried what you said and it's not working. can u pls gimme the complete code so i can check with what i've done
Posted By: gemeau50 Re: Auto Login - 23/12/02 07:08 PM
The "on start" event sets the autologin, username and password:

on *:start: {
set %autologin $$input(ENTER : yes or no,eo,ACTIVATE AUTOLOGIN FOR UNDERNET :,yes)
if (%autologin == yes) set %username $$input(username1 username2 username3,eo,ENTER YOUR USERNAME : )
if ((%autologin == yes) && (%username != $null )) set %xpwd [ [ $+(%,%username,pwd) ] ]
}

Create a perform for Undernet and insert this command :

if ((%autologin == yes) && (%username != $null )) .msg x@channels.undernet.org login %username $decode(%xpwd)

To reset variables :

on *:quit: unset %autologin %username %xpwd


One time input:
Set manually your password for each username:

//set %username1pwd $encode(password)
//set %username2pwd $encode(password)
//set %username3pwd $encode(password)

you only have to change username1, ...2 and ...3 to your usernames.

Hope it will help
gemeau50
Posted By: auger Re: Auto Login - 25/12/02 07:33 PM
thanx!!
© mIRC Discussion Forums