mIRC Home    About    Download    Register    News    Help

Print Thread
#225514 04/09/10 12:47 AM
Joined: Aug 2010
Posts: 69
N
N3M3S1S Offline OP
Babel fish
OP Offline
Babel fish
N
Joined: Aug 2010
Posts: 69
I've already got the script fully functional but it only works on the respective server its called on. How would I go about making the /away command affect all server connections?

Here is a piece of the code. The only thing missing from this snippet is the dxaway alias (which has several functions as you'll notice throughout the snippet) The script works without error, the only thing I can't seem to think of is how to make it affect all active server connections :\

Code:
dialog dxaway {
  size -1 -1 425 85
  icon 01/DX007.ico
  title Away System
  text "Away Message:"1, 5 10 90 15
  edit ""2, 95 5 240 23,autohs
  check "Away"3, 340 5 80 23,push
  check "Ignore messages while away"4, 15 35 185 15
  check "Notify channels when I go away"5, 205 35 200 15
  button "Close"6, 155 55 80 23,ok
}
on *:DIALOG:dxaway:init:*: {
  if ($awaymsg != $null) { did -a dxaway 2 $awaymsg }
  if ($away == $true) { 
    did -c dxaway 3
    did -r dxaway 3
    did -a dxaway 3 Cancel Away
    did -a dxaway $awaymsg 
  }
  if ($dxaway(-a) == on) { did -c dxaway 4 }
  if ($dxaway(-b) == on) { did -c dxaway 5 }
}
on *:DIALOG:dxaway:sclick:*: {
  if ($did == 3) { 
    if ($did(3).state == 1) {
      if ($did(2).text == $null) { away 12*!*14 DeluXe Away System 12*!*4 $me is currently away. }
      else { away 12*!*14 DeluXe Away System 12*!*4 $did(2).text }
      if ($dxaway(-b) == on) { if ($did(2).text == $null) { ame 12*!*14 DeluXe Away System 12*!*4 $me is currently away. }
        else { ame 12*!*14 DeluXe Away System 12*!*4 $me is away: $did(2).text } 
      }
      did -r dxaway 3
      did -a dxaway 3 Cancel Away
    }
    elseif ($did(3).state != 1) { if ($dxaway(-b) == on) { amsg 12*!*14 DeluXe Away System 12*!*4 $me is no longer away. Was away for $duration($awaytime) }
      away
      did -r dxaway 3
      did -a dxaway 3 Away
      if (%dx.msg != $null) { dialog -m dxawm dxawm } 
    }
  }
  if ($did == 4) { if ($did(4).state == 1) { dxaway -a on } | else { dxaway -a off } }
  if ($did == 5) { if ($did(5).state == 1) { dxaway -b on } | else { dxaway -b off } }
}


"There is no theory of evolution, only a list of creatures Chuck Norris allows to live."
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
See /help /scon
I recommend paying attention to the -at1 switches.

Joined: Aug 2010
Posts: 69
N
N3M3S1S Offline OP
Babel fish
OP Offline
Babel fish
N
Joined: Aug 2010
Posts: 69
/scon was what I was thinking of using, I'll take a look at it and see what happens.


"There is no theory of evolution, only a list of creatures Chuck Norris allows to live."

Link Copied to Clipboard