mIRC Homepage

Multiple TEXT modification

Posted By: sergiodf

Multiple TEXT modification - 18/04/03 05:53 PM

Hi all
I wish mIRC has a new event, wich i will refer to it as PRETEXT.
Actually (as far as i know) TEXT are modiffied by only one script, who print (echo) it, halting default event processing.
I think this restricts add-ons capabilities.
Example:
<John> hey, peter, i'm finally using mirc! I love it!
Supose Peter loves mIRC, so codes an script to replace "mirc" with the full colored mIRC 'logo'
But he's also a little narcicist, so adds a little modification to replace "peter" with a nice Peter with a red "P", black "eter" and yellow background (his favorite colors).
I think you get the idea. Any little-little-little feature, requires (some) new line(s) to be added in the 'on TEXT' event.
And what about to give his modiffications to his friends? Completly difficult.

What about something like this?:
on 1:PRETEXT:*mirc*:*:return $replace($1-,mirc,mIRC) <<< well, full technicolor
on 1:PRETEXT:*peter*:*:return $replace ...

This way simplifies scripts and make they 'shareables' as add-ons.

What do you think about?
Posted By: RoCk

Re: Multiple TEXT modification - 18/04/03 07:04 PM

What about something like this eh ?:

on ^*:TEXT:*:#:echo # $+(<,$nick,>) $replace($1-,peter,$+(04,$chr(44),08P01eter),mirc,02m04IR08C) | haltdef

you get the idea
Posted By: sergiodf

Re: Multiple TEXT modification - 18/04/03 08:08 PM

You don't understand me.

That is the tipical script.
I want each TEXT may be modified by multiple scripts.
Posted By: RoCk

Re: Multiple TEXT modification - 18/04/03 08:10 PM

it will do the same thing that you specified
Posted By: Spola

Re: Multiple TEXT modification - 18/04/03 08:37 PM

no it will not, and i support this idea....

i suppose this could be done by putting in your first.mrc (or whatever you call the script that's loaded in slot 1) something to set %event.text $1- and then in last.mrc echoing that text. Making all your scripts alter %even.text won't be difficult.

Nice idea tho for cross addons (i want on input too, for those nickname completors etc...)
Posted By: _D3m0n_

Re: Multiple TEXT modification - 19/04/03 05:56 AM

isnt there already an ON INPUT event that can do all of this?
i mean anything hes suggesting can be done already quite easily with ON INPUT

The on INPUT event triggers when you enter text in an editbox and press enter.


Format: on <level>:INPUT:<*#?=!@>:<commands>
Example: on 1:INPUT:#mIRC:/echo You entered the text " $1- " in the #mIRC window

now how will that not do what hes asking for? ......better yet why add the pretext event at all if this can be used to do exactly what hes wanting ..... i dont see him asking for something NEW ... its just a new way of saying the same ole thing ...... as far as it being interlinked with other scripts?? how would somethig u type have to do with anything that interlinks with another addon? i dont understand what it is that your talking about by that? please explain it so someone besides u can understand ...... i cant say i support an idea that has absolutly no use that something that is already in place has? thats like putting 2 stop signs at the same side of the road at the same intersection and changing the color of one it makes absolutly no sense to me
Posted By: sergiodf

Re: Multiple TEXT modification - 19/04/03 10:26 AM

I see, you really don't understand what are we talking about.

The 'same old thing' allows to modify TEXT or INPUT.
What hapen if you load another script with a TEXT or INPUT event trigger?
Well, it has no effect, or you lost the previous functionality; because any TEXT or INPUT event finish with a halt.

Please re-read my example (first message) and try to find why this events will be useful and what is the difference with actual methods. When you understand it, we'll be accepting your opinion with arms open.
Please don't sink my idea just because you can't understand it.
Posted By: _D3m0n_

Re: Multiple TEXT modification - 19/04/03 02:33 PM

it only terminates IF it matches if u make ur events correctly
therefore if u know what ur scripting and do it properly u can use ON input in any script whether u load it last first or in the middle ...... i do understand what ur saying but obviously ur not scripting anything better than 10 yr old would do

example of this would be
Code:
ON *:INPUT: {
if ( $1 == wb ) { msg $active 14,11514 15W14elcome 15B14ack15 $2- 14,11514 | halt }
}

now that will ONLY trigger if the first word is wb ..... it will replace it with something else ........ now how is that going to mess up other scripts elsewhere???
if it messes up yours then your coding wrong
Posted By: Spola

Re: Multiple TEXT modification - 19/04/03 06:25 PM

Hrm, i think this calls for an example...

Let's pretend one wants to have a nickname completor and an acronym replacer loaded at the same time. Now let's suggest that they both use the on input event. Most of the times, this will cause conflicts if a line has a nickname in it, and an acronym of some sort (let's say 'wb'), however, if something like this was to be possible:

Code:
--- nc.mrc ---
on *:input: #: if ( $1 ison #) { tokenize 32 $1 $+ : $2- }

--- acro.mrc ---
on *:input: #: tokenize 32 $replace( $1-, wb, welcome back)


Can you see what's happening? The scripts do not send text to the server or anything, they merely alter the string of text that is being passed to the other events (of course this doesn't work atm - i presume). Naturally this should be made possible for other events too (like an on text event as the original author suggested)

It should also be a noted that an identifier like $rawinput might be necessairy to increase safety.

Moving on to the "i do understand what ur saying but obviously ur not scripting anything better than 10 yr old would do" then... Yes, it's quite possible that someone who scripts his own scripts can cope without this method quiete easily, in fact, it's being done all the time... rigth now. However, had you been around mIRC scripting channels as much as i have, you would have noticed that countless people come in and go like:

<guest666> :::Spola::: help, everything i type comes out twice!!! lol
<guest666> Spola help, everything i type comes out twice!!! Laughs Out Loud

It should be obvious to someone as experienced as yourself that what we are suggesting would eradicate all these problems (very easily).

---
If you had known what you were talking about, you probably would have kept your mouth shut
© 2020 mIRC Discussion Forums