mIRC Home    About    Download    Register    News    Help

Print Thread
#174409 07/04/07 08:06 AM
Joined: Apr 2007
Posts: 3
Y
yzerman Offline OP
Self-satisified door
OP Offline
Self-satisified door
Y
Joined: Apr 2007
Posts: 3
What I would like to do is this:

I would like to type something in as I normally would, but if certian conditions apply, i.e. the channel is moderated, and there are voiced users present, I want to /onotice that text instead of sending that text. Is there a way to do this without hacking the mirc dll's?

Joined: Jan 2007
Posts: 259
K
Fjord artisan
Offline
Fjord artisan
K
Joined: Jan 2007
Posts: 259
Yes, it's possible to do this in mIRC scripting.
You can type the following commands into mIRC (where you'd normally type):
Code:
/help on input
/help $chan(N/#)
/help $chan
/help $nick($nick(#,N/nick,aohvr,aohvr)
/help If Then Else
/help Variables

That should have about everything you'd need to know to do what you want to do. I'd guess you'd be checking if $nick($chan,0,v) (only voices) is greater than zero (means there are that number of voices in the channel). Also, you use ALT + R (two times) to get into the remote section, where the "on input" event would be.


Those who can, cannot. Those who cannot, can.
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
try this:

Code:
on *:input:#:{
  if (/* !iswm $1) || ($ctrlenter) || ($inpaste) && ($nick(#,1,v)) && (m isincs $gettok($chan(#).mode,1,32)) {
    $iif($me isop #,onotice,notice @ $+ #) $1-
    halt
  }
}


the first 3 conditions check you havent typed a command in, the 4th checks for at least 1 voiced person, and the 5th checks the channel is moderated. /onotice requires you to be an operator on the channel so we need /notice @#chan in case you arent which is supported on most if not all networks i've ever been on so it should be ok. you didnt mention whether or not you only want this to happen if you're oped on the channel so right now it'll happen regardless


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde

Link Copied to Clipboard