advanced autojoin and identify

By PuNkTuReD on Jan 25, 2009

load into your remotes

this snippet will provide you with an advanced autojoin system,
you can auto join servers, and channels for each server.

you can also auto identify to nickserv and chanserv

; Advanced Auto-join and Auto-identify
; Coded By PuNkTuReD
menu * {
  SassIRC Auto Join/Ident V 1.2:dialog $iif($dialog(ajc),-v,-dm) ajc ajc
}
dialog -l ajc {
  title "SassIRC Auto Join/Ident V 1.2"
  option dbu
  size -1 -1 200 195
  tab "AutoJoin", 9, 0 0 200 195
  box "Auto Join Servers", 1, 5 15 190 92,tab 9
  text "Server:", 2, 10 24 25 8, tab 9
  text "Network:", 3, 10 35 25 8, tab 9
  edit "", 4, 40 23 60 10, autohs, tab 9
  edit "", 5, 40 34 60 10, autohs, tab 9
  button "Add Server", 6, 105 23 40 10, tab 9
  button "Del Server", 7, 149 23 40 10, tab 9
  list 8, 10 45 180 55, size, hsbar, vshar, tab 9 
  box "Auto Join Channels", 100, 5 110 190 80, tab 9
  text "Channel:", 101, 10 119 25 8, tab 9
  edit "", 102, 40 118 60 10, autohs, tab 9
  button "Add Channel", 103, 105 118 40 10, tab 9
  button "Del Channel", 104, 149 118 40 10, tab 9
  list 105, 10 130 180 55, size, hsbar, vshar, tab 9
  tab "AutoIdent", 10, 0 0 200 195
  box "Identify to NickServ", 11, 5 15 190 80,tab 10
  text "Nick:", 12, 10 23 20 8, tab 10
  text "Pass:", 13, 10 34 20 8, tab 10
  text "Network:", 14, 100 34 30 8, tab 10
  edit "", 15, 30 22 60 10, autohs, tab 10
  edit "", 16, 30 33 60 10, autohs, tab 10
  edit "", 17, 130 33 60 10, autohs, tab 10
  button "Add Identify", 18, 105 22 40 10, tab 10
  button "Del Identify", 19, 149 22 40 10, tab 10
  list 20, 10 45 180 45, size, hsbar, vshar, tab 10 
  box "Identify to ChanServ", 21, 5 100 190 90, tab 10
  text "Chan:", 22, 10 108 20 8, tab 10
  text "Pass:", 23, 10 119 20 8, tab 10
  text "Network:", 24, 100 119 30 8, tab 10
  edit "", 25, 30 107 60 10, autohs, tab 10
  edit "", 26, 30 118 60 10, autohs, tab 10
  edit "", 27, 130 118 60 10, autohs, tab 10
  button "Add Identify", 28, 105 107 40 10, tab 10
  button "Del Identify", 29, 149 107 40 10, tab 10
  list 30, 10 130 180 55, size, hsbar, vshar, tab 10
}
on *:dialog:ajc:*:*: {
  var %a = $dname, %b = $devent, %c = $did
  if (%b == init) { fillajc1 | fillajc2 | fillaic1 | fillaic2 }
  if (%b == sclick) {
    if (%c == 6) {
      if (!$did(ajc,4).edited) { .echo -a ***** Please specify a Server to add. }
      elseif (!$did(ajc,5).edited) { .echo -a ***** Please specify the Network name to add. }
      elseif ($did(ajc,4).edited) && ($did(ajc,5).edited) { hadd -m AJC $did(ajc,5) $+($did(ajc,4),$chr(124),$did(ajc,5)) | echo -a ***** Added: Server: $did(ajc,4) Network: $did(ajc,5) | did -r ajc 4,5,8 | fillajc1 }
    }
    if (%c == 7) {
      if (!$did(ajc,8).sel) { .echo -a ***** Please select a Server/Network from the list to del. }
      else { echo -a ***** Deleted: Server: $remove($gettok($did(ajc,8).seltext,2,32),$chr(40),$chr(41)) Network: $remove($gettok($did(ajc,8).seltext,4,32),$chr(40),$chr(41)) | hdel -m AJC $remove($gettok($did(ajc,8).seltext,4,32),$chr(40),$chr(41)) | did -r ajc 4,5,8 | fillajc1 }
    }
    if (%c = 103) {  
      if (!$did(ajc,102).edited) { .echo -a ***** Please specify a Channel to add. }
      elseif (!$did(ajc,8).sel) { .echo -a ***** Please select a Server/Network from the list, to add the autojoin channel to. }
      elseif ($did(ajc,102).edited) && ($did(ajc,8).sel) { echo -a ***** Added: Channel: $did(ajc,102) To Network: $remove($gettok($did(ajc,8).seltext,4,32),$chr(40),$chr(41)) | hadd -m AJC2 $remove($gettok($did(ajc,8).seltext,4,32),$chr(40),$chr(41)) $+($hget(AJC2,$remove($gettok($did(ajc,8).seltext,4,32),$chr(40),$chr(41))),$did(ajc,102),$chr(44)) | did -r ajc 102,105 | fillajc2 }
    }
    if (%c == 104) {   
      if (!$did(ajc,102).edited) { .echo -a ***** Please specify a Channel to del. }
      elseif (!$did(ajc,8).sel) { .echo -a ***** Please select a Server/Network from the list, to del the autojoin channel from. }
      elseif ($did(ajc,102).edited) && ($did(ajc,8).sel) { echo -a ***** Deleted: Channel: $did(ajc,102) From Network: $remove($gettok($did(ajc,8).seltext,4,32),$chr(40),$chr(41)) | hadd -m AJC2 $remove($gettok($did(ajc,8).seltext,4,32),$chr(40),$chr(41)) $remove($+($hget(AJC2,$remove($gettok($did(ajc,8).seltext,4,32),$chr(40),$chr(41)))),$+($did(ajc,102),$chr(44))) | did -r ajc 102,105 | fillajc2 }
    }
    if (%c == 18) { 
      if (!$did(ajc,15).edited) { .echo -a ***** Please specify a Nick to add. }
      elseif (!$did(ajc,16).edited) { .echo -a ***** Please specify a Password to add. }
      elseif (!$did(ajc,17).edited) { .echo -a ***** Please specify a Network to add. }
      elseif ($did(ajc,15).edited) && ($did(ajc,16).edited) && ($did(ajc,17).edited) { echo -a ***** Added Network: $did(ajc,17) Nick: $did(ajc,15) Password: $did(ajc,16) | hadd -m AIC $+($did(ajc,17),ni) $+($did(ajc,15),$chr(124),$did(ajc,16),$chr(124),$did(ajc,17)) | did -r ajc 15,16,17,20 | fillaic1 }
    }
    if (%c == 19) {
      if (!$did(ajc,17).edited) { .echo -a ***** Please specify a Network to del. }
      elseif ($did(ajc,17).edited) { echo -a ***** Deleted Network: $did(ajc,17) $+ , auto ident to NickServ. | hdel -sw AIC $+($did(ajc,17),ni) | did -r ajc 27,30 | fillaic2 }
    }
    if (%c == 28) { 
      if (!$did(ajc,25).edited) { .echo -a ***** Please specify a Channel to add. }
      elseif (!$did(ajc,26).edited) { .echo -a ***** Please specify a Password to add. }
      elseif (!$did(ajc,27).edited) { .echo -a ***** Please specify a Network to add. }
      elseif ($did(ajc,25).edited) && ($did(ajc,26).edited) && ($did(ajc,27).edited) { echo -a ***** Added Channel: $did(ajc,27) Nick: $did(ajc,25) Password: $did(ajc,26) | hadd -m AIC2 $+($did(ajc,27),ci) $+($did(ajc,25),$chr(124),$did(ajc,26),$chr(124),$did(ajc,27)) | did -r ajc 25,26,27,30 | fillaic2 }
    }
    if (%c == 29) {
      if (!$did(ajc,27).edited) { .echo -a ***** Please specify a Network to del. }
      elseif ($did(ajc,27).edited) { echo -a ***** Deleted Network: $did(ajc,27) Channel: $did(ajc,25).edited) $+ , auto ident to ChanServ. | hdel -sw AIC2 $+($did(ajc,27),ci) $did(ajc,25).edited) | did -r ajc 17,20 | fillaic2 }
    }
  }
}
alias fillajc1 { 
  var %a = $hget(AJC,0).item
  if (%a == 0) { did -ra ajc 8 You can start by adding some servers to autojoin. | did -a ajc 8 Remember to specify the Network name, this can be found by typing: | did -a ajc 8 //echo -a $ $+ network | did -a ajc 8 On the network you wish to add. }
  while (%a) { did -a ajc 8 Server: $+($chr(40),$gettok($hget(AJC,%a).data,1,124),$chr(41)) Network: $+($chr(40),$gettok($hget(AJC, %a).data,2,124),$chr(41)) | did -z ajc 8 $len(Server: $+($chr(40),$gettok($hget(AJC,%a).data,1,124),$chr(41)) Network: $+($chr(40),$gettok($hget(AJC, %a).data,2,124),$chr(41))) | dec %a }
}
alias fillajc2 {
  var %a = $hget(AJC2,0).item
  if (%a == 0) { did -ra ajc 105 You can start by adding some channels to the servers you have added. }
  while (%a) { did -a ajc 105 Network: $+($chr(40),$hget(AJC2,%a).item,$chr(41)) Channels: $+($chr(40),$hget(AJC2,%a).data,$chr(41)) | did -z ajc 105 $len(Network: $+($chr(40),$hget(AJC2,%a).item,$chr(41)) Channels: $+($chr(40),$hget(AJC2,%a).data,$chr(41))) | dec %a }
}
alias fillaic1 {
  var %a = $hget(AIC,0).item
  if (%a == 0) { did -ra ajc 20 You can start by adding a Nick/Password/Network | did -a ajc 20 for auto identifying your nick. | did -a ajc 20 (Currently is only compatable with servers using NickServ.) }
  while (%a) { did -a ajc 20 Network: $+($chr(40),$gettok($hget(AIC,%a).data,3,124),$chr(41)) Nick: $+($chr(40),$gettok($hget(AIC,%a).data,1,124),$chr(41)) Password: $+($chr(40),$gettok($hget(AIC,%a).data,2,124),$chr(41)) | did -z ajc 20 $len(Network: $+($chr(40),$gettok($hget(AIC,%a).data,3,124),$chr(41)) Nick: $+($chr(40),$gettok($hget(AIC,%a).data,1,124),$chr(41)) Password: $+($chr(40),$gettok($hget(AIC,%a).data,2,124),$chr(41))) | dec %a }
}
alias fillaic2 {
  var %a = $hget(AIC2,0).item
  if (%a == 0) { did -ra ajc 30 You can start by adding a Channel/Password/Network | did -a ajc 30 for auto identifying to your channel. | did -a ajc 30 (Currently is only compatable with servers using ChanServ.) }
  while (%a) { did -a ajc 30 Network: $+($chr(40),$gettok($hget(AIC2,%a).data,3,124),$chr(41)) Channel: $+($chr(40),$gettok($hget(AIC2,%a).data,1,124),$chr(41)) Password: $+($chr(40),$gettok($hget(AIC2,%a).data,2,124),$chr(41)) | did -z ajc 30 $len(Network: $+($chr(40),$gettok($hget(AIC2,%a).data,3,124),$chr(41)) Channel: $+($chr(40),$gettok($hget(AIC2,%a).data,1,124),$chr(41)) Password: $+($chr(40),$gettok($hget(AIC2,%a).data,2,124),$chr(41))) | dec %a }
}
on *:start: {  
  if (!$hget(AIC)) { hmake AIC 20 }
  if ($exists(AIC.hsh)) { hload AIC AIC.hsh } 
  if (!$hget(AIC2)) { hmake AIC2 20 }
  if ($exists(AIC2.hsh)) { hload AIC2 AIC2.hsh } 
  if (!$hget(AJC)) { hmake AJC 20 }
  if ($exists(AJC.hsh)) { hload AJC AJC.hsh } 
  if (!$hget(AJC2)) { hmake AJC2 20 }
  if ($exists(AJC2.hsh)) { hload AJC2 AJC2.hsh } 
  var %a = 1, %b = $hget(AJC,0).item
  while %a <= %b {
    if (%a == 1) { server $gettok($hget(AJC, %a).data,1,124) | inc %a }
    else { server -m $gettok($hget(AJC, %a).data,1,124) | inc %a }
  }
}
on *:connect: { 
  if ($hget(AIC,$+($network,ni))) { nick $gettok($+($hget(AIC,$+($network,ni))),1,124)) | identify $gettok($+($hget(AIC,$+($network,ni))),2,124)) }
  if ($hget(AJC2,$network)) { join $hget(AJC2,$network) }
}
on *:join:#: { 
  if ($nick == $me) {
    if ($+($hget(AIC2,$+($network,ci)))) && ($chan == $gettok($+($hget(AIC2,$+($network,ci))),1,124)) { msg chanserv identify $chan $gettok($+($hget(AIC2,$+($network,ci))),2,124) }
  }
}
on *:exit: { 
  if ($hget(AIC)) { hsave -o AIC AIC.hsh }
  if ($hget(AIC2)) { hsave -o AIC2 AIC2.hsh }
  if ($hget(AJC)) { hsave -o AJC AJC.hsh }
  if ($hget(AJC2)) { hsave -o AJC2 AJC2.hsh }
} 

Comments

Sign in to comment.
PuNkTuReD   -  Jan 28, 2009

edit what?
nothing needs edited
just copy / paste to your script editor,
then open the dialog via your right click menu

 Respond  
WillK1llin   -  Jan 28, 2009

do i edit it?

 Respond  
PuNkTuReD   -  Jan 26, 2009

UPDATED to include a auto identify system for
Nickserv and Chanserv

 Respond  
Aucun50   -  Jan 25, 2009

Maybe in your dialog put an off selection? Look nice tho

 Respond  
Bluepower10   -  Jan 25, 2009

This works good, but it would be better if we could add the username and password so we didn't have to identify.

 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.