tglogo.png

Downloading File

Filename: Best AutoJoin Script
dialog AutoJoin {
  title "AutoJoin Dialog v6.0 - By PePSiMaN"
  size -1 -1 468 168
  option dbu
  box "Network AutoJoin", 1, 2 0 155 95
  combo 2, 4 9 75 85, size
  edit "irc.example.net:6667", 3, 82 8 70 12, autohs center
  button "Add Network", 4, 82 21 70 12
  button "Del Network", 5, 82 35 70 12
  box "Network Settings", 6, 2 95 155 59
  text "Here you can add servers for this script to connect to on startup. Settings can be changed below after you add the network.", 7, 82 50 70 42, center
  check "Use Auto Identify", 8, 6 104 55 10
  edit "", 9, 5 116 50 10, autohs center
  edit "", 10, 5 129 50 10, pass autohs center
  text "Nick", 11, 56 117 33 8, center
  text "Password", 12, 56 130 34 8, center
  box "Channel AutoJoin", 13, 157 0 155 95
  combo 14, 159 9 75 85, size
  edit "#channel key", 15, 237 8 70 12, autohs center
  button "Add Channel", 16, 237 21 70 12
  button "Del Channel", 17, 237 35 70 12
  text "Here you can add channels for this script to connect to on startup. Settings can be changed below after you add the channel.", 18, 237 50 70 42, center
  edit "", 19, 160 126 50 10, center
  text "Change Key Here", 20, 160 116 50 8, center
  button "Save Settings", 21, 273 140 37 12
  button "Save Settings", 22, 118 140 37 12
  check "AutoJoin on Startup", 23, 160 104 60 10
  box "Channel Settings", 24, 157 95 155 59
  box "Command Settings", 25, 312 95 155 59
  box "Startup Commands", 26, 312 0 155 95
  button "Add Command", 27, 392 21 70 12
  button "Del Command", 28, 392 35 70 12
  text "Here you can add commands for this script to initiate to on connection to a network. Settings can be changed below after you add the command.", 29, 392 50 70 42, center
  edit "/Command Here", 30, 392 8 70 12, autohs center
  combo 32, 314 9 75 85, size
  radio "No Timer", 33, 316 107 50 10, push
  radio "3 Seconds", 34, 316 118 50 10, push
  radio "10 Seconds", 35, 316 129 50 10, push
  text "Delay before the command is initiated. Timer starts on connect, not startup", 36, 370 107 52 32, center
  text "To change the key, overwrite the original and click save settings", 37, 221 105 59 30, center
  text "Add a nick and password to auto-identify.", 38, 93 117 60 14, center
  text "Status Label", 39, 2 156 33 8, center
  text "", 40, 37 156 313 8
  button "Close", 41, 430 155 37 12, ok
  button "Reset All", 42, 393 155 37 12
  button "Test AutoJoin", 43, 353 155 40 12
}
 
dialog ajreset {
  title "Are you sure you want to reset?"
  size -1 -1 140 70
  option dbu
  text "Reseting will erase all files. This should only be done if you are willing to erase everything from your autojoin files (networks, channels, passwords). The main reason of this feature is if the script is having problems. If you are sure you want to reset, click the reset button below", 1, 3 3 134 43, center
  button "I have read above and want to Reset ", 2, 71 48 66 20, multi center ok
  button "I don't want to Reset", 3, 3 48 66 20, center cancel
}
 
dialog ajtest {
  title "Are you sure you want to test?"
  size -1 -1 140 70
  option dbu
  text "A 'Hard test' will restart your mIRC and test the autojoin. A 'Soft test' will not restart, but show you how it would join if you restarted mIRC. Which would you like to choose? ;)", 1, 3 3 134 43, center
  button "I would like to perform a 'Hard test'", 2, 71 48 66 20, multi center ok
  button "I'm as soft as a teady bear", 3, 3 48 66 20, ok center
}
 
Menu Channel,Status {
  AutoJoin Dialog v6.0:dialog -m Autojoin Autojoin
}
 
