mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
on input #102785 13/11/04 04:17 AM
Joined: Sep 2004
Posts: 129
W
Wragg Offline OP
Vogon poet
OP Offline
Vogon poet
W
Joined: Sep 2004
Posts: 129
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

Re: on input #102786 13/11/04 04:23 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
on 1:INPUT:*: { if ($1 == /crap) { echo -a this command is not supported | halt } }


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: on input #102787 13/11/04 04:31 AM
Joined: Sep 2004
Posts: 129
W
Wragg Offline OP
Vogon poet
OP Offline
Vogon poet
W
Joined: Sep 2004
Posts: 129
same thing...

(05:31) CRAP Unknown command


smirk

Re: on input #102788 13/11/04 04:32 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
works just fine here.. you are shure you dont have any input somwhere else in the same file? "abow that line"


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: on input #102789 13/11/04 04:38 AM
Joined: Sep 2004
Posts: 129
W
Wragg Offline OP
Vogon poet
OP Offline
Vogon poet
W
Joined: Sep 2004
Posts: 129
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

Last edited by Wragg; 13/11/04 04:39 AM.
Re: on input #102790 13/11/04 04:46 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
try put my line in a empty file.. then you should see it working..


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: on input #102791 13/11/04 04:49 AM
Joined: Sep 2004
Posts: 129
W
Wragg Offline OP
Vogon poet
OP Offline
Vogon poet
W
Joined: Sep 2004
Posts: 129
yay !!! it worked ! (stupid me)

thank you very much !

Re: on input #102792 13/11/04 04:57 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
np laugh


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: on input #102793 13/11/04 05:01 AM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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


Gone.
Re: on input #102794 13/11/04 05:13 AM
Joined: Sep 2004
Posts: 129
W
Wragg Offline OP
Vogon poet
OP Offline
Vogon poet
W
Joined: Sep 2004
Posts: 129
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 laugh

Re: on input #102795 13/11/04 05:16 AM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
You have to use wildcards, when trying to match with iswm. Either that, or use isin, regex, w/e.


Gone.
Re: on input #102796 13/11/04 05:23 AM
Joined: Sep 2004
Posts: 129
W
Wragg Offline OP
Vogon poet
OP Offline
Vogon poet
W
Joined: Sep 2004
Posts: 129
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

Last edited by Wragg; 13/11/04 05:24 AM.
Re: on input #102797 13/11/04 05:34 AM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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


Gone.
Re: on input #102798 13/11/04 05:39 AM
Joined: Sep 2004
Posts: 129
W
Wragg Offline OP
Vogon poet
OP Offline
Vogon poet
W
Joined: Sep 2004
Posts: 129
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-
}


???

Last edited by Wragg; 13/11/04 05:40 AM.
Re: on input #102799 13/11/04 05:43 AM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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
}

Last edited by sparta; 13/11/04 05:44 AM.

if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: on input #102800 13/11/04 05:51 AM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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.

Last edited by FiberOPtics; 13/11/04 05:52 AM.

Gone.
Re: on input #102801 13/11/04 05:51 AM
Joined: Sep 2004
Posts: 129
W
Wragg Offline OP
Vogon poet
OP Offline
Vogon poet
W
Joined: Sep 2004
Posts: 129
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 =)

Re: on input #102802 13/11/04 05:53 PM
Joined: Sep 2004
Posts: 129
W
Wragg Offline OP
Vogon poet
OP Offline
Vogon poet
W
Joined: Sep 2004
Posts: 129
well i dont know what regex is nor how to use it... so some example would be nice :P

Re: on input #102803 13/11/04 06:13 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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


Gone.
Re: on input #102804 13/11/04 07:00 PM
Joined: Sep 2004
Posts: 129
W
Wragg Offline OP
Vogon poet
OP Offline
Vogon poet
W
Joined: Sep 2004
Posts: 129
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 ?

Page 1 of 2 1 2