Welcome Guest ( Log In | Register)



2 Pages V   1 2 >  
Reply to this topicStart new topic
> Mirc Snippets, Some snippets for IRC Chatters :)
dLz
post Dec 24 2005, 02:39 PM
Post #1


Newbie [Level 1]
*

Group: Members
Posts: 17
Joined: 23-December 05
Member No.: 16,112



You can find them on:
www.hawkee.com
www.mircscripts.org
www.mircscripts.com
www.mirc.net
...
Here are somones...:
CODE

; 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 ] ]
   }
 }
}


CODE

;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
}


CODE

;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... smile.gif
CODE

;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
Go to the top of the page
 
+Quote Post
Arne-Christian
post Dec 24 2005, 04:34 PM
Post #2


Member [Level 1]
****

Group: Members
Posts: 62
Joined: 22-December 05
From: Sandefjord,Norway
Member No.: 16,078



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

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


Away Script:
CODE
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!
Go to the top of the page
 
+Quote Post
dLz
post Dec 24 2005, 06:50 PM
Post #3


Newbie [Level 1]
*

Group: Members
Posts: 17
Joined: 23-December 05
Member No.: 16,112



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):

CODE

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.
smile.gif
Go to the top of the page
 
+Quote Post
Arne-Christian
post Dec 24 2005, 07:22 PM
Post #4


Member [Level 1]
****

Group: Members
Posts: 62
Joined: 22-December 05
From: Sandefjord,Norway
Member No.: 16,078



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 :
CODE
/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 :
CODE
/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 biggrin.gif

Enjoy them!

~ Arne-Christian
(btw on my other script change N3WB to your name or $me)
Go to the top of the page
 
+Quote Post
dLz
post Dec 25 2005, 12:25 AM
Post #5


Newbie [Level 1]
*

Group: Members
Posts: 17
Joined: 23-December 05
Member No.: 16,112



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

CODE

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...
Go to the top of the page
 
+Quote Post
imacul8
post Jul 12 2006, 08:58 AM
Post #6


Member [Level 3]
******

Group: Members
Posts: 95
Joined: 21-May 06
From: Adelaide, Australia
Member No.: 24,017



QUOTE(dLz @ Dec 25 2005, 04:20 AM) *

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):

CODE

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.
smile.gif


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 smile.gif
Go to the top of the page
 
+Quote Post
tractor
post Oct 5 2006, 06:12 AM
Post #7


Premium Member
********

Group: Members
Posts: 195
Joined: 28-September 06
Member No.: 30,705



Very nice though im not much into full out scripts. Im more of Dialog on text dude
Go to the top of the page
 
+Quote Post
Urza
post Oct 5 2006, 06:23 AM
Post #8


Newbie [Level 1]
*

Group: Members
Posts: 13
Joined: 5-October 06
Member No.: 31,096



QUOTE(imacul8 @ Jul 12 2006, 08:58 AM) *

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 smile.gif



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.