Top

TempMute

+ 0 likes
Please Register to submit score.
Average Score  2.0
Scores Submitted  1
Date Added  May 04, 2007
Last Updated  May 04, 2007

Introduction

Well..I need a place to archive my scripts. This seemed like the best place as I theres a chance to receive constructive criticism as well.

Effect: Will mute someone for X amount of minutes

Usage: !temp(mute|gag|silence) nickname minutes

Restricted to: Operators and Half-Operators

Updated: Made notices silent, shortened status check.

Grab the Code

Comments

  (8)  RSS
Lindrian
Comments: 719
 
mIRC Snippet:  TempMute
Posted on May 4, 2007 1:59 am
you can change the op/halfop to:
Code:

if ($nick($chan,$nick,oh)) {

put a . infront of the notice.

What about a check to see if ur admin/op urself??

and $3 == $null can be made if !$3

and instead of "ban ..."
use mode $chan +b ~q:

etc etc.
Lindrian
Comments: 719
 
mIRC Snippet:  TempMute
Posted on May 4, 2007 2:00 am
Never mind the mode, i did not see u were using the -u switch. sorry.
Velociraptor
Comments: 2
 
mIRC Snippet:  TempMute
Posted on May 4, 2007 2:49 am
Thanks for the advise, I've changing everything except the if that checks for parameter $3 as it's a personal preference to have it like that.

Also, yeah. Used -u to avoid using a timer or other means to remove the ban.
Lindrian
Comments: 719
 
mIRC Snippet:  TempMute
Posted on May 4, 2007 2:59 am
I was more thinknig of:
Code:

on $*:TEXT:/^[@!.]temp(gag|mute|silence)/Si:#: {
  if ($3 == $null) {
    .notice $nick You must specify the amount of time in minutes.
    halt
  }
  if ($2($chan,$2,oh)) {
    .notice $nick You cannot ban staff members.
    halt
  }
  if ($nick($chan,$nick,oh)) && ($2 ison $chan) {
    .mode $chan -aovh $2 $2 $2 $2
    ban $+(-u,$calc($3 * 60)) $chan $+(~q:,$address($2,2))
    halt
  }
  else {
    .notice $nick This command is restricted to Half-Operators and Operators.
  }
}

* Note the else statement
* the $2($chan,$2,oh)
* . at the end else notice.
* $2 ison $chan
Velociraptor
Comments: 2
 
mIRC Snippet:  TempMute
Posted on May 4, 2007 3:11 am
Oh, I missed the last notice and forgot to change $nick to $2.

Again, I hate using else statements, it's just a personal preference. In your script, theres no point in the else statement as you've left in the halt.

Thanks again.
Lindrian
Comments: 719
 
mIRC Snippet:  TempMute
Posted on May 4, 2007 3:48 am
still, you would need sonme more checking:
Code:

if $nick($chan,$nick,oh) && $2($chan,$2,vr) && $me($chan,$me,oh) && ($2 ison $chan) {


That would sum up all of your if's needed into 1 statement.

* oh = oper/halfop check
* $chan,$2,vr = will only work if $2 is a voice or regular.
* $me($chan,$me,oh) = will only work if you are halfop/op or above.
xDaeMoN
Comments: 696
 
mIRC Snippet:  TempMute
Posted on May 4, 2007 9:09 am
@ Lindrian,

$me($chan,$me,oh) ? I think you mean $nick($chan,$me,oh).
Lindrian
Comments: 719
 
mIRC Snippet:  TempMute
Posted on May 4, 2007 9:31 am
yes, excuse me for the typo. I was doing that when I was on class, didnt really doubble check what I was typing :p. I eye on the computer, another on the teacher.

Please Register or Login to start posting comments.
Bottom