alias -l scheck {
  scid %netcheck disconnect
  scid %netcheck window -c "status window"
  label The network does not seem to exist. Try again at a different time
  unset %netcheck
}
 
alias -l label {
  did -r AutoJoin 40
  did -a AutoJoin 40 $1-
}
 
on *:START: {
  var %x 1
  while (%x <= $lines(Networks.txt)) {
    if (%x = 1) { server $gettok($read(Networks.txt,%x),1,32) }
    else { server -m $gettok($read(Networks.txt,%x),1,32) }
    inc %x
  }
}
 
on *:CONNECT: {
  if (%netcheck) && ($dialog(AutoJoin)) {
    scid %netcheck write Networks.txt $server $+ : $+ $port $nick blank 0 $network
    scid %netcheck did -a AutoJoin 2 $server $+ : $+ $port
    scid %netcheck label Added the network of ' $+ $server $+ ' (port: $port $+ ) (network: $network $+ ).
    scid %netcheck disconnect
    scid %netcheck window -c "status window"
    .timernet off
    unset %netcheck
  } 
  else {
    var %x 1
    while (%x <= $lines(Networks.txt)) {
      if ($network = $gettok($read(Networks.txt,%x),5,32)) {
        nick $gettok($read(Networks.txt,%x),2,32)
        identify $gettok($read(Networks.txt,%x),3,32)
        var %y 1
        while (%y <= $lines($gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt)) {
          if ($gettok($read($gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%y),3,32) = 1) {
            if ($gettok($read($gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%y),2,32) = nokey) { join -n $gettok($read($gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%y),1,32) }
            if ($gettok($read($gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%y),2,32) != nokey) { join -n $gettok($read($gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%y),1,32) $gettok($read($gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%y),2,32) }
          }
          inc %y
        }
        var %z 1
        while (%z <= $lines(Commands. $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt)) {
          if ($gettok($read(Commands. $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%z),2,124) = 1) { $gettok($read(Commands. $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%z),1,124) }
          if ($gettok($read(Commands. $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%z),2,124) = 2) { .timer 1 3 $gettok($read(Commands. $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%z),1,124) }
          if ($gettok($read(Commands. $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%z),2,124) = 3) { .timer 1 10 $gettok($read(Commands. $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%z),1,124) }
          inc %z
        }
      }
      inc %x
    }
  }
}
 
on *:DIALOG:ajreset:sclick:2: {
  var %x 1
  while (%x <= $lines(Networks.txt)) {
    set %file $gettok($read(Networks.txt,%x),1,32)
    .remove -b $gettok(%file,1,58) $+ .txt
    .remove -b Commands. $+ $gettok(%file,1,58) $+ .txt
    inc %x
  }
  .remove -b Networks.txt
  label Everything has been reset
  dialog -x AutoJoin AutoJoin
  .timer 1 1 dialog -m AutoJoin AutoJoin
  .timer 1 1 label Removed all Networks, Channels, and Commands. Everything has been reset
}
 
on *:DIALOG:ajtest:sclick:2: {
  label Beginning test... Please wait
  .timer 1 2 exit -nr
}
 
