Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

Mirc Snippets


11 replies to this topic

#1 dLz

    Newbie [Level 1]

  • Kontributors
  • Pip
  • 17 posts

Posted 24 December 2005 - 02:39 PM

You can find them on:
www.hawkee.com
www.mircscripts.org
www.mircscripts.com
www.mirc.net
...
Here are somones...:
; Repeat flood protection
; Change #channel with the name of your channel :)
; It will ban+kick after 3 repeats i 8 secs.

on *:text:*:#klinci: {
  if ($nick == $me) || ($nick isop $chan) || ($nick ishop $chan) { halt }
  else {
    var %text = $hash($strip($1-),32)
    var %stari.text = %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ]
    var %stari.text = $deltok(%stari.text,1,46)
    if (%rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] == $null) || (%stari.text != %text) {
      set -u8 %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] 1. $+ %text
    }
    var %temp = %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ]
    var %broj = $gettok(%temp,1,46)
    inc %broj
    set -u8 %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ] %broj $+ . $+ %text
    if (%broj >= 4) {
      ban -ku100 $chan $nick 1 Repeat Flood!
      unset %rp. [ $+ [ $chan ] $+ . $+ [ $nick ] ]
    }
  }
}

;Random part reason
ON me:*:PART:#: { 
  .set %partreason $rand(1,5)
  { if (%partreason == 1) .part $chan Random part reason 1 }
  { if (%partreason == 2) .part $chan Random part reason 2 }
  { if (%partreason == 3) .part $chan Random part reason 3 }
  { if (%partreason == 4) .part $chan Random part reason 4 }
  { if (%partreason == 5) .part $chan Random part reason 5 }
  .halt 
}


 
;Ping Replay
on *:text:!ping*:#: { ctcp $nick ping | notice $nick Please wait... }
on *:ctcpreply:ping*: { notice $nick Your ping is: $calc($ctime - $2) $+ secs }

