mIRC Home    About    Download    Register    News    Help

Topic Options
#264315 - 19/11/18 08:41 PM Help With Variety Message Twitch Script
Darealcc Offline
Mostly harmless

Registered: 19/11/18
Posts: 1
Hi yall
I got a new PC and never saved all my mIRC scripts for twitch. Does anyone have / know a command to send a different message each time.
For example if someone says hello, one possible reply would be hello (then the users name) then a different option being welcome to the stream etc etc?

#264316 - 19/11/18 09:03 PM Re: Help With Variety Message Twitch Script [Re: Darealcc]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 1144
Note: twitch has not faithfully replicated the existing IRC protocol, so while this works at other networks, I don't use twitch, so I can't guarantee that twitch supports the same server commands.

if you want to have random behavior, you can use $rand to create a random number, then have the outcome be based on that number. If the alias is named "greet", and you plan to use it by typing in the channel window "/greet nickname", that first parameter after the alias name is used inside the script as $1

This code would go into the window opened by Alt+R

alias greet {
if (!$nick($chan,$1)) { echo -a syntax /greet nickname | return }
var %a $rand(1,4)
if     (%a == 1) msg $chan hello $1
elseif (%a == 2) msg $chan Abandon hope, $1 $+ !
elseif (%a == 3) msg $chan good day $1 $+ ! welcome to $chan
elseif (%a == 4) msg $chan hello $1 I ran out of things to say

If you press Alt+P to open the popups menu, choose 'view' from that window and choose 'nicklist'. You should see the default trout slap looking like:

Slap!:/me slaps $$1 around a bit with a large trout

You can add another line to use your greeting by right-clicking on that nick. The line could look like:

Greet!:greet $$1

In this context, $1 is the 1st highlighted nick in the list, and using $$1 instead of $1 halts immediately if $1 is blank (because no nicks are highlighted)

Whatever you type to the left of the : colon is the label in your menu, and to the right of the colon is the command to execute.