Well, I decided to try something new with mirc, and that was hotlinks. Just tried them out and they are kind of neat. Anyway, this snippet will reverse a mode previously set by double-clicking on the mode event.
If you'd like to add or remove modes, change the letters in [ohvbeIsklim].
Updates: Now handles multiple modes at a time! - Thanks EL
;----------------------------------
; Reverse modes
; - Written and tested in 6.31
; - Developed by Ken
;----------------------------------
; In a mode event, hover over the '+o/+h' token.
; Double-click, and it will reverse the mode.
; Add or remove modes by changing the letters in '[ohvbeIsklim]'
;----------------------------------
on $^*:hotlink:/[+-][ohvbeIsklim]/:#:{
if ($nick(#,$me,@%)) return
else halt
}
on $*:hotlink:/[+-][ohvbeIsklim]/:#:{
var %a $hotline, %b $findtok(%a,$wildtok(%a,$+(*,$iif(+ isin %a,$v1,-),*),1,32),32), %c $gettok(%a,$+($calc(%b +1),-),32)
mode # $+($iif(+ isin %a,-,+),$right($gettok(%a,%b,32),-1)) %c
}
Alright.
The regex itself is doing the match, and if the regex matches, there must be a matching string or word. And the backreferance will just put that into the memory so you can read it later on.
Here\'s my version:
on $^*:hotlink:/[+-][ohvbeIsklim]/:#: scon -r $iif($nick(#,$me,@%),return,halt)
on $*:hotlink:/([+-][ohvbeIsklim])/:#: mode # $replacex($regml(1),+,-,-,+)
I see how you approached it, I didn\'t realize you could use parenthesis that way, nice code. :D However, I don\'t understand how it would set user modes because you would also need to match the target. That would work for channel modes, but not user modes. Unless I am missing something. :o
Thanks guys for the positive feedback!
Alright.
The regex itself is doing the match, and if the regex matches, there must be a matching string or word. And the backreferance will just put that into the memory so you can read it later on.
Here\'s my version:
on $^*:hotlink:/[+-][ohvbeIsklim]/:#: scon -r $iif($nick(#,$me,@%),return,halt)
on $*:hotlink:/([+-][ohvbeIsklim])/:#: mode # $replacex($regml(1),+,-,-,+)
if you made that regex, you should know how to create a back referance, and how to use it. Of course I created that regex, I can\'t imagine something as simple as the regex I use is extremely hard to create. I\'m not a leecher. :/
The purpose of that regex is to just match the modes, I myself am not that skilled in regex, and as stated above, the regex I made is very simple. However, I don\'t understand how you could use a back reference in this case, as I primarily use tokens to locate the position of the mode in the string. Normally, without any themes, an mIRC user should have mIRC\'s default event text (<NICK1 sets mode: ). This one uses %b to find and %c to find , I don\'t understand how back referencing could achieve that, unless I added or something to the regex.
If you could show me how it would be done, that\'d be great. I\'m not particularly great at regex. :(
Hey thats bad ass lol.Cool idea i had to change it for chatspace but ther then that it works.Not sure if its possable but when you more then one mode change +spl as suck you can only -l and not s(secret) p(private) it only reverses the last one set.But one at a time +s +p +l if you double click on each it will reverse them all.Interesting idea i like it.Good work.\"Rate ir or Hate it?\"...8/10.`-.-