Single Non-Socket War Revenge Kick with Reconnect

By PremaN on Feb 06, 2011

DOWNLOAD VERSION:

GRAB THE CODE VERSION:

  • Copy and paste the code below in Notepad/Text Editor
  • Save it with any name you like ex. PremaNrecon.mrc in any folder
  • Open your mIRC, type /load -rs \PremaNrecon.mrc

NOTES:

  • Recommended to turn off mIRC's "Rejoin channel when kicked" option
;**********************************************************************
;PremaNrecon
;mIRC Single Non-Socket War Revenge Kick with Reconnect
;
;Main features:
;  + Multi opponent/enemy, single connection
;  + Using hash table method faster than before
;  + Basic self protection such as anti-ban and anti-deop
;  + Advanced reconnect strategy to boost your revenge
;  + mIRC v6.21 or later is required
;
;Notes:
;  > Recommended to turn off mIRC's "Rejoin channel when kicked" option
;
;irc.allnetwork.org 6667, #war
;Right to copy by PremaN
;**********************************************************************

on *:start:{ .fullname 15,14***5,5 $+ $chr(32) $+ 0,1 Pr4e0maN 5,5 $+ $chr(32) $+ 15,14*** }

on !*:ban:#:{
  if ($banmask iswm $address($me,5)) {
    if ($me !isop $chan) { ChanServ op $chan $me }
    raw -q mode $chan -b $banmask
  }
}

on !*:deop:#:{
  if ($opnick == $me) { ChanServ op $chan $me }
}

on *:exit:{
  if ($hget(enemy)) { recon.clear }
}

on *:connect:{
  if (%r.chan) {
    raw -q join %r.chan
    .timerc 1 1 recon.hop
  }
  elseif (!%interval.reconnect) { set %interval.reconnect 3 }
}

on *:kick:#:{
  if ($knick == $me) {
    if (($nick != ChanServ) && ($nick != $me) && ($group(#revenge) == on)) {
      if (!$hfind(enemy.nick,$nick,0,W)) { hadd -m enemy.nick $nick }
      if (($ial($nick).host) && ($ial($nick).host != $ial($me).host) && (!$hfind(enemy.host,$ial($nick).host,0,W))) { hadd -m enemy.host $ial($nick).host }
      if (%interval.reconnect) {
        inc %a.reconnect
        if (%a.reconnect == %interval.reconnect) {
          unset %a.reconnect
          set %r.chan $chan
          if ($me ison %r.chan) { raw -q part %r.chan }
          disconnect
          .disable #revenge
          .timerr 1 5 server
        }
      }
    }
    if ($status == connected) { raw -q join $chan }
  }
  else {
    if ($nick == $me) { unset %a.reconnect }
  }
}

#revenge off

on *:op:#:{
  if ($opnick == $me) { recon.kick }
}

on @*:join:#:{
  if ($hfind(enemy.host,$ial($nick).host,0,W)) {
    if ($nick != $me) { raw -q kick $chan $nick :15,14***5,5 $+ $chr(32) $+ 0,1 Pr4e0maNrecon 5,5 $+ $chr(32) $+ 15,14*** }
  }
  elseif ($hfind(enemy.nick,$nick,0,W)) {
    if (($ial($nick).host) && ($ial($nick).host != $ial($me).host) && (!$hfind(enemy.host,$ial($nick).host,0,W))) { hadd -m enemy.host $ial($nick).host }
    raw -q kick $chan $nick :15,14***5,5 $+ $chr(32) $+ 0,1 Pr4e0maNrecon 5,5 $+ $chr(32) $+ 15,14***
  }
}

#revenge end

ctcp *:version:*:{
  ctcpreply $nick version 15,14***5,5 $+ $chr(32) $+ 0,1 Pr4e0maNrecon 14,1http://15www.hawkee.com14/snippet/8391/ 5,5 $+ $chr(32) $+ 15,14***
}

raw 474:*:{
  ChanServ unban $2
  raw -q join $2
}

alias -l recon.kick {
  var %x = $nick($chan,0)
  while %x {
    if ($hfind(enemy.nick,$nick($chan,%x),0,W)) { raw -q kick $chan $nick($chan,%x) :15,14***5,5 $+ $chr(32) $+ 0,1 Pr4e0maNrecon 5,5 $+ $chr(32) $+ 15,14*** }
    dec %x
  }
}

alias -l recon.add {
  if (!$hfind(enemy.nick,$1,0,W)) { hadd -m enemy.nick $1 }
  if (($ial($1).host) && ($ial($1).host != $ial($me).host) && (!$hfind(enemy.host,$ial($1).host,0,W))) { hadd -m enemy.host $ial($1).host }
  if ($me isop $chan) { recon.kick }
}

alias -l recon.hop {
  .enable #revenge
  hop -c %r.chan
  unset %r.chan
}

alias -l recon.clear {
  var %logo.clear = 15,14***5,5 $+ $chr(32) $+ 0,1 Pr4e0maNrecon 15Cleared 5,5 $+ $chr(32) $+ 15,14***
  $iif((($menu == channel) || ($menu == nicklist) && ($me ison $chan)),msg $chan %logo.clear,echo -a %logo.clear):{
    hfree -w enemy.*
    unset %r.chan %a.reconnect
  }
}

