mIRC Homepage
Posted By: DazzaJay $nick to be hidden IF username? - 22/08/22 03:55 PM
Hi all, i have a doozie, and i'm an absolute beginner. (I used mIRC years ago, but have forgotten everything)

I found this script online, but i have already heavily modified it and removed a bunch of stuff i didn't need.
it works fine for the most part, but i want to make one change that's a little out of my league.

So, here's the current script:

Code
###############################################
# Relay script 1.0 by ChiefDean
# irc.HeatWaveIRC.net #Heatwave
###############################################

Menu * {
  -
  Relay Setup: {
    set %serv1 $input(Enter Server One here.,e,Relay Script 1.0 by ChiefDean)
    set %chan1 $input(Enter Channel One here.,e,Relay Script 1.0 by ChiefDean)
    set %serv2 $input(Enter Server Two here.,e,Relay Script 1.0 by ChiefDean)
    set %chan2 $input(Enter Channel Two here,e,Relay Script 1.0 by ChiefDean)
    if ($numtok(%serv1 %chan1 %serv2 %chan2,32) == 4) { $input(Setup Complete.Remember to turn the power on!,,Script 1.0 by ChiefDean) }
    else { $input(Critical Setup Error! Please return to Relay Setup and Start over!,,Script 1.0 by ChiefDean) }
  }
  $iif($group(#Relay) == On,$style(1)) Relay Power Switch
  .$iif($group(#Relay) == On,$style(2)) On: .enable #Relay
  .$iif($group(#Relay) == Off,$style(2)) Off: .disable #Relay

  -
}
alias -l net {
  var %netcount $scon(0)
  while %netcount {
    if ($scon(%netcount).network == $1) { var %netid %netcount }
    dec %netcount
  }
  scon %netid return $!cid
}
alias -l relay { 
  scid $net($1)
  if ($me ison $3) { $2- }
}
alias -l RCheck { 
  if ($1 == $2) && ($3 == $4) { return 1 }
  else return 0
}
#Relay on
on *:TEXT:*:#:{
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $+($nick,$chr(58)) $1- }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $+($nick,$chr(58)) $1- }
}
#Relay End



Now, what i want to do down here in the #Relay on section is:

IF the $nick is "restreambot" then send the message WITHOUT ($nick,$chr(58))
Else, do the existing code.

So, I'm guessing the changes need to be made here:
Code
#Relay on
on *:TEXT:*:#:{
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $+($nick,$chr(58)) $1- }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $+($nick,$chr(58)) $1- }
}


but i don't know how.

Any ideas?

Thanks.
Posted By: maroon Re: $nick to be hidden IF username? - 22/08/22 06:14 PM
#Relay on
on *:TEXT:*:#:{
var %nick $+($nick,$chr(58)) | if ($nick == restreambot) var %nick
if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 %nick $1- }
elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 %nick $1- }
}
Posted By: DazzaJay Re: $nick to be hidden IF username? - 23/08/22 01:41 AM
Works absolutely perfectly! thanks maroon!

How it was relaying before:
<ps_chat_relay> restreambot: [YouTube: DazzaJay] testing the relay

And how it relays now:
<ps_chat_relay> [YouTube: DazzaJay] Another Test




There's probably a better way to do what I'm doing, as i have multiple relay services working together across my twitch, discord and youtube, as well as my wife's twitch, discord and youtube.
Er... Flowchart...

Code
   DazzaJay YouTube ─┐
                     │
Dazza Discord ── Restream ─┐
                           │
                      DazzaJay Twitch ─┐
                                       │
                                       │
                                mIRC Relay Script
                                       │
                                       │
                     Allimac87 Twitch ─┘
                           │
 Alli Discord ── Restream ─┘
                     │
  Allimac87 YouTube ─┘


Why not use Restream for everything?
can't have more than one YouTube, Twitch or Discord account connected per restream account, and it also relays video between the channels, which wouldn't work for us.

so yeah, that works both ways and links all our livestream chats together.
the reason why we've done this is because we always stream together (from different computers) with our voices connected through discord, and it can get confusing when one of us is verbally replying to a text chat the other cannot see.

so, although the overall setup may be a little janky, this should successfully eliminate the whole "what?" "is someone in your text chat?" "what are they saying, i'm only getting half the conversation?" thing we currently have going on.
© mIRC Discussion Forums