String trigger IRC script - irc

I need a script for IRC client (using KVirc) that will play a sound located somewhere on my hard drive whenever a certain piece of string is mentioned on the main channel. I assume such a thing is possible, but after some time of learning about scripting, I haven't found a way to do this on my own, and would be very grateful to anyone who would either write the piece of code or guide me how to do it myself.
Just a side note, this certain string I have in mind is not an exact string where all the characters are defined, but just first few letters, I assume the $ character is a substitute for all the text after the defined string.

Here it is, I hope I'm not too late xD
Open up KVIrc, hold ALT and press ENTER, it will bring up small console.
In there just copy this:
/event(OnChannelMessage,sounds) { %match_string = "abccc";
%music_file = "C:\\YouTubeMp3\\Selo\ Gori\\CĂ©line\ Dion\ -\ My\ Heart\ Will\ Go\ On-WNIPqafd4As.flv";
if($str.match(%match_string*,$3)) snd.play %music_file;
}
Of course, you should change %match_string and %music_file path, if you have spaces in path just escape them with backslash (), just like I did it.
If you have any questions or you need something else for KVIrc feel free to contact me on Rizon IRC network, nickname is DonVitoCorleone.

Related

How can I prevent AutoHotkey hotstrings after an underscore character?

If I was Bill Gates, I would use this AutoHotkey script to convert my initials into my full name:
::bg::Bill Gates
I would be happy that typing Regards, bg would actually print "Regards, Bill Gates", but I could still successfully type hobgoblin without having "hoBill Gatesoblin" appear. Nice!
Now, when revising an MS Word (of course!) document, I would probably still not like to use OneDrive, so I would create a copy of the document and suffix the filename with _BG. I would that to remain a short "_BG", and I would go crazy if that would always turn out to be converted into "_Bill Gates", because spaces in filenames are still something to avoid.
What could I do, except type awkward walkarounds such as _B(arrowleft)(arrowright)G or _BG(arrowleft)(return)?
The best solution I can find that is working is something like this. Downfall is you have to duplicate your hotstrings.
:?:_bg::_bg
::bg::Bill Gates

Clear part of an IPython cell's output

Before I get reamed for this, I know there are some posts detailing how to clear ALL the output from a cell, but I'm interested in only clearing part of it.
Let me provide some background. I am creating a word-guessing game like LINGO where the user is prompted to guess a five-letter word, then using CSS to provide some visual feedback as to which letters are in the correct position, and which letters are in the word but in the wrong position. The way my program is structured, it displays the feedback after each guess and then prompts the user again and displays the guess. So something like this:
Guess a word: word
FEEDBACK
guess again: word
FEEDBACK
...
You get the picture. My goal is to come as close to duplicating LINGO as possible, which would mean removing the user input from the screen after it has been submitted and having it show a sequence of feedback. This to me means one of three things:
1) Find a way to clear part of the output
2) Find a way to prompt the user for text input without displaying it on the screen
3) Cache the user input, delete the all the output after each iteration, and display the cached guesses.
I've researched 1 and 2 and haven't been able to find anything. 3 would be a PITA so before I went to the trouble I thought I would ask.
1 think is either not possible or very difficult - it's hard in regular python, never mind Jupyter. In regular python, you'd probably use something like curses but I tried it in Jupyter and it affects the console Jupyter is running from - not the stdout in the notebook.
If you really wanted 2, you could probably write your own version of input that uses carriage return \r after stripping the trailing newline via writing a function that loops listening for keystrokes and submitting once a newline is pressed. The carriage return should mean that the next line overwrites the previous line.
3 Caching the input shouldn't be too difficult though I presume? Just store them in an array or something then you can display them back to the user after using IPython.display.clear_output.

Io language user input

I recently started messing around with the Io programming language and think it's pretty fun and simple to learn. But I also hate that there is so little documentation and support for it. Normally I come to SO for help, but even on here the topic is sparse.
I am learning from the 7 languages in 7 weeks book, which I like, but there he mainly talks about the deeper uses of Io.
My question is probably extremely simple but I can't find an answer anywhere... How do you actually ask a user for input? I've found ways to pass along set strings, read in strings from files, but I can't find a way to ask a user for input.
What I'm working on now is writing a function that accepts 2 parameters: a string and a substring to find in that string. The function finds the substring in the string and prints the index. I don't even know if I should be asking the user for input or doing this another way...
I'm trying to get some keyboard time in on Io but it's frustrating :/
Also, does anyone know of any IRC channels that are friendly to beginners? Not necessarily just Io, but in general?
Thanks guys.
On the topic of IRC, there's irc.freenode.net and the #io channel. We're not always active, but if you hang around, I usually poke in at least once a day.
On the topic of user input however, You can do this:
x := File standardInput readLine
This will get a single line of input, up to where the user hit the enter/return key, and capture that in x.

How to understand this perl multi-line writing command

I am trying to understand the perl commands below:
$my = << EOU;
This is an example.
Example too.
EOU
What is the name of this way? Could somebody can explain more about this "multi-line writing" command?
Essentially the syntax is allowing you to put anything unique as a marker so that it won't conflict with your contents. You can do this:
$my = <<ABCDEFG;
This is an example.
Example too.
BLAH
ABCDEFG
Everything between "This.." and "BLAH" will be assigned to the variable. Note that you shouldn't have a space after the << symbols otherwise you will get a syntax error. It helps avoid adding CR characters, or append (.) everywhere, and useful when passing data into another application (eg. ftp session). Here Documents is the correct term for this.
Everything between <<EOU and EOU is a multi-line, non-escapable, string. It's nothing fancy, think of them as start and end quote marks with nothing inside requiring escapes to be literally what you typed...

Eclipse basic shortcuts - assigning assistant, extract variable

There are some pretty basic tasks and I'm in doubt how it can be effectively done in Eclipse IDE:
Content assisted variable declaration/assignment:
Imagine you have to write something like this DateFormat df = new SimpleDateFormat();. How can it be effectively typed? One guess like DateFormat df = new plus some quick Ctrl+Space, not very, very long SimpleDateFormat. But this does not work, it will show completely useless alphabetically sorted types from classpath, usually unassignable to DateFormat.
Extracting variable:
Is there any way to extract variable like Alt+Shift+L does but WITHOUT the need to manipulate the mouse to select expression or whole line? Just like extract content under cursor? Or is there some way to select line (this work only for standalone expression but better than mouse)?
Extracting field:
Any way to extract field in more convenient way than perform 2. followed by another magic - convert variable to field?
I'm doing mentioned combos every 1-5 minute, and it seems to me like editor completely unusable for serious work. (Iff one is not Ray Manzarek)How are you typing in Eclipse? Note that I prefer default settings, no fine-tuning which stops working after first upgrade or terminal change. Thanks.
For your first problem, here's how I do:
DateF<ctrl-space><Enter> df = new SDF<ctrl-space><Enter>
For your second problem, I simply select the text I want with ctrl-shift-left_or_right_arrow.
For your third problem, no idea. I don't remember having transformed a local variable into a field for a long long time. Maybe I just know beforehand which fields I'll need for a given class.
For the first one, I find I just need to type DateF Alt-\ Enter df = new Sim Alt-\ Enter ;, which doesn't seem too bad to me.
For your second question Shift-Option-Right extends the selection to the right one word at a time, and Shift-Option-Left to the left; that, in combination with the keyboard shortcut you mention, should do what you want (those are Mac keys, of course, but I'm sure there are Windows equivalents; I understand some folks actually develop software on Windows.)
For number three: don't think so. You could write your own plugin to do it pretty easily.