Auto Server/Channel Join

By Cazz on Jul 27, 2009

Next time you connect to a server it will ask you the questions needed to add this to your ajoin.

on *:START:{
  server irc.nixtrixirc.net
  play aserver2.txt
}

on *:CONNECT:{
  if ($read(aserver.txt, w, * $+ $network $+ *) == $network) {
    if (% $+ $network $+ .chans) {
      if (% $+ $network $+ .pass) {
        msg nickserv identify % $+ $network $+ .pass
        join % $+ $network $+ .chans
      }
      else {
        set % $+ $network $+ .pass $?="Enter NickServ Password:"
      }
    }
    else {
      set % $+ $network $+ .chans $?="Enter Auto-Join Channels:"
    }
  }
  else {
    if ($?!="Do you wish to add this server to auto join?" == $true) {
      set % $+ $network $+ .chans $?="Enter Auto-Join Channels:"
      timer 1 0 set % $+ $network $+ .pass $?="Enter NickServ Password:"
      write aserver.txt $network
      write aserver2.txt /server -m $serverip
    }
    else {
      halt
    }
  }
}

alias serveradd {
  if (% $+ $network $+ .chans) {
    echo This network is already on your ajoin!
    halt
  }
  else {
    write aserver.txt $1
    set % $+ $network $+ .chans $?="Enter Auto-Join Channels:"
    set % $+ $network $+ .pass $?="Enter NickServ Password:"
    write aserver.txt $network
    write aserver2.txt /server -m $serverip
  }
}

Comments

Sign in to comment.
zNigel-   -  Jul 27, 2009

also instead of else { if (.....
you can use elseif (...) {

 Respond  
Jonesy44   -  Jul 27, 2009

Using the "on connection" routine can be hazardous if the server you're connecting to is a "bounce" server, which will immitate your normal server, which would leave this script to think it's actually connecting to the real server, giving away your information. It's an old IRC hack & this script sorta opens that weakness.

I suggest setting a variable with the connection ID ($cid) and then checking with that, eliminating possibilites of a hack:)

 Respond  
Cazz   -  Jul 27, 2009

You can change "irc.nixtrixirc.net" with your default server.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.