on *:DIALOG:ajtest:sclick:3: {
  dialog -x AutoJoin AutoJoin
  if (!$window(AutoJoin_Tester)) { window @AutoJoin_Tester }
  var %x 1
  while (%x <= $lines(Networks.txt)) {
    echo @AutoJoin_Tester 7Connected to server:4 $gettok($gettok($read(Networks.txt,%x),1,32),1,58) 7with port:4 $gettok($gettok($read(Networks.txt,%x),1,32),2,58) 
    echo @AutoJoin_Tester 3 $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) - 4Changed nick to7 $gettok($read(Networks.txt,%x),2,32)
    echo @AutoJoin_Tester 3 $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) - 4Sent Identify:7 $gettok($read(Networks.txt,%x),3,32)
    var %y 1
    while (%y <= $lines($gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt)) {
      if ($gettok($read($gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%y),3,32) = 1) {
        if ($gettok($read($gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%y),2,32) = nokey) { echo @AutoJoin_Tester 3 $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) -  4Joined channel7 $gettok($read($gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%y),1,32) }
        if ($gettok($read($gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%y),2,32) != nokey) { echo @AutoJoin_Tester 3 $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) - 4Joined channel7 $gettok($read($gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%y),1,32) 4with key7 $gettok($read($gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%y),2,32) }
      }
      inc %y
    }
    var %z 1
    while (%z <= $lines(Commands. $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt)) {
      if ($gettok($read(Commands. $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%z),2,124) = 1) { echo @AutoJoin_Tester 3 $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) - 4Command w/ no timer:7 $gettok($read(Commands. $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%z),1,124) }
      if ($gettok($read(Commands. $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%z),2,124) = 2) { echo @AutoJoin_Tester 3 $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) - 4Command w/ 3 sec timer:7 $gettok($read(Commands. $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%z),1,124) }
      if ($gettok($read(Commands. $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%z),2,124) = 3) { echo @AutoJoin_Tester 3 $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) - 4Command w/ 10 sec timer:7 $gettok($read(Commands. $+ $gettok($gettok($read(Networks.txt,%x),1,32),1,58) $+ .txt,%z),1,124) }
      inc %z
    }
    inc %x
  }
}
 
on *:DIALOG:AutoJoin:sclick:42: { dialog -m ajreset ajreset }
on *:DIALOG:AutoJoin:sclick:43: { dialog -m ajtest ajtest }
 
on *:DIALOG:AutoJoin:init:*: {
  var %x 1
  while (%x <= $lines(Networks.txt)) {
    did -a $dname 2 $gettok($read(Networks.txt,%x),1,32)
    inc %x
  }
  did -b $dname 8-10,15-17,19,21-23,27-28,30,33-35
}
 
