Srecne Novogodisnje i Bozicne praznike zeli Vam BalkanIRC Forum :)


    AutoJoin Manager

    Share
    avatar
    Marvi-Konvic
    Administrator
    Administrator

    Number of posts : 99
    Registration date : 2008-09-24

    AutoJoin Manager

    Post by Marvi-Konvic on Sat Sep 27, 2008 9:36 pm

    Code:

    dialog Autojoin {
      title "AutoJoin Manager"
      size -1 -1 395 318
      button "&Done", 500, 311 294 80 22, default cancel

      box "Channel Autojoins:", 4, 4 0 194 290
      text "Servers or Networks:", 210, 9 14 170 13
      combo 61, 10 30 135 100, size
      button "Add", 63, 151 57 40 22
      button "Del", 64, 151 79 40 22

      text "Channels:", 211, 9 134 55 13
      combo 1, 10 150 135 100, size
      button "Add", 2, 151 150 40 22
      button "Up", 7, 151 172 40 22
      button "Down", 8, 151 194 40 22
      button "Del", 3, 151 216 40 22
      check "Enabled", 62, 10 251 70 15
      check "Maintain Joins", 60, 89 251 100 15
      check "Wait for Nickserv Ident", 65, 10 270 140 15

      box "Server Autojoins:", 5, 196 0 195 290
      text "Servers:", 6, 202 14 55 13
      combo 161, 203 30 135 134, size
      button "Del", 164, 344 79 40 22
      button "Add", 163, 344 57 40 22
      text "Server's will autoconnect once the", 1000, 203 168 175 13
      text "first server's connection is active", 1001, 203 182 170 13
      check "Enabled", 162, 203 200 70 15

      box "",1010, 196 214 195 76
      button "Run Channel Autojoin Now", 81, 212 229 165 23
      button "Run Server Autojoin Now", 82, 212 258 165 23
    }
    on *:dialog:Autojoin:*:*:{
      if ($devent != init && $devent != sclick) { halt }
      var %reset 0
      if ($devent == init) {
        .timer305 OFF
        if (%autojoin == 0) { did -b $dname 81,60,61,63,64,65 }
        else { did -c $dname 62 }
        if (%autojoinm == 1) { did -c $dname 60 }
        if (%autojoinnick == 1) { did -c $dname 65 }
        var %reset 1

        if ($gettok(%multiserver,1,127) == 1) { did -c $dname 162 } | else { did -b $dname 82,161,163,164 }
        var %abcabc 2
        while (%abcabc <= $numtok(%multiserver,127)) {
          did -a $dname 161 $gettok(%multiserver,%abcabc,127)
          inc %abcabc
        }
      }
      else {
        if ($did == 162) { var %reset 3 | if ($did(162).state == 0) { did -b $dname 82,161,163,164 } | else { did -e $dname 82,161,163,164 } }
        if ($did == 81) { /autojoin maintain }
        if ($did == 82) { /autoserver }
        if ($did == 62) { if ($did(62).state == 0) { did -b $dname 81,60,61,63,64,65,1,2,3 | set %autojoin 0 } | else { var %reset 1 | did -e $dname 81,60,61,63,64,65 | set %autojoin 2 } }
        if ($did == 63 && $did(61).text != $null) {
          var %text $remove($did(61).text,*)
          if (%text isin %autoserver && %autoserver != $null) { $error(That Server is already in the list) | halt }
          if ($chr(32) isin %text) { $error(Invalid Server Name) | halt }
          set %autoserver $addtok(%autoserver,%text,127)
          var %reset 1
        }
        if ($did == 64) {
          if ($did(61).sel == 0 || $did(61).sel == $null) { $error(Please Select a Server) | halt }
          set %autoserver $deltok(%autoserver,$did(61).sel,127)
          unset % [ $+ [ autochannel [ $+ [ $did(61).seltext ] ] ] ]
          var %reset 1
        }
        if ($did == 163) {
          var %text $did(161)
          if ($chr(32) isin %text || %text == $null) { $error(Invalid Server Name) | halt }
          did -a $dname 161 %text | did -d $dname 161 0 | var %reset 3
        }
        if ($did == 164) {
          if (!$did(161).sel) { $error(Please Select a Server) | halt }
          did -d $dname 161 $did(161).sel | did -d $dname 161 0 | var %reset 3
        }
        if ($did == 2 || $did == 3 || $did == 7 || $did == 8) { var %apool = autochannel $+ $did(61).seltext }
        if ($did == 7) { var %tmp $calc($did(1).sel - 1) } | if ($did == 8) { var %tmp $calc($did(1).sel + 1) }
        if ($did == 7 || $did == 8) { set % [ $+ [ %apool ] ] $puttok($puttok(% [ $+ [ %apool ] ],$did(1).seltext,%tmp,127),$did(1,%tmp),$did(1).sel,127) | var %tmp2 = $did(1,%tmp) | did -o $dname 1 %tmp $did(1).seltext | did -o $dname 1 $did(1).sel %tmp2 | did -c $dname 1 %tmp }
        if ($did == 1 || $did == 7 || $did == 8) { did -b $dname 7,8 | did -e $dname 3 | if ($did(1,$calc($did(1).sel - 1)) != $did(1)) { did -e $dname 7 } | if ($did(1,$calc($did(1).sel + 1)) != $null) { did -e $dname 8 } }
        if ($did == 2 && $did(1).text != $null) {
          if ($channelcheck(% [ $+ [ %apool ] ],$did(1).text) > 0 && % [ $+ [ %apool ] ] != $null) { $error(That Channel is already in the list) | halt }
          set % [ $+ [ %apool ] ] $addtok(% [ $+ [ %apool ] ],$did(1).text,127)
          var %reset 2
        }
        if ($did == 3) {
          set % [ $+ [ %apool ] ] $deltok(% [ $+ [ %apool ] ],$did(1).sel,127)
          var %reset 2
        }
        if ($did == 500) {
          if ($did(60).state == 1) { set %autojoinm 1 | .timer305 0 20 /autojoin maintain } | else { set %autojoinm 0 }
          if ($did(65).state == 1) { set %autojoinnick 1 } | else { set %autojoinnick 0 }
        }
      }
      if (%reset == 1) {
        did -r $dname 61,1
        did -a $dname 1 .....Select A Server.....
        did -b $dname 1,2,3,7,8
        if (%autoserver != $null)  {
          var %start 1
          while (%start <= $numtok(%autoserver,127)) {
            if ($gettok(%autoserver,%start,127) != $null) {
              did -a $dname 61 $gettok(%autoserver,%start,127)
            }
            inc %start
          }
        }
      }
      if (%reset == 2 || $did == 61) {
        did -e $dname 1,2
        did -b $dname 3,7,8
        did -r $dname 1
        var %apool = autochannel $+ $did(61).seltext
        var %apool % [ $+ [ %apool ] ]
        if (%apool != $null)  {
          var %start 1
          while (%start <= $numtok(%apool,127)) {
            if ($gettok(%apool,%start,127) != $null) {
              did -a $dname 1 $gettok(%apool,%start,127)
            }
            inc %start
          }
        }
      }
      if (%reset == 3) {
        if ($did(162).state == 1) { set %multiserver 1 } | else { set %multiserver 0 }
        var %abcabc 1
        while (%abcabc <= $did(161).lines) {
          set %multiserver %multiserver $+ $chr(127) $+ $did(161,%abcabc)
          inc %abcabc
        }
      }
    }


    _________________
    avatar
    Zika023
    Super Admin
    Super Admin

    Number of posts : 1456
    Age : 23
    Локација : Melenci
    Registration date : 2008-09-20

    Re: AutoJoin Manager

    Post by Zika023 on Sat Sep 27, 2008 9:42 pm

    Komplikovan kod .... Smile

      Current date/time is Tue Dec 12, 2017 8:40 pm