mIRC Home    About    Download    Register    News    Help

Print Thread
Making a multitwitch link with a command #259889 08/02/17 05:43 PM
Joined: Oct 2016
Posts: 22
W
wobY Offline OP
Ameglian cow
OP Offline
Ameglian cow
W
Joined: Oct 2016
Posts: 22
Hey!

So, for example, if I type "!multitwitch Twitch Lirik summit1g" i'd want script to return a link like this: multitwitch.tv/Twitch/Lirik/summit1g

The replace with the users IRL name and twitch link work, its probably really messy but i'm still learning. If there's no need for alias(es), even better

Code:
on *:TEXT:!multitwitch*:#: {
  if ($0 == 2) {
    msg $chan N.N. is playing with $peoplesIRLName($2) $twitchLink($2)
    msg $chan If you want to watch both N.N. and $peoplesIRLName($2) but you only have one monitor: $multiTwitchLink($2)
  }
  elseif ($0 == 3) {
    msg $chan N.N. is playing with $peoplesIRLName($2) $twitchLink($2) and $peoplesIRLName($3) $twitchLink($3)
    msg $chan If you want to watch both N.N., $peoplesIRLName($2) and $peoplesIRLName($3) but you only have one monitor: $multiTwitchLink($2,$3)
  }
  elseif ($0 == 4) {
    msg $chan N.N. is playing with $peoplesIRLName($2) $twitchLink($2) and $peoplesIRLName($3) $twitchLink($3) and $peoplesIRLName($4) $twitchLink($4)
    msg $chan If you want to watch both N.N., $peoplesIRLName($2) $+ , $peoplesIRLName($3) and $peoplesIRLName($4) but you only have one monitor: $multiTwitchLink($2,$3,$4)
  }
  elseif ($0 == 5) {
    msg $chan N.N. is playing with $peoplesIRLName($2) $twitchLink($2) and $peoplesIRLName($3) $twitchLink($3) and $peoplesIRLName($4) $twitchLink($4) and $peoplesIRLName($5) $twitchLink($5)
    msg $chan If you want to watch both N.N., $peoplesIRLName($2) $+ , $peoplesIRLName($3) $+ , $peoplesIRLName($4) and $peoplesIRLName($5)  but you only have one monitor: $multiTwitchLink($2,$3,$4,$5)
  }
}

alias -l peoplesIRLName {
  return $replace($1,N.N., N.N., N.N., N.N., N.N., N.N.,N.N., N.N.)
}

alias -l twitchLink {
  return $+(twitch.tv/,$1)
}

alias -l multiTwitchLink {
  ?????
}

Re: Making a multitwitch link with a command [Re: wobY] #259894 09/02/17 12:43 AM
Joined: Oct 2015
Posts: 111
B
Blas Offline
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 111
That's an interesting idea for a script. I wrote something that will do this for you. There are other, arguably better ways to replace the users name with their IRL name than the method I used, however. Having said that, I also don't recommend using the $replace method that you used simply because it will replace any instance of those words in a name. Example, if you used $replace to replace "bob" with "steve," and the name entered in the !mulitwitch command was "bobby," it would replace it with "steveby." I hope this script helps. Let me know if you have any questions. smile

Code:
ON *:TEXT:!multitwitch *:#: {
  ; set variables for the script
  VAR %num = $0, %x = 1, %msg_01, %msg_02
  ; run WHILE loop to generate info to be used for the message lines
  WHILE (%x < %num) {
    VAR %name $ [ $+ [ $calc(%x + 1) ] ]
    VAR %IRLname $peoplesIRLName(%name)
    VAR %msg_01 %msg_01 %IRLname twitch.tv/ $+ %name and
    VAR %msg_02 %msg_02 %IRLname and
    INC %x
  }
  ; cut off the trailing ends of the %msg variables created in the WHILE loop and insert into the bot's output message in chat
  MSG $chan N.N. is playing with $left(%msg_01,-4)
  MSG $chan If you want to watch both N.N. and $left(%msg_02,-4) but you only have one monitor: multitwitch.tv/ $+ $replace($2-,$chr(32),/)
}

alias peoplesIRLName {
  IF ($1 == name_from_command) RETURN IRL_name
  IF ($1 == name_from_command) RETURN IRL_name
  IF ($1 == name_from_command) RETURN IRL_name
  RETURN $1
}

Last edited by Blas; 09/02/17 01:08 AM.
Re: Making a multitwitch link with a command [Re: Blas] #259911 10/02/17 01:43 PM
Joined: Oct 2016
Posts: 22
W
wobY Offline OP
Ameglian cow
OP Offline
Ameglian cow
W
Joined: Oct 2016
Posts: 22
Thanks a lot! You made it look so much cleaner, I'll try it out later today.

Its mostly for personal use, so it would only replace 4-5 Twitch nicknames with the IRL names.

Re: Making a multitwitch link with a command [Re: Blas] #259928 11/02/17 08:24 PM
Joined: Oct 2016
Posts: 22
W
wobY Offline OP
Ameglian cow
OP Offline
Ameglian cow
W
Joined: Oct 2016
Posts: 22
Works perfectly! Thank you very much Blas