mIRC Home    About    Download    Register    News    Help

Print Thread
Echoing messages across networks #170203 04/02/07 08:27 PM
Joined: Feb 2007
Posts: 1
M
Maggah Offline OP
Mostly harmless
OP Offline
Mostly harmless
M
Joined: Feb 2007
Posts: 1
Basically, I've worked up a script taken from snippets of other pieces of code to do the following. In an online game, a faction can call for help by saying "!raid <target>" and the script will list all the nicks in specific channels to ding their clients.

As is, the script works fine so long as the channels are on the same network, and even across the network with the exception of listing the nicks. It tries to send a list of nicks to #factionA, though it's connected to the network for factionB. Anyone have any suggestions?

Code:
alias nicktok {
  var %_ = $nick($1,0,$2)
  while (%_ >= 1) {
    set %nicks $addtok(%nicks,$nick($1,%_,$2),$3)
    dec %_
  }
  if (%nicks == $null) {
    return nonicks
  }
  else {
    var %; = %nicks | unset %nicks
    return %;
  }
}

on *:TEXT:!raid*:#factionA: {
  if ($nick isvoice #factionA || $nick ishalfop #factionA || $nick isop #factionA) { 
    msg #factionA FactionA is under attack by $2-!
    msg #factionA Wakey wakey! $nicktok(#factionA,a,32)
    .scon 2 msg #factionB FactionA is under attack by $2-!
    msg #factionB Wakey wakey! $nicktok(#factionB,a,32)
.scon -r } }

on *:TEXT:!raid*:#factionB: {
  if ($nick isvoice #factionB || $nick ishalfop #factionB || $nick isop #factionB) { 
    .scon 1 msg #factionA FactionB is under attack by $2-!
    msg #factionA Wakey wakey! $nicktok(#factionA,a,32)
    .scon -r msg #factionB FactionB is under attack by $2-!
msg #id.nexus Wakey wakey! $nicktok(#factionB,a,32) } }

Last edited by Maggah; 04/02/07 08:38 PM.
Re: Echoing messages across networks [Re: Maggah] #170387 08/02/07 09:27 AM
Joined: May 2003
Posts: 41
D
Damsulegna Offline
Ameglian cow
Offline
Ameglian cow
D
Joined: May 2003
Posts: 41
This works well:
I added both messages to #fractionB && #id.nexus
Code:
alias msgFa {
  var %y = 1
  while (%y <= $scid(0)) {
    scon %y
    if ($me ison $1) && ($1 == #factionA) { msg $1 $2- $nicktok(#factionA,a,32) }
    inc %y 
  }
}
alias msgFb {
  var %y = 1
  while (%y <= $scid(0)) {
    scon %y
    if ($me ison $1) && ($1 == #factionB) { msg $1 $2- $nicktok(#factionB,a,32) }
    if ($me ison $1) && ($1 == #id.nexus) { msg $1 $2- $nicktok(#id.nexus,a,32) }
    inc %y 
  }
}
alias nicktok {
  var %_ = $nick($1,0,$2)
  while (%_ >= 1) {
    set %nicks $addtok(%nicks,$nick($1,%_,$2),$3)
    dec %_
  }
  if (%nicks == $null) {
    return nonicks
  }
  else {
    var %; = %nicks | unset %nicks
    return %;
  }
}
on *:TEXT:!raid*:#factionA: {
  if ($nick isvoice #factionA || $nick ishop #factionA || $nick isop #factionA) { 
    msgFa #factionA FactionA is under attack by $2-!
    msgFa #factionA Wakey wakey! 
    msgFb #factionB FactionA is under attack by $2-!
    msgFb #factionB Wakey wakey! 
  } 
}

on *:TEXT:!raid*:#factionB: {
  if ($nick isvoice #factionB || $nick ishop #factionB || $nick isop #factionB) { 
    msgFa #factionA FactionB is under attack by $2-!
    msgFa #factionA Wakey wakey! 
    msgFb #factionB FactionB is under attack by $2-!
    msgFb #factionB Wakey wakey!  
    msgFb #id.nexus FactionB is under attack by $2-!
    msgFb #id.nexus Wakey wakey! 
  }
}


you can fine tune it by specifying the $network just in case you have both channels open on both servers blah blah
Code:
    if ($me ison $1) && ($1 == #factionA) && ($network == YourNetwork) { msg $1 $2- #factionA } 


Last edited by Damsulegna; 08/02/07 09:34 AM.

If At First You Don't Succeed, Ask Someone For Help......