The translator will the default action for all incoming text, and display the translated text in the same format once it is received from the socket. Because of this, your highlight seems to be prevented from ever activating. However, if it didn't do this, you would be seeing 2 of every message. You'd probably have to add a highlight exception within the translation script itself, or change your highlight management to be in a script further up on the list than the translator rather than the built-in highlight in the address book.
Hawkee's suggestion to specify a unit of measure meant that it would be convenient if the user didn't always need to give the duration in seconds. With an option parameter $measure, you could call duration(3, 'hours'); and that bit from my previous posted would translate that into 10800 before performing the regex substitution.
Yeah, the command character switching is a good point...although I'm sure the vast majority of people leave it as /, I guess that means omitting the / in scripts does make it SLIGHTLY more compatible.
And yeah, the . prefix is only to make fewer things appear locally. It's good for some private /notices or /msgs that are script triggered (especially auto-identify. Something about seeing my password appear on the screen bugs me. :P). Also useful for /timer and file handling commands (/fopen and the rest) because nobody really wants to see hundreds of /fwrite notices outside of debugging. ;]
By "minor syntactical deviation" I was implying that only a small number of characters varied. I'm not saying any way is right or wrong either, just that differences like "/echo" and "echo" both function the same in the script. Though I would personally opt for the shorter option, it should be up to whoever is writing it.
Alrighty, if you insist :)
I originally didn't want to because you'd need separate comparisons for each mode, and I wanted to keep it compact, so I found a more compact way to do it:
var %n $replacex($left($nick(%c,$me).pnick,1),~,4,&,3,@,3,%,2), %d $replacex(%y,~,3,&,3,@,2,%,2,+,1)
if (%n <= %d) {
echo -ac INFO * /massmode: You do not have the required permissions on %c
return
}
%c and %y of course already being set in the script. Editing the script with this addition.
Edit: made it even shorter. Not sure why I didn't use $nick before. >_>
var %d $replacex(%y,&,~,@,~&@,%,~&@,+,~&@%)
if (!$nick(%c,$me,%d)) {
echo -ac INFO * /massmode: You do not have the required permissions on %c
return
}
Not bad, a couple things to keep in my mind for future endeavors:
on ^*:BAN:#CHANNEL:{
var %bannum 1
while ($nick($chan,%bannum)) {
if ($address($v1,2) == $banmask) kick $chan $nick($chan,%bannum) You have been banned
inc %bannum
}
}
Rather than doing while (%bannum <= $nick($chan,0)), you can use the change shown to achieve the same result and even quickly access the result with the $v1 identifier. Since you have 'inc %bannum' in both blocks of logic, you can improve efficiency and readability by switching the logic around to only place it where required.
Not saying that anything you did was wrong in any way, but suggestions have always helped me.
Ah, thanks sean, that was pretty careless of me. I'll update it.
jaytea, unless I made my own program from the ground up, there probably won't be a ton of improvement. Notepad++ is a bit limited in things you can define in a custom language. It definitely has some useful options, but you can't make things as perfectly as you would like. Hopefully support is extended in future releases of Notepad++.