mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2003
Posts: 37
P
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jul 2003
Posts: 37
hi, having a problem with setting timers on different networks.

when i am on multiple networks i want to run seperate timers for each to display a timed msg.

it works great if on one network, but if i am on 2 the dialog allways defaults to the first network.

if i run it from a window it seems to pick up the current network. dialogs dont?

an example dialog

on *:dialog:sounds:*:*:{
if ($devent == init) {
echo -a $server
if ($R.Var(Sounds,Power) == On) { did -c $dname 1 }
else { did -c $dname 2 }
}
if ($devent == sclick) {
if ($did == 1) { W.Var Sounds Power On }
if ($did == 2) { W.Var Sounds Power Off }
}
}
if i run this from undernet, my first connection, the echo returns Surrey.UK.EU.Undernet.Org as expected

if i then connect to dalnet also and activate the same dialog with the dalnet server as the active one it returns Surrey.UK.EU.Undernet.Org again!

what i need is for it to return the currently active network so i can set the timers as (eg) timertimedundernet or timertimeddalnet depending which server it was started on.

can anyone help me out with this one please confused

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Try $scid($activecid).server.

Joined: Jul 2003
Posts: 37
P
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jul 2003
Posts: 37
thanks, but....

using
Code:
  on *:dialog:sounds:*:*:{
  if ($devent == init) {
    echo -a $scid($activecid).server
.......................


activiting the dialog Undernet status as the active window then Dalent status as the active window returns

Surrey.UK.EU.Undernet.Org
Surrey.UK.EU.Undernet.Org

it really appears that dialogs dont pick up the currently active connection confused

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
How are you activating the dialog? Typing /dialog -m sounds sounds?

Joined: Jul 2003
Posts: 37
P
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jul 2003
Posts: 37
yes, called from a pic window menu

if i do it manually from a window using the /dialog... command it picks up the current server fine.

opening the dialog from a pic window menu on the other hand seems to default to the 1st server.

Joined: Jul 2003
Posts: 37
P
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jul 2003
Posts: 37
DUH ME!!! blush

the pic win was started on the undernet server so anything called from it uses that server id.

looks like i'd need a seperate control panel pic window for each server to do it this way frown

anyone know of a way around this one confused

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Untested, but try the -i switch when creating the window.

Joined: Jul 2003
Posts: 37
P
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jul 2003
Posts: 37
thanks but that also returned the server it was first opened on.

solved the problem the easy way, made the control panel window close when its used, so now u have to call it each time you use it (which isnt what i wanted), but it does solve the problem smile

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
If you're still intrested you could also try using $lactivecid instead of $activecid in my first suggestion, I did test this and it seems like it should work.

Joined: Jul 2003
Posts: 37
P
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jul 2003
Posts: 37
thanks, i'll go at it again tomorrow, sick of the sight of code right now smile

thank you for all the help tho m8.


Link Copied to Clipboard