mIRC Home    About    Download    Register    News    Help

Print Thread
#122564 12/06/05 11:17 PM
Joined: Mar 2003
Posts: 8
D
donn Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Mar 2003
Posts: 8
For a while now in one of the channels I autojoin I can type something like "25 + 4" into the editbox and when I press enter it will display "29" as channel talk, ie evaluating editbox input, I can't for the life of my find out where this option is set, as it only works in this one particular channel and no others...

Any clues?

#122565 12/06/05 11:32 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
its not an option, it well be a script

go to ALT-R, remotes tab, then edit/search and search for the channel name, you well likely find it in something "like" this

ON *:INPUT:#channelname:{

change the #channelname to be just #

and it should function on any channel (weather if functions correctly or not sorry i cant tell.

PS: u may also have to locate mentionings of #channelname in the script and change them to # also.

#122566 13/06/05 08:17 AM
Joined: Mar 2003
Posts: 8
D
donn Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Mar 2003
Posts: 8
Ahh thanks, I had written a script to filter out any swearwords I typed a while back, which also had the effect of evaluating things...

It's pretty neat so I've changed it to an input evaluator, this is it for anyone who is interested;

on *:INPUT:#: { if (/* !iswm $1) { var %replace = $1- | msg $active %replace | halt } }

Now if someone asks me a simple sum I can just type it in and i'll look smart with the answer!

Thanks again grin

#122567 13/06/05 08:46 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
This would be a slight bit better, it covers
/ and the mirc definable / replacment,
also if ctrl keys down (normally means dont process anything)
or if your pasting lines, )which normally mean you dont want to process anything)

on *:INPUT:#: { if (!$istok(/ $readini($mircini, text, commandchar), $left($1, 1), 32)) && (!$ctrlenter) && (!$inpaste) { var %replace = $1- | msg $active %replace | halt } }

#122568 14/06/05 05:43 PM
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Nice trick, but I'd say this is actually a mIRC bug...


Saturn, QuakeNet staff
#122569 14/06/05 11:06 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Its not a bug its just how mirc handles numerics, well maybe its a bug lol

on *:INPUT:#: { if (/* !iswm $1) { var %replace = $1- | msg $active %replace | halt } }

if i type 24 + 5
then
var %replace = $1-
becomes
var %replace = 24 + 5
aka
var %replace = 29
This is what mirc is speced/designed to do , it well take it as a numeric calculation over a literal text

if i type 24 + 5 + b
the result is
24 + 5 + b

#122570 15/06/05 12:15 AM
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Let me put it this way. How do I assign the literal text "1 + 1" (for example, contained in $1-) to a variable? The complexity of the answer is more or less proportional to the likeliness that this is unintended behaviour (i.e. a bug).

Keep in mind that the mIRC helpfile only defines these operations on variables to work "when using the equal sign", whereas /set actually works the same way. I wouldn't mind if mIRC supported this feature pre-evaluation, but applying it post-evaluation seems rather weird to me...


Saturn, QuakeNet staff
#122571 15/06/05 12:23 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
//set -ln %var 1 + 1

As with everything this evaluating of simple math expressions has it's advantages and disadvantages. I'm ok with the way it works, but it'd be nicer if you could have a flag with /var that gives you the option to choose whether or not to evaluate math expressions perhaps.


Gone.
#122572 15/06/05 10:37 AM
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Oh okay.. that's easy enough wink I kinda expected the -n switch to cause the rest of the line not to be evaluated at all, but I should've tested that I guess.

Still, I personally would've preferred /var to use -n implicitly, but since this thread shows that it can actually be put to use.. oh well.. smile


Saturn, QuakeNet staff

Link Copied to Clipboard