Stricter event matching - 16/06/03 09:38 AM
I'd like to see some additions to events to allow for stricter matching. Such as
ON *:TEXT:matchtext:#:CIDS:MYMODE:NICKMODE:NICKNOTMODE: { }
ON *:TEXT:*bitchx*:#mIRC:5,6:@::@%+: { }
If you are opped in #mIRC on CIDs 5 or 6 and Somenick types "bitchx rules!" and somenick is NOT voiced, opped, or halfopped. I know the extra 3 fields can easily be scripted but I like to specify as much as possible in the event itself and let mIRC do the matching up internally. Events that this would apply to are: ACTION, BAN, CTCP , DEHELP , DEOP, DEVOICE, HELP , JOIN, KICK, MODE , NOTICE ,OP , PART, RAWMODE, SERVERMODE, SERVEROP, TEXT, TOPIC, UNBAN, and VOICE. Some of those events would have no use for NickMode or NickNotMode (like serverop, servermode, and Join) so you wouldn't specify them. With the mode events NickMode and NickNotMode would apply to the person setting the modes. These addtions should be able to be done without breaking older scripts. "On *:Text:*:#: " would be treated like "On *:Text:*:#:*:*:*:: {".
- A prefix making the matchtext case sensitive.
- A spot in events for CIDs. Ex: ON *:Join:#channels:CIDS: I don't think many would put an actual number in this field. Most would put a variable there and change the variable within the on connect event.
- A spot for the users modes, and $nick's mode in channel related events
- My Mode: Rather than use the mode's letters use the modes prefix such as @%+. Event will trigger if you are those modes. "@%+" would mean trigger if the user is opped, voiced, or halfopped on #.
- NickMode: Works like MyMode except it applies to $nick.
- NickNotMode: Works like MyMode except it applies to $nick and matches when $nick is NOT those modes.
ON *:TEXT:matchtext:#:CIDS:MYMODE:NICKMODE:NICKNOTMODE: { }
ON *:TEXT:*bitchx*:#mIRC:5,6:@::@%+: { }
If you are opped in #mIRC on CIDs 5 or 6 and Somenick types "bitchx rules!" and somenick is NOT voiced, opped, or halfopped. I know the extra 3 fields can easily be scripted but I like to specify as much as possible in the event itself and let mIRC do the matching up internally. Events that this would apply to are: ACTION, BAN, CTCP , DEHELP , DEOP, DEVOICE, HELP , JOIN, KICK, MODE , NOTICE ,OP , PART, RAWMODE, SERVERMODE, SERVEROP, TEXT, TOPIC, UNBAN, and VOICE. Some of those events would have no use for NickMode or NickNotMode (like serverop, servermode, and Join) so you wouldn't specify them. With the mode events NickMode and NickNotMode would apply to the person setting the modes. These addtions should be able to be done without breaking older scripts. "On *:Text:*:#: " would be treated like "On *:Text:*:#:*:*:*:: {".
Code:
on *:start: { unset %cidlist } on *:connect: { if ($network == SomeNet) { %cidlist = $addtok(%cidlist,$cid,44) } else { %cidlist = $remtok(%cidlist,$cid,1,44) } } ON *:text:*badword*:#MyChannel:%cidlist:@%::@%: { kick $chan $nick Don't say badword! } vs on *:text:*badword*:#MyChannel: { if (($istok(%cidlist,$cid,44) && (($me isop $chan) || ($me ishop $chan)) && (($nick !isop $chan) && ($nick !ishop $chan))) { kick $chan $nick Don't say badword! } }