;; On input is triggered when text is to be sent from the client to the server
;; the "#" indicates that this event should only trigger when text is sent to a channel/room
on *:INPUT:#:{
;; 1. Make sure control+enter wasn't used to send the message;
;; This is basic mIRC convention for scripts
;;
;; 2. Make sure multiline text wasn't pasted into mIRC to be sent
;; Again, convention
;;
;; 3. Make sure the input text isn't a command
;;
;; 4. Make sure the server you are sending the text to is a twitch chat server
if (!$ctrlenter && !$inpaste && /* !iswm $1 && $comchar $+ * !iswm $1 && *.twitch.tv iswm $server) {
;; Create a variable that contains a list of the various colors
;; List items are seperated with sapce
var %colors = #1FF8FF #FF0000 #0FC99A
;; Select a random color
var %color = $gettok(%colors, $rand(1, $numtok(%colors,32)), 32)
;; Send the color command to the channel/room
msg # /color %color
}
}