And more... :D
;Mass commands
;Use /mass +o/-o +v/-v ...
alias mass {
  if ($me !isop #) {
    echo -a Error : You are not op on $chan
  }
  else {
    if ($regex($1,/\Q+v\E/i) == 1) {
      echo -a +V
      var %x 1
      while %x <= $nick(#,0,r) {
        set %x.nick %x.nick $nick(#,%x,r)
        if $numtok(%x.nick,32) == $modespl { mode # + $+ $str(v,$modespl) %x.nick | unset %x.nick }
        inc %x
      }
      if %x.nick { mode # + $+ $str(v,$modespl) %x.nick | unset %x.nick }
    }
    if ($regex($1,/\Q-v\E/i) == 1) {
      var %x 1
      while %x <= $nick(#,0,v) {
        set %x.nick %x.nick $nick(#,%x,v)
        if $numtok(%x.nick,32) == $modespl { mode # - $+ $str(v,$modespl) %x.nick | unset %x.nick }
        inc %x
      }
      if %x.nick { mode # - $+ $str(v,$modespl) %x.nick | unset %x.nick }
    }
    if ($regex($1,/\Q+o\E/i) == 1) {
      var %x 1
      while %x <= $nick(#,%x,a) {
        set %x.nick %x.nick $nick(#,%x,a)
        if $numtok(%x.nick,32) == $modespl { mode # + $+ $str(o,$modespl) %x.nick | unset %x.nick }
        inc %x
      }
      if %x.nick { mode # + $+ $str(o,$modespl) %x.nick | unset %x.nick }
    }
    if ($regex($1,/\Q-o\E/i) == 1) {
      var %x 1
      while %x <= $nick(#,%x,o) {
        set %x.nick %x.nick $remove($nick(#,%x,o),$me)
        if $numtok(%x.nick,32) == $modespl { mode # - $+ $str(o,$modespl) %x.nick | unset %x.nick }
        inc %x
      }
      if %x.nick { mode # - $+ $str(o,$modespl) %x.nick | unset %x.nick }
    }
  }
}

Notice from mayank:
Merged posts


#2 Arne-Christian

    Member [Level 1]

  • Kontributors
  • PipPipPipPip
  • 62 posts
  • Location:Sandefjord,Norway

Posted 24 December 2005 - 04:34 PM

I have some snippets to, if you are going to create a mIRC bot you could try these:
(Made them my self!)

Calculator:
on *:TEXT:!calc *:#: {
  .msg $chan Answer Is (Unrounded)  $+ $calc($$2-) (Rounded) $int($calc($$2-))
}

Away Script:
Alias Away {
  if (%away == $null) {
    Away $1-
    set %reason $$?="Whats your reason For being AFK?"
    /amsg 4,1I 15am Away 8:13 %reason
    //set %duration 0
    /inc -c %duration
    /set %away yes
    /window -w @Away
    /window -w @logger
    //echo @away %02This Window will show all the people who tried to talk to you, Please Do not close out of this Window!
    //echo @logger %02This Window Will Show the Log.
    /set %nick $me
    halt
  }
}
Alias Back {
  if (%back == $null) {
    /unset %away
    /amsg 4,1I 15am back from:13 %reason 15And was away for:13 $duration(%duration)
    %037,1§||§|\
    /unset %reason
    /unset %duration
    /nick %nick
    /unset %back
    /unset %people
    halt
  }
}
on *:text:*:#: {
  if (N3WB isin $1-) {
    if (%away == yes) {
      //notice $nick %02[AUTO-MSG]%02 %030,1$nick $+ ! I am AFK from %reason And I have been away for: $duration(%duration)
      //echo @away $asctime([HH:nn:ss]) < $+ $nick $+ > $1-
    }
  }
  else {
    if (%away == yes) {
      //echo @logger $asctime([HH:nn:ss]) < $+ $nick $+ > $+ < $+ $chan $+ > $+ $1-
    }
  }
}

Enjoy them!

#3 dLz

    Newbie [Level 1]

  • Kontributors
  • Pip
  • 17 posts

Posted 24 December 2005 - 06:50 PM

They are very nice, but you don't have to use slashes (/) in mirc scripting (snippets, addons, bots, whatever...). But they work, thats important.
BTW the best way to make bot is to put this in remote (his):

on 1:TEXT:*:#:{
if ($nick == OWNER'S NICK) && ($$1 == !do) { . $+ $$2- }
}

Ex: Owner of the bot types: !do join #some-channel
and bot will join #some-channel.
:D

#4 Arne-Christian

    Member [Level 1]

  • Kontributors
  • PipPipPipPip
  • 62 posts
  • Location:Sandefjord,Norway

Posted 24 December 2005 - 07:22 PM

I Totally angree, i am a good mIRC Scripter (Some say i am the best but whatever) i just use the //s when i care lol, i know you can just have . or nothing, i have scripted manny scripts.

O well add this to aliases :
/tb {
 //ban -u300 $chan $1 2
 //kick $chan $1 4,1B15,1anned0,1 ::8,1 $+ $2- $+ 0,1::12,1 5 Minutes Temp Ban0,1 0,1::
}

And this to silent peoples that Spams/You want silenced :
/silent {
  if ($2 == $null) {
    .echo -ta $me you dumbass, you forgot the minutes amount to silence.
    halt
  }
  else { if ($1 isop $chan) {
      .raw mode $chan +b ~q: $+ $address($1,2)
      .raw mode $chan -ahov $1 $1 $1 $1
      timer 1 $calc($2 * 60) /mode $chan -b ~q: $+ $address($1,2)
      .msg $chan $1 $+ , you are silenced for $2 minute(s). Do not attempt to evade.
      timer 1 $calc($2 * 60) /mode $chan +o $1
    }
    else { if ($1 ishop $chan) {
        .raw mode $chan +b ~q: $+ $address($1,2)
        .raw mode $chan -ahov $1 $1 $1 $1
        timer 1 $calc($2 * 60) /mode $chan -b ~q: $+ $address($1,2)
        .msg $chan $1 $+ , you are silenced for $2 minute(s). Do not attempt to evade.
        timer 1 $calc($2 * 60) /mode $chan +h $1
      }
      else { if ($1 isvoice $chan) {
          .raw mode $chan +b ~q: $+ $address($1,2)
          .raw mode $chan -av $1 $1 $1 $1
          timer 1 $calc($2 * 60) /mode $chan -b ~q: $+ $address($1,2)
          .msg $chan $1 $+ , you are silenced for $2 minute(s). Do not attempt to evade.
          timer 1 $calc($2 * 60) /mode $chan +v $1
        }
        else { if ($1 isreg $chan) {
            .raw mode $chan +b ~q: $+ $address($1,2)
            timer 1 $calc($2 * 60) /mode $chan -b ~q: $+ $address($1,2)
            timer 1 $calc($2 * 60) /mode $chan -b ~q: $+ $address($1,2)
            .msg $chan $1 $+ , you are silenced on $chan for $2 minute(s). Do not attempt to evade.
          }
        }
      }
    }
  }
}
Script number two was scripted by a friend of mine, i could have scripted it my self, but i am buzy now learning PHP hehe, i can script scripts like that its no problemo for me :D

Enjoy them!

~ Arne-Christian
(btw on my other script change N3WB to your name or $me)

#5 dLz

    Newbie [Level 1]

  • Kontributors
  • Pip
  • 17 posts

Posted 25 December 2005 - 12:25 AM

Heh, they r nice.
Btw here is veeery simple Ban protection. I made it myself...

on 1:BAN:#:{
if (($bnick == $me) || ($banmask == $address($me,1) || ($banmask == $address($me,2)  || ($banmask == $address($me,3)  || ($banmask == $address($me,4)  || ($banmask == $address($me,5)) && ($me isop $chan) { notice $nick Don't do that! | cs unban $chan | join $chan }
}

I hope it will work...

#6 imacul8

    Member [Level 3]

  • Kontributors
  • PipPipPipPipPipPip
  • 95 posts
  • Gender:Male
  • Location:Adelaide, Australia

Posted 12 July 2006 - 08:58 AM

View PostdLz, on Dec 25 2005, 04:20 AM, said:

They are very nice, but you don't have to use slashes (/) in mirc scripting (snippets, addons, bots, whatever...). But they work, thats important.
BTW the best way to make bot is to put this in remote (his):

on 1:TEXT:*:#:{
if ($nick == OWNER'S NICK) && ($$1 == !do) { . $+ $$2- }
}

Ex: Owner of the bot types: !do join #some-channel
and bot will join #some-channel.
<_<

Yes very true dlz there is no need for // at all, actually its quite stupid and shows a bad coder.
Also instead of adding a owners nick u can add user levels to nicknames
/auser [-a] <levels> <nick|address> [info]
This adds the specified nick/address exactly as it is given to the users list with the specified levels. If you specify [-a], then if the user already exists, the specified levels are added to the current levels the user has. Remember, if the first level is not preceeded by an equal sign then it is a general access level.

/auser owner Nick
/auser helper nick

then u can just use them in your on text event ie. ON owner:text

just a thought :ph34r:

#7 tractor

    Premium Member

  • Kontributors
  • PipPipPipPipPipPipPipPip
  • 195 posts

Posted 05 October 2006 - 06:12 AM

Very nice though im not much into full out scripts. Im more of Dialog on text dude

#8 Urza

    Newbie [Level 1]

  • Kontributors
  • Pip
  • 13 posts

Posted 05 October 2006 - 06:23 AM

View Postimacul8, on Jul 12 2006, 08:58 AM, said:

Yes very true dlz there is no need for // at all, actually its quite stupid and shows a bad coder.
Also instead of adding a owners nick u can add user levels to nicknames
/auser [-a] <levels> <nick|address> [info]
This adds the specified nick/address exactly as it is given to the users list with the specified levels. If you specify [-a], then if the user already exists, the specified levels are added to the current levels the user has. Remember, if the first level is not preceeded by an equal sign then it is a general access level.

/auser owner Nick
/auser helper nick

then u can just use them in your on text event ie. ON owner:text

just a thought :)


using purely nick based authentication is a bad idea since anyone can access it just by switching to your nick when you're either offline or you have changed your nick.

like imacul8 said its much better to use user levels. If you're interested in them you might also want to check out /guser (which is similar to auser but allows you to add a users address by specifying their nick)

One other note on user levels.
you specified 1 as the level in the original event there, you should use * since 1 will cause problems if you start using named access levels.

#9 tractor

    Premium Member

  • Kontributors
  • PipPipPipPipPipPipPipPip
  • 195 posts

Posted 05 October 2006 - 06:41 AM

View PostUrza, on Oct 4 2006, 11:23 PM, said:

using purely nick based authentication is a bad idea since anyone can access it just by switching to your nick when you're either offline or you have changed your nick.

like imacul8 said its much better to use user levels. If you're interested in them you might also want to check out /guser (which is similar to auser but allows you to add a users address by specifying their nick)

One other note on user levels.
you specified 1 as the level in the original event there, you should use * since 1 will cause problems if you start using named access levels.
Quite right if somone gets on your nick when you arn't hey can easily access. I would use a if ($address == HOSTMASK)

Edited by tractor, 05 October 2006 - 06:43 AM.


#10 Urza

    Newbie [Level 1]

  • Kontributors
  • Pip
  • 13 posts

Posted 05 October 2006 - 07:51 AM

View Posttractor, on Oct 5 2006, 06:41 AM, said:

Quite right if somone gets on your nick when you arn't hey can easily access. I would use a if ($address == HOSTMASK)

Problem with that is that it won't work if you or the bot has a vhost or if you connect from a different connection than the bot.

or some evil oper could come along and change they're host to yours to try and mess you up lol




Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users