AutoSys V0.9

By shadow-Majestic on Jul 26, 2009

This is an old project i was working on, it should automate any process in IRC, that when you close mIRC and open it up, you left off exactly where you stopped.

Channels, servers etc. automaticly get removed or added on join/connect or part/disconnect.
Username logins are remembered and given when demanded by services(only tested with Anope and IRCServices). It also keeps track of the nicknames u use on different services (passwords are stored seperately per server too).

There are small control functions and i know there are a few bugs left, but u can always manually change options in the .ini file.

    ;AutoSys Script by Shadow-Majestic V0.6
    ;This script will automate almost everything besides the chatting(thats whats irc is about right?)
    ;Didnt you find it annoying that when you where on multiple servers and had a big preform?
    ;Or that you joined the same channels on multiple servers?
    ;Or having to change to the nick you use (if different on other servers)
    ;Or having to identify to nickserv with different passwords/nicks?
    ;And you want all that to be automated? well life is easy.. it can be easier
    ;Copy-paste this script to your mIRC remote (in a seperate script file is suggested)
    ;Just reconnect and see how the magic happends! :)
    ;Note that this script is in beta and that it is just a snippet
    ;--------------------------------------------------------------------------------------
    ;If you find any bugs or have suggestions (or want more scripts)
    ;Visit us at irc.revpermin.com (ports:6667-6669)
    ;
    ;Enjoy,
    ;Shadow-Majestic

    on *:JOIN:*:{
      if ($nick == $me) {
        if (%joinoff == 1) {
          echo -a Halted adding channel to autosys database! If this is wrong, try /hop
          set %joinoff 0
          halt
        }
        set %joinlist 0
        while (%joinlist < $readini(channellist.ini, main, $network)) {
          inc %joinlist
          if ($readini(channellist.ini, $network, %joinlist) == $chan) {
            writeini -n channellist.ini $network $chan 1
            halt
          }
        }
        writeini -n channellist.ini main $network $calc($readini(channellist.ini, main, $network) + 1)
        writeini -n channellist.ini $network $readini(channellist.ini, main, $network) $chan
        writeini -n channellist.ini $network $chan 1
        echo -a $chan added to the channel list of $network !
      }
    }

    on *:NICK:{
      if ($nick == $me) {
        writeini -n channellist.ini $network nick $newnick
        echo -a Nickname set to $newnick on $network
      }
    }

    ON *:NOTICE:*:*:{
      if ($nick == nickserv) {
        if (This nickname is registered isin $1-) {
          if ($readini(channellist.ini, $network, nickpass) == $null) {
            echo -a No password in the database! Please identify to nickserv!
            halt
          }
          msg nickserv identify $readini(channellist.ini, $network, nickpass)
          echo -a Now trying to identify!
        }
        if (Password accepted isin $1-) {
          echo -a Identify completed!
        }
      }
    }

    ON *:START:{
      remini maindb.ini chanondesk
      remini maindb.ini total chanondesk
      if ($readini(channellist.ini, servers, 1) == $null) {
        server $$?="Server:" $$?="Port:"
      }
      server $readini(channellist.ini, $readini(channellist.ini, servers, 1), serverip) 6667
      set %serverlist 1
      while (%serverlist < $readini(channellist.ini, main, servers)) {
        inc %serverlist
        if ($readini(channellist.ini, SERVER, $readini(channellist.ini, servers, %serverlist)) == 1) {
          server -m $readini(channellist.ini, $readini(channellist.ini, servers, %serverlist), serverip) 6667
        }
      }
    }

    on *:PART:*:{
      if ($nick == $me) {
        writeini -n channellist.ini $network $chan 0
        echo -a $chan deleted from the channel list of $network
      }
    }

    on *:INPUT:*:{
      if ($left($1,1) == $chr(47)) {
        if ($2 == identify) {
          writeini -n channellist.ini $network nickpass $3
          echo -a $3 added for auto identify on $network
        }
        if ($3 == identify) {
          writeini -n channellist.ini $network nickpass $4
          echo -a $4 added for auto identify on $network
        }
      }
    }

    on *:CONNECT:{
      if ($readini(maindb.ini, ircoper, $network) == 1) {
        oper $readini(maindb.ini, operuname, $network) $readini(maindb.ini, operpass, $network)
      }
      set %connectlist 0
      if ($readini(channellist.ini, $network, nick) != $null) {
        nick $readini(channellist.ini, $network, nick)
      }
      while (%connectlist < $readini(channellist.ini, main, $network)) {
        inc %connectlist
        if ($readini(channellist.ini, $network, $readini(channellist.ini, $network, %connectlist)) == 1) {
          if ($readini(sysinv.ini, $network, $readini(channellist.ini, $network, %connectlist)) == 1) {
            msg $chanserv invite $readini(channellist.ini, $network, %connectlist)
          }
          j $readini(channellist.ini, $network, %connectlist)
        }
      }
      if ($readini(channellist.ini, SERVER, $network) != 1) {
        writeini -n channellist.ini SERVER $network 1
        writeini -n channellist.ini $network serverip $serverip
        writeini -n channellist.ini main servers $calc($readini(channellist.ini, main, servers) + 1)
        writeini -n channellist.ini servers $readini(channellist.ini, main, servers) $network
        echo -a $network added to the autostart up list!
      }
    }
    alias sys {
      if ($1 == servers) {
        if ($2 == ipup) {
          if ($3 == $null) || ($4 == $null) { echo -a Not ennough input! Halting | halt }
          writeini -n channellist.ini $3 serverip $4
          echo -a Updated $3 $+ 's IP to be: $4
        }

        if ($2 == add) {
          if ($3 == $null) || ($4 == $null) { echo -a Not ennough input! Halting | halt }
          if ($readini(channellist.ini, SERVER, $network) == 1) { echo -a Network already listed! Halting | halt }
          writeini -n channellist.ini SERVER $3 1
          writeini -n channellist.ini $3 serverip $4
          writeini -n channellist.ini main servers $calc($readini(channellist.ini, main, servers) + 1)
          writeini -n channellist.ini servers $readini(channellist.ini, main, servers) $3
          echo -a $3 added to the autostart up list!
        }

        if ($2 == del) {
          if ($3 == $null) || ($4 == $null) { echo -a Not ennough input! Halting | halt }
          writeini -n channellist.ini SERVER $3 0
          echo -a $3 deleted from Autostart!
        }
        if ($2 == list) {
          set %sysservers 0
          echo -a Network...ServerIP
          while (%sysservers < $readini(channellist.ini, main, servers)) {
            inc %sysservers
            if ($readini(channellist.ini, server, $readini(channellist.ini, servers, %sysservers)) == 1) {
              echo -a $readini(channellist.ini, servers, %sysservers) - $readini(channellist.ini, $readini(channellist.ini, servers, %sysservers), serverip)
            }
          }
        }
      }
      if ($1 == chans) {
        if ($2 == add) {
          if ($3 == $null) || ($4 == $null) { echo -a Not ennough input! Halting | halt }
          if ($readini(channellist.ini, $network, $3) == 1) { echo -a Channel already in the list! Halting! | halt }

          writeini -n channellist.ini main $network $calc($readini(channellist.ini, main, $network) + 1)
          writeini -n channellist.ini $network $readini(channellist.ini, main, $network) $3
          writeini -n channellist.ini $network $3 1
          echo -a $3 added to the channel list of $network !

        }
        if ($2 == del) {
          if ($readini(channellit.ini, $network, $3) != 1) { echo -a Channel not in the list! Halting | halt }
          writeini -n channellist.ini $network $3 0
        }

        if ($2 == list) {
          set %syschans 0
          echo -a Channellist for $network $+ :
          while (%syschans < $readini(channellist.ini, main, $network)) {
            inc %syschans
            if ($readini(channellist.ini, $network, $readini(channellist.ini, $network, %syschans)) == 1) {
              echo -a $readini(channellist.ini, $network, %syschans)
            }
          }
        }
      }

    }
    alias ircoper {
      if ($1 == on) {
        writeini -n maindb.ini ircoper $network 1
        echo -a IRCop Commands have been enabled!
      }
      if ($1 == off) {
        writeini -n maindb.ini ircoper $network 0
        echo -a IRCop Commands have been disabled!
      }
      if ($1 == pass) {
        writeini -n maindb.ini operuname $network $2
        writeini -n maindb.ini operpass $network $3
        echo -a IRCop username and password have been set! Uname: $2 Password: $3
      }
    }
    alias sysinv {

      if ($1 == on) {
        writeini -n sysinv.ini $network $chan 1
        echo -a $chan has been set to Invite! Script will now try to invite you to channel on connect!
      }
      if ($1 == off) {
        writeini -n sysinv.ini $network $chan 0
        echo -a Invite for $chan has been set to Off!
      }

    }
    alias joinoff {
      set %joinoff 1
      join $1
      echo -a Attempted join without adding to database!
    }

    menu channel {
      System
      .Joinoff:/joinoff $$?"Channel to join:"
      .Management
      ..Channels
      ...Add:/sys chans del $$?"Channel to add:"
      ...Delete:/sys chans add $$?"Channel to delete:"
      ...List:/sys chans list
      ..Servers
      ...Add:/sys servers add $$?"Server to add:" $$?"Server IP:"
      ...Delete/sys servers del $$?"Server to delete:"
      ...Update IP:/sys servers ipup $$?"Network Name:" $$?"New IP:"
      ...List:/sys servers list
      .Invite
      ..on:/sysinv on
      ..off:/sysinv off
      . $+ $iif($readini(maindb.ini, menu, ircop) == 1,IRCOP, )
      ..on:/ircoper on
      ..off:/ircoper off
      ..set autooper:/ircoper pass $$?"username:" $$?"password:"

    }

Comments

Sign in to comment.
WorldDMT   -  Jul 26, 2009

i did there :D

 Respond  
shadow-Majestic   -  Jul 26, 2009

what, nothing about me using .ini? am surprised xD

 Respond  
WorldDMT   -  Jul 26, 2009
on *:JOIN:*:{
  if ($nick == $me) {

can be

on me:*:join:#:{
 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.