mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2010
Posts: 3
F
Self-satisified door
OP Offline
Self-satisified door
F
Joined: Jul 2010
Posts: 3
I'm not a scripter, but I've been reading scripts to learn a bit about them and how they work, and I have programming experience. With that said I did take this script from somewhere else, but I wish to edit it and need help.

Code:
alias mute {
  mode $chan +b ~q: $+ $address($$1,5)
  mode $chan -aohv $$1 $$1 $$1 $$1
  .notice $$1 I just muted you for reason: $iif($2,$2-,No reason.)
}


alias unmute {
  mode $chan -b ~q: $+ $address($$1,5)
  mode $chan +v  $$1
  .notice $$1 You have been unmuted... That was your only warning.. Do not annoy me again or you will be banned.
}
 


The code mutes a single user on /mode. However I can only use it from my own client even when it's set in remote. I need help creating a !mute command so all ops can mute on my channel through me. Syntax would be somethign like "!mute [nick] [reason]". I don't care about a timer I can add that myself.

Also "!unmute [nick]"

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Originally Posted By: FeelGood
I need help creating a !mute command so all ops can mute on my channel through me. Syntax would be somethign like "!mute [nick] [reason]". I don't care about a timer I can add that myself. Also "!unmute [nick]"
Code:
on @$*:text:/^!(un)?(mute)\b/Si:#:{
  if ($nick isop #) { $iif($regml(1) == un,unmute,mute) $$2 $3- }
}
alias mute {
  mode # +b ~q: $+ $address($$1,5)
  mode # -aohv $str($$1 $chr(32),4)
  .notice $$1 I just muted you for reason: $iif($2,$2-,No reason.)
}
alias unmute {
  mode # -b ~q: $+ $address($$1,5)
  mode # +v $$1
  .notice $$1 You have been unmuted... That was your only warning.. Do not annoy me again or you will be banned.
}

Joined: Feb 2009
Posts: 133
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2009
Posts: 133
i think no need to use $$1 to all just use it to the first if $$1 dosnt exist that will halt all the others

so if the first $$1 exist then no need to check the rest of $1's

the alias mute or unmute can be $1 not $$1 bcz of $$2 in the on text event

Last edited by chacha; 17/07/10 11:17 AM.

WorldDMT
Joined: Jul 2010
Posts: 3
F
Self-satisified door
OP Offline
Self-satisified door
F
Joined: Jul 2010
Posts: 3
How would this work? I tried !mute Nick Reason and it doesn't work.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
chacha. Yes, there's no need to check for $1, but I didn't pay much attention to that since I was adding a text event to it so that it will work for ops to command it.

FeelGood, are you opped in channel to command this script? It has to be installed in another client. The client that runs the code needs to have an op status as well.

Joined: Jul 2010
Posts: 3
F
Self-satisified door
OP Offline
Self-satisified door
F
Joined: Jul 2010
Posts: 3
Yes I'm running two different clients and !mute doesn't work from either my BOT client or the client which I talk from. They're both +qo, owner of channel since theyre grouped by nickserv.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Remove the @ symbol by the text event. I think that'll fix it.


Link Copied to Clipboard