Copy via command?
Added by blake b over 5 years ago
So i'm already falling in love with AdiIRC, noticing how many possibilities are available with enough time/research. I've recently wanted to try something, or know if it's possible to achieve.
In a channel, a message will automatically be output with text "Name: joseph Date April 2, 2019 Ship: DeLacey Krait, Platform: PC"
I want a command that will trigger immediately when seeing the word "Ship", and copy that parameter "DeLacey Krait" to clipboard. The above is just an example, however I'd like to know if there's a simple command I can put somewhere somehow that may trigger this in script.
Obliged again!
Replies (4)
RE: Copy via command? - Added by Per Amundsen over 5 years ago
I came up with this snippet which you can put in Menubar -> Tools -> Edit SCripts:
on *:TEXT:*:#:{ if ($regex($1-, /(Ship\: (.*?)\,)/)) { clipboard $regml(2) } }
RE: Copy via command? - Added by blake b over 5 years ago
Sweet, thanks! I copied it to a script in the Edit Scripts panel, saved it. Changed "TEXT" to the trigger and it didn't work once triggered. Anything I should check for, the make sure it's reading the channels?
RE: Copy via command? - Added by Per Amundsen over 5 years ago
"TEXT" is the event associated with incoming text, you can't change that, the trigger is a regular expression inside the $regex() identifier, the "/(Ship\: (.*?)\,)/" part, if you don't know how to do regular expressions, you will have to look into https://en.wikichip.org/wiki/mirc/token_manipulation with comma as the token character because of the specifics of wanting to capture the "next" token.
If you still have problems, please provide the specific input/outpot format you need, like you did with the original example.
RE: Copy via command? - Added by Per Amundsen over 5 years ago
For reference on the event, check on TEXT.