Page 1 of 1

Auto-Login

PostPosted: Wed Mar 10, 2010 1:15 pm
by Thria
For those of you using mIRC.

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

Re: Auto-Login

PostPosted: Wed Mar 10, 2010 1:56 pm
by Thria
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.

Re: Auto-Login

PostPosted: Wed Mar 10, 2010 2:19 pm
by Ehlanna
You may wanna toss in a test for not being voiced ...?

Re: Auto-Login

PostPosted: Wed Mar 10, 2010 3:09 pm
by Thria
ON JOIN triggers before Desy would have a chance to voice you - any such test would automatically return FALSE.

Re: Auto-Login

PostPosted: Wed Mar 10, 2010 4:39 pm
by Ehlanna
Fair comment - was trying to avoid an unnecessary login attempt if already logged in via another channel :)

Re: Auto-Login

PostPosted: Wed Mar 10, 2010 5:04 pm
by Ehlanna
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
  }
}

Re: Auto-Login

PostPosted: Wed Mar 10, 2010 5:12 pm
by Thria
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)

Re: Auto-Login

PostPosted: Wed Aug 02, 2017 12:36 pm
by Thria
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.