mIRC Home    About    Download    Register    News    Help

Print Thread
S
skullrappa
skullrappa
S
Hey people,

I have a simple question:

I have 'autojoin on invite' enabled in mirc. The thing is I don't want to join all channels im invited to, only a few and a few not. Is that possible? And if yes how?

Thanks for the help

SR

Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
Here's something I come up with a while back.

You can add and remove servers, when you connect to a server you auto join the channels. The channels are server specific and by that I mean if you add a server irc.somehost.com for example. You can then add channels associated with that server, by clicking the server in the list first.

When the dialog closes and reopens you will probably notice the channels aren't there. Don't worry nothing has gone wrong, clicking on irc.somehost.com (or other servers you added) will bring back your channels.

1. Type /ajoin to begin.
2. Type in irc.somehost.com (or the server of your choice) in the first combo box and click the "Add" button.
3. Now select the newly added server in the first combo box and begin typing the channels in the second combo, remember to click "Add".
4. Select autojoin status to on.

That should be it, if you need any help just reply back here.

Code:
menu channel { 
  $iif($dialog(autojoin),$style(7)) AutoJoin: { dialog -m autojoin autojoin } 
}

alias ajoin {
  dialog $iif(!$dialog(autojoin),-dm,-ev) autojoin autojoin 
}

On *:Start: {
  hmake servers 10
  if ($isfile(autojoin\servers.dat)) {
    hload -i servers autojoin\servers.dat
    var %x = $lines(autojoin\servers.dat)
    while (%x) {
      if (*=* iswm $read(autojoin\servers.dat,%x)) {
        hmake $gettok($v2,1,61) 10
        hmake $+($gettok($v2,1,61),_chans) 10
        if ($isfile($+(autojoin\,$gettok($v2,1,61),\,chans.dat))) hload -i $+($gettok($read(autojoin\servers.dat,%x),1,61),_chans) $+(autojoin\,$gettok($read(autojoin\servers.dat,%x),1,61),\,chans.dat)
      }
      dec %x
    }
  }
}

On *:connect: {
  if (%aj.status == on) {
    if ($isfile(autojoin\servers.dat)) {
      var %x = $lines(autojoin\servers.dat)
      while (%x) {
        if (*=* iswm $read(autojoin\servers.dat,%x)) {
          if ($gettok($v2,1,61) == $server) {
            var %chans = $lines($+(autojoin\,$server,\chans.dat))
            while (%chans) {
              if (*=* iswm $read($+(autojoin\,$server,\chans.dat),%chans)) join $gettok($v2,1,61)
              dec %chans
            }
          }
        }
        dec %x
      }
    }
  }
}
dialog autojoin {
  title "Auto Join Channels by SladeKraven"
  size -1 -1 184 186
  option dbu
  combo 1, 2 3 87 100, size 
  button "Add", 2, 7 126 29 10
  box "Auto Join Status", 5, 63 144 57 20
  check "On", 6, 75 152 31 10, flat
  box "Adding/Removing Servers", 7, 4 116 70 26
  button "Remove", 8, 41 126 29 10
  box "Adding/Removing Chans", 4, 111 116 70 26
  button "Remove", 9, 148 126 29 10
  button "Add", 3, 116 126 29 10
  combo 10, 95 3 87 100, size
  button "[X]", 11, 73 170 37 12
}

On *:Dialog:autojoin:init:0: {
  if (%aj.status == on) did -c $dname 6
  if ($hget(servers)) {
    var %x = $hget(servers,0).item
    while (%x) {
      did -a $dname 1 $hget(servers,%x).data
      dec %x
    }
  }
}

On *:Dialog:autojoin:sclick:1: {
  var %x = $hget($+($did($dname,$did),_chans),0).item
  did -r $dname 10
  while (%x) {
    did -a $dname 10 $hget($+($did($dname,$did),_chans),%x).data
    dec %x
  }
}

On *:Dialog:autojoin:sclick:2: {
  if (!$isdir(autojoin)) mkdir autojoin
  var %aj.server = $did($dname,1).text
  if (%aj.server) {
    if (!$isdir($+(autojoin\,%aj.server))) mkdir $+(autojoin\,%aj.server)
    if (!$hget(%aj.server)) hmake %aj.server 10
    if (!$hget(servers)) hmake servers 10
    hadd servers %aj.server %aj.server
    did -a $dname 1 %aj.server
  }
  if ($hget(servers)) hsave -i servers autojoin\servers.dat
}

On *:Dialog:autojoin:sclick:3: {
  if (!$did($dname,1).sel) {
    echo -a -
    echo -a *** Please select a server from the first list to add channels to it from the second.
    echo -a *** Remember you can specify the channels to join for each different server. :)
    echo -a *** You could be joining #mIRC on irc.stormirc.org but when another server starts you'll join the channels you added for that server (if any).
    echo -a -  
  }
  else {
    if (!$did($dname,10)) echo Please enter a channel to add.
    else { 
      if (!$hget($+($did($dname,1),_chans))) hmake $+($did($dname,1),_chans) 10
      hadd $+($did($dname,1),_chans) $did($dname,10) $did($dname,10)
      did -a $dname 10 $did($dname,10)
      hsave -i $+($did($dname,1),_chans) $+(autojoin\,$did($dname,1),\chans.dat)
    }
  }
}

On *:Dialog:autojoin:sclick:6: {
  set %aj.status $iif($did($dname,$did).state == 1,on,off)
}

On *:Dialog:autojoin:sclick:8: {
  if ($did($dname,1).sel) {
    if ($hget($did($dname,1))) {
      hdel servers $did($dname,1)
      hfree $did($dname,1)
    }
    if ($hget($+($did($dname,1),_chans))) hfree $hget($+($did($dname,1),_chans))
    if ($isfile($+(autojoin\,$did($dname,1),\,chans.dat))) .remove $+(autojoin\,$did($dname,1),\,chans.dat)
    rmdir $+(autojoin\,$did($dname,1))
    did -d $dname 1 $did($dname,1).sel
  }
  if ($hget(servers)) hsave -i servers autojoin\servers.dat
}

On *:Dialog:autojoin:sclick:9: {
  if (($did($dname,1).sel) && ($did($dname,10).sel)) {
    if ($hget($+($did($dname,1),_chans))) {
      hdel $v1 $did($dname,10)
      did -d $dname 10 $did($dname,10).sel
      hsave -i $+($did($dname,1),_chans) $+(autojoin\,$did($dname,1),\,chans.dat))
    }
  }
}

On *:Dialog:autojoin:sclick:11: {
  dialog -x $dname $dname
}

S
skullrappa
skullrappa
S
hahahaha wow, now that i didn't expect.

Thanks alot, and it works like a charm too! Thx alot

Greetings

SR


Link Copied to Clipboard