i have trouble
i am using 1 script that is only supports mirc 6.03 (in newer it becomes buggy)
and i am trying to prevent some things to be written but as i tested mirc 6.03 it seems that mirc 6.03 tottaly ignores ON INPUT event no matter is it defined to work in channel, query or in any window... i made this:
on *:input:*:{
if ($1 == /crap) {
haltdef
//echo -a this command is not supported }
halt
}
but instead "this command is not supported"
i get this by server which mirc SHOULD stop
(05:15) CRAP Unknown command
so i ask advanced coders here is there another way to block things like this (input) by not using input... or to force mirc to do itz job ?
because of script stability i dont intend to use newer versions
on 1:INPUT:*: { if ($1 == /crap) { echo -a this command is not supported | halt } }
same thing...
(05:31) CRAP Unknown command
works just fine here.. you are shure you dont have any input somwhere else in the same file? "abow that line"
in the same .mrc file i have only this
ON 1:INPUT:=: { if ($1 == .me) || ($1 == /me) || ($1 == .ame) || ($1 == /ame) || ($1 == /action) { .me $replace($2-,$chr(32),$chr(160)) | .echo 7 -a $timestamps $theme(me,$me,$2-) | halt } | if ($left($1,1) != /) { .echo -a $timestamps $theme(metext,$nick,$1-) | .msg $active $1- | halt } }
ON 1:INPUT:?:{ if ($1 == .me) || ($1 == /me) || ($1 == .ame) || ($1 == /ame) || ($1 == /action) { .me $2- | .echo -a $timestamps $theme(me,$me,$2-) | halt } | if ($left($1,1) != /) { .quote PRIVMSG $active : $+ $1- | .echo -a $timestamps $theme(metext,$nick,$1-) | halt } }
ON 1:INPUT:#:{ if ($1 == .me) || ($1 == /me) || ($1 == .ame) || ($1 == /ame) || ($1 == /action) { .me $2- | .echo -a $timestamps $theme(me,$me,$2-) | halt } | if ($left($1,1) != /) { .quote PRIVMSG $active : $+ $1- | .echo -a $timestamps $theme(metext,$nick,$1-) | halt } }
on *:INPUT:*:{ if (($1 == .anick) || ($1 == /anick)) { set %anick $2 } }
with this code
try put my line in a empty file.. then you should see it working..
yay !!! it worked ! (stupid me)
thank you very much !
np
Just as a side note, if you think the script is a little cluttered, you could do:
if ($istok(.me /me .ame /ame /action,$1,32))
instead of
if ($1 == .me) || ($1 == /me) || ($1 == .ame) || ($1 == /ame) || ($1 == /action)
Greets
hmmm but still it does ignores some things...
look at this for example:
on 1:INPUT:*: {
if ($network == undernet) {
if (($1 == /mode) || ($1 == //mode)) {
if (h iswm $3) {
.echo $chan Undernet doesn't support halfop mode
halt
}
}
}
}
when i do +h mode on me mirc does not halts nor echoes this msg
To FiberOptics: hehe thanks, but its ok by me as long it works
You have to use wildcards, when trying to match with iswm. Either that, or use isin, regex, w/e.
okay, it works with ISIN but only if i type it :P well ok it is on input but what to do if i have that in popup section ?
code:
.$iif($me !ishop #, ( +h ) halfop, $style(2) ( +h ) halfop):/mode $chan +h $1-31
.$iif($me !ishop #, ( -h ) dehalfop, $style(2) ( -h ) dehalfop):/mode $chan -h $1-31
how can i apply that halting cmd on this ?
it is still /mode $chan and $3 is H
hope you understand
Personally, I think you are going at this in an inefficient way.
I hadn't looked at the thread, so didn't know what you were doing.
But if you want to alter the way commands work, or change their actions, you shouldn't try to detect them with on input events, but rather create custom aliases.
alias me echo -a this is my own alias which overrides the built in one, unless if you type /!me
alias ame return
alias mode {
...
if $network == undernet && h isin $2 { blabla }
...
}
This way, it will work, wherever it is used, whether from the editbox, or from popups, or from scripts etc.
You get the picture.
Greets
and if i make
alias mode { bla bla }
what should i write so that it dont reflect on other modes
if i make it to detect only +h and +u on undernet
then what to do write so it wont interfire with
/mode $chan +b or +o someone
OR
/mode $channel +s +i +l
etc...
because i already have this in aliases:
mode {
If ($1) && (+b == $2) { set %bch $1 }
mode $1-
}
???
if $network == undernet && h isin $2 { blabla }
elseif $network == undernet && +b isin $2 { mode # +b what_ever }
you mean like that?
but the first line only react if h isin $2 so you can use:
if $network == undernet && h isin $2 { blabla }
else {
somthing
}
By the way, I'm rarely on IRC, so I don't know for sure, but you should use isincs if there is also a mode H (upper case), because isin won't make a distinction between upper/lower case.
Also, I think it's possible to indeed do something like /mode # +mode1 -mode2 +...
so you are going to need a better matching pattern, something a regex can do for you.
I'm too tired right now, going to bed, catch ya later.
i managed to fix all that, i personally want to thank both of you coz you helped me alot today with 1 thing that killed me long time =)
well i dont know what regex is nor how to use it... so some example would be nice :P
Wait,
are you sure that it is possible to set multiple modes, seperated by a space?
Like //mode # +s +i ... ? It didn't work for me, so it looks like all modes have to be in one token, like +s+i-m...
If that is correct, then using "if h isincs $2" is sufficient.
Greets
in channel
i typed:
/mode #channel +s +t +i +l 3
result:
(19:59) (modes@Wragg): +stil 3
but i changed isin to isincs... so dunno does anything alse needs to be modified ?
You probably already have a custom alias, if it set the modes, because when I do:
/mode #channel +s +t +i +l 3
it did
[20:56:53] * FiberOPtics sets mode: +s
So try to find that alias which is doing this. Somewhere in the alias, it'll probably have the diff modes stored in a %var, so you could add your code "if h isincs %var" { ... } or something. You're the scripter, you'll figure it out
Greets
Aliases:
mode {
If ($1) && (+b == $2) { set %bch $1 }
if ($network == quakenet) || ($network == undernet) {
if (h isincs $2) || (u isincs $2) { .echo -a $network does not support this mode. | halt }
}
mode $1-
}
cmode {
if ($server = $null) { /echo -a Can't change channel modes while disconnected from server ! | halt }
else { /mode $chan $1- }
}
all i have for channel modes