Auto-Login

Useful items for all visitors - virus warnings, firewalls, IRC scripts etc

Moderators: Ehlanna, Twerlinger

Auto-Login

Postby Thria on Wed Mar 10, 2010 1:15 pm

For those of you using mIRC.

Code: Select all
ON 1:JOIN:#Lonely_Inn_OOC:{
  if ($nick == $me) {
    msg Desdaemona !login password Character Name
  }
}
Thria
Adept
Adept
 
Posts: 65
Joined: Sun Oct 15, 2006 8:49 pm

Re: Auto-Login

Postby Thria on Wed Mar 10, 2010 1:56 pm

First thing i got responded to with this is "But I have multiple characters".

So, here's the option for those who have multiple characters...

Code: Select all
ON 1:JOIN:#Lonely_Inn_OOC:{
  if ($nick == $me) {
      if  ($me == IRCNickname) msg Desdaemona !login password Character Name
      elseif ($me == AnotherNickName) msg Desdaemona !login password Character Name
  }
}


Copy the 'elseif' line as many times as you need for different characters.
Thria
Adept
Adept
 
Posts: 65
Joined: Sun Oct 15, 2006 8:49 pm

Re: Auto-Login

Postby Ehlanna on Wed Mar 10, 2010 2:19 pm

You may wanna toss in a test for not being voiced ...?
Ehlanna
High Council
High Council
 
Posts: 1965
Joined: Sat Apr 09, 2005 9:23 pm

Re: Auto-Login

Postby Thria on Wed Mar 10, 2010 3:09 pm

ON JOIN triggers before Desy would have a chance to voice you - any such test would automatically return FALSE.
Thria
Adept
Adept
 
Posts: 65
Joined: Sun Oct 15, 2006 8:49 pm

Re: Auto-Login

Postby Ehlanna on Wed Mar 10, 2010 4:39 pm

Fair comment - was trying to avoid an unnecessary login attempt if already logged in via another channel :)
Ehlanna
High Council
High Council
 
Posts: 1965
Joined: Sat Apr 09, 2005 9:23 pm

Re: Auto-Login

Postby Ehlanna on Wed Mar 10, 2010 5:04 pm

One could do:
Code: Select all
on 1:join:#Lonely_Inn_OOC: {
  if ($nick != $me) halt
  var %needLogin = -1
  var %onTLI = $comchan(Desdaemona,1)
  if (%onTLI == $null) {
    set %needLogin 1
  }
  else {
    if ($me isvoice %onTLI) {
      set %needLogin 0
    }
    else {
      set %needLogin 2
    }
  }
  if (%needLogin > 0) {
    logehl                              <---- replace with your required login code
  }
}
Ehlanna
High Council
High Council
 
Posts: 1965
Joined: Sat Apr 09, 2005 9:23 pm

Re: Auto-Login

Postby Thria on Wed Mar 10, 2010 5:12 pm

Yeah... i mean i COULD expand it to be....

Code: Select all
ON 1:JOIN:#Lonely_Inn_OOC,#tli-forest,#tli-baths,#tli-arena,#tli-quest,#tli-town,#tli-magic,#tli-temple,#tli-borderlands:{
  if (($nick == $me) && (Desdaemona ison #Lonely_Inn_OOC) && ($me !isvoice #The_Lonely_Inn) && ($me !isvoice #tli-quest) && ($me !isvoice #tli-forest) && ($me !isvoice #tli-baths) && ($me !isvoice #tli-arena) && ($me !isvoice #tli-town) && ($me !isvoice #tli-magic) && ($me !isvoice #tli-temple) && ($me !isvoice #tli-borderlands) ) {
      if  ($me == IRCNickname) msg Desdaemona !login password Character Name
      elseif ($me == AnotherNickName) msg Desdaemona !login password Character Name
  }
}


Seems a bit excessive, but it'd fire on any TLI channel, and check against all other channels.

Your script....
If comchan(Des,1) returns #Lonely_Inn_OOC, then you will falsely login.
If Desdaemona is not online, you will attempt to log in. (Comchan returns Null)
Thria
Adept
Adept
 
Posts: 65
Joined: Sun Oct 15, 2006 8:49 pm

Re: Auto-Login

Postby Thria on Wed Aug 02, 2017 12:36 pm

Since i appear to be in the necromancy business this year, and the subject was broached in OOC, thought i'd throw up the current, somewhat simplified version of the login script i'm currently using:

Code: Select all
on 1:JOIN:#lonely_inn_ooc:{
  if ( $nick == $me ) {
    /timer 1 2 dologin
  }
}
on 1:DEVOICE:#lonely_inn_ooc:{
  if ( $vnick == $me ) {
    /timer 1 2 dologin
  }
}

alias dologin {
  if ( ( Desdaemona isop #lonely_inn_ooc ) && ( $me ison #lonely_inn_ooc ) && ( $me !isvoice #lonely_inn_ooc ) ) {
    /msg Desdaemona !login <password> <character name>
  }
  elseif ( ( $me ison #lonely_inn_ooc ) && ( $me !isvoice #lonely_inn_ooc ) ) {
    /timer 1 200 dologin
 }
}


Triggers: Whenever i join the OOC room, or when I am devoiced in the OOC room: Log in after 2 seconds.
Login function: If (at the end of the timer) Desdaemon is present, and oped in the OOC room, and I am still not voiced, send my login details to Desdaemona.
If Desdaemona is not in the OOC room, or is not oped, but I am still, wait 200 seconds and try again.
Otherwise (I've either left the room or have a voice), do nothing.
Thria
Adept
Adept
 
Posts: 65
Joined: Sun Oct 15, 2006 8:49 pm


Return to Public Service

Who is online

Users browsing this forum: No registered users and 1 guest