mIRC Home    About    Download    Register    News    Help

Print Thread
#138471 01/01/06 05:46 AM
Joined: Mar 2005
Posts: 212
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
i've got an away script ive gradually building on
and apart from some code refinement i cant figure anything else that needs to be done to it other than making it multiple server friendly
it currently relies on global variables predominantly

i tried a 5 year search but i dont feel like i found anything
seems like anytime someone asked for their entire script to multiserver they just got ignored
rightly so, but it made for very little help on the subject

perhaps i overlooked something
as always any help is appreciated

Last edited by NeUtRoN_StaR; 01/01/06 06:20 AM.
#138472 01/01/06 07:07 AM
Joined: Dec 2002
Posts: 35
C
Ameglian cow
Offline
Ameglian cow
C
Joined: Dec 2002
Posts: 35
Have you read /help multi-server ?

#138473 01/01/06 07:07 AM
Joined: Mar 2005
Posts: 212
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
yes

#138474 01/01/06 08:38 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
the short answer is
Code:
alias maway {
  var %away = $input(Enter Excuse for not $+ $crlf being here to talk to me,e)
  scon -as away %away
}


as a sample only.

#138475 01/01/06 09:48 AM
Joined: Mar 2005
Posts: 212
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
unfortunately its not that simple

im going to try and pick out the code i feel is most pertinent

Code:
alias away.on {
  if (%as6away != on) {
    tnick $me $+ - $+ %as6awaysuffix    
    set %as6away on
    echo 5 -a Away is on.
    set %as6chan 1
    set %as6cnum $chan(0)      
    while (%as6chan <= %as6cnum) {
      .timer 1 1 notice $chan(%as6chan) $mnick is %as6awaymessage $+ ; to page me type !page $!me     
      inc %as6chan      
    }      
  }      
  else {
    echo 5 -a Away is already on.   
  }
}    

i think if you can show me a paradigm for that i should be able to carry i through everything else

if your amiable to it i'd like to have you look at the whole thing
but its rather large

#138476 01/01/06 09:56 AM
Joined: Mar 2005
Posts: 212
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
p.s.
the idea would be to be able to chose what servers theyd be away on rather

i think it will prove to be a large job and if you dont want to mess with it let me know

#138477 01/01/06 03:56 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I was thinking that a dialog would be the easiest way to allow for choosing which networks, but realized a few problems with that,which I will work on. In the mean time, I noticed that you're using a loop to send a timed notice to all of the channels that you are on. You can remove that loop and replace it with
Code:
.timer 1 1 ame $mnick is %as6awaymessage $+ ; to page me type !page $!me  


The easiest way to do your request, although it doesn't allow you to pick & choose which networks, is to use something like
Code:
 .scon -at1 away.on 


That will call your away.on alias for each network that you are connected to

#138478 01/01/06 09:00 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Here's what I've come up with regarding individual network controls.
This has been tested with up to 5 networks
Code:
 dialog Away {
  title "Away"
  size -1 -1 115 85
  option dbu
  text "Away", 10, 60 5 50 10, center
  text "Active", 20, 5 5 50 10, center
  list 30, 5 15 50 50, size
  list 40, 60 15 50 50, size
  button "OK", 50, 5 70 50 10, ok default
  button "Cancel", 60, 60 70 50 10, cancel
}
menu * {
  .Away: .dialog -md Away Away
}
on *:dialog:Away:init:*:{
  var %networks = $scon(0)
  var %a = 1
  while %a <= %networks {
    did -a $dname $iif($scon(%a).away == $false,30,40) $scon(%a).network
    inc %a
  }
}
on *:dialog:Away:sclick:30,40:{
  did -a $dname $iif($did == 30,40,30) $did($dname,$did).seltext
  set %network $did($dname,$did).seltext
  did -d $dname $iif($did == 30,30,40) $did($dname,$did).sel
  var %c = 1 
  while $scon(%c).network { 
    if ($v1 == %network) {
      .scon %c away $iif($did == 30,away message)
      echo -a $iif($did == 30,Now,No longer) away on $scon(%c).network
      var %c = $scon(0)
    } 
    inc %c 
  }
}
 


Link Copied to Clipboard