on *:DIALOG:AutoJoin:sclick:*: {
  if ($did == 2) {
    did -e $dname 8
    did -b $dname 19,23,21,33-35
    did -r $dname 9-10
    if ($gettok($read(Networks.txt,$did(2).sel),4,32) = 1) { did -c $dname 8 | did -e $dname 9,10,22 }
    if ($gettok($read(Networks.txt,$did(2).sel),4,32) = 0) { did -u $dname 8 | did -b $dname 9,10,22 }
    if ($gettok($read(Networks.txt,$did(2).sel),3,32) != blank) { did -a $dname 10 $ifmatch }
    did -a $dname 9 $gettok($read(Networks.txt,$did(2).sel),2,32)
    did -e $dname 15-17,27-28,30
    did -r $dname 14
    did -r $dname 32
    did -u $dname 33-35
    var %x 1
    var %y 1
    while (%x <= $lines($gettok($did(2),1,58) $+ .txt)) {
      did -a $dname 14 $gettok($read($gettok($did(2),1,58) $+ .txt,%x),1,32)
      inc %x
    }
    while (%y <= $lines(Commands. $+ $gettok($did(2),1,58) $+ .txt)) {
      did -a $dname 32 $gettok($read(Commands. $+ $gettok($did(2),1,58) $+ .txt,%y),1,124)
      inc %y
    }
  }
  if ($did == 4) { .timernet 1 10 scheck $activecid | server -m $did(3) | set %netcheck $activecid }
  if ($did == 5) { set %file $gettok($read(Networks.txt),1,32) | .remove -b $gettok(%file,1,58) $+ .txt | .remove -b Commands. $+ $gettok(%file,1,58) $+ .txt | label Deleted network of ' $+ $gettok($did(2),1,58) $+ ' and all channels/commands | write -dl $+ $did(2).sel Networks.txt | did -d $dname 2 $did(2).sel | did -r $dname 14,32 }
  if ($did == 8) {
    if ($did(8).state = 0) { did -b $dname 9-10,22 | write -l $+ $did(2).sel Networks.txt $puttok($read(Networks.txt,$did(2).sel),0,4,32) | label Auto Identify turned off for ' $+ $gettok($did(2),1,58) $+ ' }
    if ($did(8).state = 1) { did -e $dname 9-10,22 | write -l $+ $did(2).sel Networks.txt $puttok($read(Networks.txt,$did(2).sel),1,4,32) | label Auto Identify turned on for ' $+ $gettok($did(2),1,58) $+ ' }
  }
  if ($did == 14) {
    did -e $dname 19,23,21
    did -r $dname 19
    if ($gettok($read($gettok($did(2),1,58) $+ .txt,$did(14).sel),2,32) != nokey) { did -a $dname 19 $gettok($read($gettok($did(2),1,58) $+ .txt,$did(14).sel),2,32) }
    if ($gettok($read($gettok($did(2),1,58) $+ .txt,$did(14).sel),3,32) = 1) { did -c $dname 23 }
    if ($gettok($read($gettok($did(2),1,58) $+ .txt,$did(14).sel),3,32) = 0) { did -u $dname 23 }
  }
  if ($did == 16) {
    if ($chr(35) !isin $gettok($did(15),1,32)) { label Channel must contain ' $+ $chr(35) $+ ' | halt } 
    if ($numtok($did(15),32) = 1) { write $gettok($did(2),1,58) $+ .txt $did(15) nokey 1 }
    if ($numtok($did(15),32) = 2) { write $gettok($did(2),1,58) $+ .txt $did(15) 1 }
    if ($numtok($did(15),32) > 2) { halt }
    did -a $dname 14 $gettok($did(15),1,32) 
    if ($numtok($did(15),32) = 1) { label Added channel ' $+ $did(15) $+ ' with no key }
    else { label Added channel ' $+ $gettok($did(15),1,32) $+ ' with the key ' $+ $gettok($did(15),2,32) $+ ' }
  }
  if ($did == 17) { write -dl $+ $did(14).sel $gettok($did(2),1,58) $+ .txt | label Deleted channel ' $+ $gettok($did(14),1,32) $+ ' | did -d $dname 14 $did(14).sel }
  if ($did == 21) {
    if ($did(19) != $null) && ($did(19) != $gettok($read($gettok($did(2),1,58) $+ .txt,$did(14).sel),2,32)) {
      if ($gettok($read($gettok($did(2),1,58) $+ .txt,$did(14).sel),2,32) != nokey) { 
        label Key change from ' $+ $gettok($read($gettok($did(2),1,58) $+ .txt,$did(14).sel),2,32) $+ ' to ' $+ $did(19) $+ ' 
        write -l $+ $did(14).sel $gettok($did(2),1,58) $+ .txt $puttok($read($gettok($did(2),1,58) $+ .txt,$did(14).sel),$did(19),2,32) 
      }
      else {
        label Key added as ' $+ $did(19) $+ '
        write -l $+ $did(14).sel $gettok($did(2),1,58) $+ .txt $puttok($read($gettok($did(2),1,58) $+ .txt,$did(14).sel),$did(19),2,32)
      }
    }
    if ($did(19) = $null) && ($did(19) != $gettok($read($gettok($did(2),1,58) $+ .txt,$did(14).sel),2,32)) {
      write -l $+ $did(14).sel $gettok($did(2),1,58) $+ .txt $puttok($read($gettok($did(2),1,58) $+ .txt,$did(14).sel),nokey,2,32)
      label Key set for ' $+ $did(14) $+ ' as none
    }
  } 
  if ($did == 22) {
    if ($gettok($read(Networks.txt,$did(2).sel),2,32) != $did(9)) && ($did(9) != $null) { write -l $+ $did(2).sel Networks.txt $puttok($read(Networks.txt,$did(2).sel),$did(9),2,32) | var %a y }
    if ($gettok($read(Networks.txt,$did(2).sel),3,32) != $did(10)) && ($did(10) != $null) { write -l $+ $did(2).sel Networks.txt $puttok($read(Networks.txt,$did(2).sel),$did(10),3,32) | var %b y }
    if (%a) && (%b) { label Properties for ' $+ $gettok($did(2),1,58) $+ ' changed. Nick set as ' $+ $did(9) $+ ' and Pass set as ' $+ $did(10) $+ ' }
    if (%a) && (!%b) { label Properties for ' $+ $gettok($did(2),1,58) $+ ' changed. Nick set as ' $+ $did(9) $+ ' and Pass stays as ' $+ $did(10) $+ ' }
    if (!%a) && (%b) { label Properties for ' $+ $gettok($did(2),1,58) $+ ' changed. Nick stays as ' $+ $did(9) $+ ' and Pass set as ' $+ $did(10) $+ ' }
  }
  if ($did == 23) {
    if ($did(23).state = 0) { 
      write -l $+ $did(14).sel $gettok($did(2),1,58) $+ .txt $puttok($read($gettok($did(2),1,58) $+ .txt,$did(14).sel),0,3,32)
      label AutoJoin on Connect turned off for ' $+ $did(14) $+ ' 
    }
    if ($did(23).state = 1) { 
      write -l $+ $did(14).sel $gettok($did(2),1,58) $+ .txt $puttok($read($gettok($did(2),1,58) $+ .txt,$did(14).sel),1,3,32)
      label AutoJoin on Connect turned on for ' $+ $did(14) $+ ' 
    }
  }
  if ($did == 27) {
    if ($chr(47) !isin $gettok($did(30),1,32)) { label Command must contain a ' $+ $chr(47) $+ ' | halt }
    if ($read(Commands. $+ $gettok($did(2),1,58),w,$did(30) $+ *)) { label Command alread exists | halt } 
    write Commands. $+ $gettok($did(2),1,58) $+ .txt $did(30) $+ $chr(124) $+ 1
    label Command added ' $+ $did(30) $+ ' with no timers.
    did -a $dname 32 $did(30)
  }
  if ($did == 28) {
    write -dl $+ $did(32).sel Commands. $+ $gettok($did(2),1,58) $+ .txt
    label Command deleted ' $+ $did(32) $+ '
    did -d $dname 32 $did(32).sel
  }
  if ($did == 32) {
    did -e $dname 33-35
    if ($gettok($read(Commands. $+ $gettok($did(2),1,58) $+ .txt,$did(32).sel),2,124) = 1) { did -c $dname 33 | did -u $dname 34,35 }
    if ($gettok($read(Commands. $+ $gettok($did(2),1,58) $+ .txt,$did(32).sel),2,124) = 2) { did -c $dname 34 | did -u $dname 33,35 }
    if ($gettok($read(Commands. $+ $gettok($did(2),1,58) $+ .txt,$did(32).sel),2,124) = 3) { did -c $dname 35 | did -u $dname 33,34 }
  }
  if ($did == 33) { write -l $+ $did(32).sel Commands. $+ $gettok($did(2),1,58) $+ .txt $puttok($read(Commands. $+ $gettok($did(2),1,58) $+ .txt,$did(32).sel),1,2,124) | label Timer set for ' $+ $did(32) $+ ' to 0 seconds }
  if ($did == 34) { write -l $+ $did(32).sel Commands. $+ $gettok($did(2),1,58) $+ .txt $puttok($read(Commands. $+ $gettok($did(2),1,58) $+ .txt,$did(32).sel),2,2,124) | label Timer set for ' $+ $did(32) $+ ' to 3 seconds }
  if ($did == 35) { write -l $+ $did(32).sel Commands. $+ $gettok($did(2),1,58) $+ .txt $puttok($read(Commands. $+ $gettok($did(2),1,58) $+ .txt,$did(32).sel),3,2,124) | label Timer set for ' $+ $did(32) $+ ' to 10 seconds }
}

Related Files

by Warrior124
by FordLawnmower
by Suchorski

Please note that on our website we use cookies necessary for the functioning of our website, cookies that optimize the performance. To learn more about our cookies, how we use them and their benefits, please read our Cookie Policy.
I Understand