Announcement

Collapse
No announcement yet.

I need some simple help with a simple script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    I need some simple help with a simple script

    So, I have a script that runs before any TTS that will pause a movie if I'm watching one and I want to amend it to also pause WinAmp.

    Code:
    Sub Main(ByVal parm As Object)
        Dim MPC_On = (hs.DeviceValue(624))
        
        If MPC_On = 100 Then
            hs.TriggerEvent ("Pause MPC-HC")
        End If
    
    End Sub
    What I want to add would be something like:

    Code:
    Dim WinAmp_On = (hs.DeviceValue(1002))
        
        If WinAmp_On = 1 Then
            hs.TriggerEvent ("WinAmp Pause")
    I understand how to add the first line but am not sure how to incorporate the next two. Any help for a clueless N00b?
    Originally posted by rprade
    There is no rhyme or reason to the anarchy a defective Z-Wave device can cause

    #2
    I'm just guessing here but does this work?


    Code:
    Sub Main(ByVal parm As Object)     
    Dim MPC_On = (hs.DeviceValue(624))
    Dim WinAmp_On = (hs.DeviceValue(1002))
    
        If MPC_On = 100 Then         
           hs.TriggerEvent ("Pause MPC-HC")     
        End If     
        If WinAmp_On = 1 Then         
           hs.TriggerEvent ("WinAmp Pause")
        End If
    
     End Sub
    RJ_Make On YouTube

    Comment


      #3
      Originally posted by ServiceXp View Post
      I'm just guessing here but does this work?


      Code:
      Sub Main(ByVal parm As Object)     
      Dim MPC_On = (hs.DeviceValue(624))
      Dim WinAmp_On = (hs.DeviceValue(1002))
      
          If MPC_On = 100 Then         
             hs.TriggerEvent ("Pause MPC-HC")     
          End If     
          If WinAmp_On = 1 Then         
             hs.TriggerEvent ("WinAmp Pause")
          End If
      
       End Sub

      Works like a champ!

      It looks like this scripting business is less complicated than I had imagined. It's just sticking Legos together it seems.

      Thanks for the tip!
      Originally posted by rprade
      There is no rhyme or reason to the anarchy a defective Z-Wave device can cause

      Comment


        #4
        Originally posted by S-F View Post
        Works like a champ!

        It looks like this scripting business is less complicated than I had imagined. It's just sticking Legos together it seems.

        Thanks for the tip!
        Yep, and a little pixie dust to help everything go together easier...
        RJ_Make On YouTube

        Comment

        Working...
        X