mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2016
Posts: 86
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
Hi, I'm trying to write a script consisting with the Twitch command /color, but for some reason it's not giving me anything. The script works with $rand, and each line as a different color code for whenever I speak in a Twitch chat. Here's what I have down so far:

on *:TEXT:*:#: {
if ($nick == Bestpeff) {
Var %random = $rand(1,3)
:1 | msg /color #1FF8FF | return
:2 | msg /color #FF0000 | return
:3 | msg /color #0FC99A | return
}
}

Help would be appreciated, thanks (:

Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
First, the on Text event doesn't trigger when mIRC SENDS text to the channel/room. Its only triggered when text is received.

You'll most likely want on Input; something similar to:

Code:
;; 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
    }
}

Last edited by FroggieDaFrog; 07/09/16 10:54 AM.

I am SReject
My Stuff
Joined: Apr 2016
Posts: 86
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
@FroggieDaFrog,

I'm almost positive I have everything jotted down and made into this:

on *:INPUT:#bestpeff:{
if (!$ctrlenter && !$inpaste && /* !iswm $1 && $comchar $+ * !iswm $1 && *.twitch.tv iswm $server) {
var %colors = #1FF8FF #FF0000 #0FC99A
var %color = $gettok(%colors, $rand(1, $numtok(%colors,32)), 32)
msg # /color %color
}
}

but I am still not getting any headway... smirk

Is this all correct?

Joined: Apr 2016
Posts: 86
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
Unfortunately, I've tried a bunch of wording and formatting and nothing is making a working outcome

Code:
 on *:INPUT:#bestpeff:{
  if (!$ctrlenter && !$inpaste && /* !iswm $1 && $comchar $+ * !iswm $1 && *.twitch.tv iswm $server) {
    var %colors = #1FF8FF #FF0000 #0FC99A
    var %color = $gettok(%colors, $rand(1, $numtok(%colors,32)), 32)
    msg # /color %color
  }
}

Joined: Apr 2016
Posts: 86
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
Ok, so I found out that the code does work, but only inside mIRC. How do I make it so whenever I type in a twitch chat it'll change the color?


Link Copied to Clipboard