menu status,channel,nicklist,query {
  PremaNrecon
  .Options
  ..Revenge $+ $chr(58) $+ $chr(32) $+ $iif(($group(#revenge) == on),ENABLED,DISABLED):{
    if ($group(#revenge) == off) {
      var %logo.enable = 15,14***5,5 $+ $chr(32) $+ 0,1 Pr4e0maNrecon 15Enabled 5,5 $+ $chr(32) $+ 15,14***
      $iif((($menu == channel) || ($menu == nicklist) && ($me ison $chan)),msg $chan %logo.enable,echo -a %logo.enable):{
        .enable #revenge
        if (($status == connected) && ($me isop $chan)) { recon.kick }
      }
    }
    else {
      var %logo.disable = 15,14***5,5 $+ $chr(32) $+ 0,1 Pr4e0maNrecon 15Disabled 5,5 $+ $chr(32) $+ 15,14***
      $iif((($menu == channel) || ($menu == nicklist) && ($me ison $chan)),msg $chan %logo.disable,echo -a %logo.disable):{
        .disable #revenge
      }
    }
  }
  ..Auto-reconnect $+ $chr(58) $+ $chr(32) $+ $iif(%interval.reconnect,%interval.reconnect,DISABLED):{
    unset %a.reconnect
    set %last_interval.reconnect %interval.reconnect
    :rep_interval.reconnect
    unset %interval.reconnect
    set %interval.reconnect $?="Auto-reconnect interval:"
    if (!%interval.reconnect) {
      if (!%last_interval.reconnect) {
        var %conf_null_interval.reconnect = $?!="Disable auto-reconnect?"
        if (%conf_null_interval.reconnect == $true) { unset %conf_null_interval.reconnect %last_interval.reconnect %interval.reconnect }
        else {
          unset %conf_null_interval.reconnect
          goto rep_interval.reconnect
        }
      }
      else {
        var %conf_last_interval.reconnect = $?!="Keep last auto-reconnect: $+ $chr(32) $+ %last_interval.reconnect $+ ?"
        if (%conf_last_interval.reconnect == $true) {
          unset %conf_last_interval.reconnect
          set %interval.reconnect %last_interval.reconnect
          unset %last_interval.reconnect
        }
        else {
          var %conf_interval.reconnect = $?!="Disable auto-reconnect?"
          if (%conf_interval.reconnect == $true) { unset %conf_interval.reconnect %last_interval.reconnect %interval.reconnect }
          else {
            unset %conf_interval.reconnect
            goto rep_interval.reconnect
          }
        }
      }        
    }
    else { unset %last_interval.reconnect }
  }
  .Enemy
  .. $+ $iif((($menu == status) || ($menu == query) || ($group(#revenge) == off)),$style(2)) Kick:{
    if ($menu == nicklist) {
      if ($$1 != $me) { recon.add $$1 }
    }
    elseif ($menu == channel) {
      var %nick = $?="Enter plain or wildcard nick:"
      if ((%nick) && (%nick !iswm $me)) { recon.add %nick }
    }
  }
  .. $+ $iif(((!$hget(enemy.nick)) && (!$hget(enemy.host))),$style(2)) Clear:{ recon.clear }
  .. $+ $iif(((!$hget(enemy.nick)) && (!$hget(enemy.host))),$style(2)) List:{
    if ($hget(enemy.nick)) {
      echo -s 15,14***5,5 $+ $chr(32) $+ 0,1 Nick 5,5 $+ $chr(32) $+ 15,14***
      var %g = $hget(enemy.nick,0).item
      while (%g) {
        echo -s $hget(enemy.nick,%g).item
        dec %g
      }
    }
    if ($hget(enemy.host)) {
      echo -s 15,14***5,5 $+ $chr(32) $+ 0,1 Host 5,5 $+ $chr(32) $+ 15,14***
      var %h = $hget(enemy.host,0).item
      while (%h) {
        echo -s $hget(enemy.host,%h).item
        dec %h
      }
    }
  }
}

Comments

Sign in to comment.
PremaN   -  Feb 07, 2011

@SunnyD : you're right, it's happened when the user /load it, but it did not happen when the user just copy paste it in their remote.

@Jethro_ : man, you're awesome!

 Respond  
Jethro   -  Feb 07, 2011

The thing about using the load event is that the file location where you load a script to has to be a new one (fresh file being loaded for the very first time), not the one being used for numerous times. In other words, It won't activate if you attempt to load it in an old location. As for the on start event, so often beginners just grab a snippet and install it in their remote without restarting, while the snippet needs to go through the start event to have it work correctly.

 Respond  
Sorasyn   -  Feb 07, 2011

If my memory and past experiences with the start event serve me well, then I think it will prompt for initialization commands when the code is loaded for the first time. Don't hold me to it though, haven't done mSL in awhile. xD

 Respond  
PremaN   -  Feb 06, 2011

thank you Jethro_, updated!

 Respond  
Jethro   -  Feb 06, 2011

Well there are beginners who will just copy and paste it into their mirc remote without restarting. If you don't want to include the on load, perhaps you can add an elseif condition under the connect event:

on *:connect:{
  if (%chan) {
    raw -q join %chan
    .timerc 1 1 recon.hop
  }
  elseif (!%interval.reconnect) { set %interval.reconnect 3 }
  .fullname 15,14***5,5 $+ $chr(32) $+ 0,1 Pr4e0maN 5,5 $+ $chr(32) $+ 15,14***
}
 Respond  
PremaN   -  Feb 06, 2011

%interval.reconnect need to be filled at first and it is done automatically by restarting your mirc (if you copy paste into remote) or load it once for a lifetime with /load.

 Respond  
_Dean_   -  Feb 06, 2011

You have to load this script to perform first initialization settings

where is the on load event, to set it? i just take a look on it and didnt find, if i made a mistake sorry

if not, i dont see a reason to load it, instead just copy and paste into remotes

 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.