mIRC Home    About    Download    Register    News    Help

Print Thread
#108605 21/01/05 12:57 AM
Joined: Mar 2004
Posts: 155
D
Darkmnm Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Mar 2004
Posts: 155
Below is a code that I recieved from this forum and since I've been using it with no problems but recently I bought a new video card and am able to watch video's from my pc on my tv but when I do this and I get a message the sounds interfear with my watching the video. Can someone help me with a on/off switch using this code so I am able to turn the sounds off when I watch my video or for that matter When I just don't want it on? Thank you in advance for any help I can get on this matter.

Code:
on *:open:?:{
  if (!$hget(msged,$site)) {
    splay $mircdirsounds/pm.wav
    hinc -m msged $site
    hinc -u1 msged temp
  }
} 
on *:text:*:?:{ 
  if ($active != $nick) && (!$hget(msged,temp)) splay $mircdirsounds/pms.wav
}

#108606 21/01/05 01:06 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Why don't you do something along the lines of...
Code:
on *:open:?:*: {  
  if (!$hget(msged,$site)) { 
    if (%sound == on) { 
      splay $mircdirsounds/pm.wav    
    }
    else { return }
    hinc -m msged $site    
    hinc -u1 msged temp  
  }
}

#108607 21/01/05 01:53 AM
Joined: Mar 2004
Posts: 155
D
Darkmnm Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Mar 2004
Posts: 155
This code didn't seem to work. I added a dialog and added it using your code and seems that the sounds still work when they are turned off.

Code:
on *:open:?:*: {  
  if (!$hget(msged,$site)) { 
    if (%outlawz_ss2 == on) { 
      splay $mircdirsounds/pm.wav    
    }
    else { return }
    hinc -m msged $site    
    hinc -u1 msged temp  
  }
}

on *:text:*:?:{ 
  if ($active != $nick) && (!$hget(msged,temp)) splay $mircdirsounds/pms.wav
}

dialog outlawz_SS {
  title "Outlawz Sounds [ /outlawz_ss ]"
  size -1 -1 68 56
  icon graphics/Outlawz.ico, 0
  option dbu
  box "Outlawz Sounds", 1, 1 2 66 53
  check "Startup Sound", 3, 5 12 45 8
  check "Private Msg Sounds", 4, 5 22 58 8
  check "Transfer Sounds", 5, 5 32 50 8, disable
  check "Pager Sounds", 6, 5 42 43 8, disable
}

on *:dialog:outlawz_SS:init:0:{
  $mdx SetMircVersion $version 
  $mdx MarkDialog $dname
  $mdx SetFont $dname 3,4,5,6 -9 400 dungeon
  $mdx SetFont $dname 1 13 700 Tahoma
  $dll(system\dlls\VStyle.dll,NoTheme,$dialog($dname).hwnd)
  if (%outlawz_ss1 == ON) { did -c outlawz_SS 3 }
  if (%outlawz_ss2 == ON) { did -c outlawz_SS 4 }
}

on 1:dialog:outlawz_ss:sclick:3: { if (%outlawz_ss1 == ON) { %outlawz_ss1 = OFF } | else { %outlawz_ss1 = ON }
}
on 1:dialog:outlawz_ss:sclick:4: { if (%outlawz_ss2 == ON) { %outlawz_ss2 = OFF } | else { %outlawz_ss2 = ON }
}


I feel I am missing something or overlooking something because I've got plenty of on/off switches using dialog's but for some reason I can't seem to think straight on this matter. Once again, thanks in advance for any help on this.

#108608 21/01/05 04:48 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
I wrote this one a while ago, should do in a pinch

alias splay { if (($1- == on) || ($1- == off)) { set %splay $1 } | if (%splay != off) { splay $1- } }


/splay on

/splay off

//echo %splay
[on|off] (might be nothing as well, but off means off anything else means on)


Link Copied to Clipboard