Announcement

Collapse
No announcement yet.

Set the colour from a vb.net script

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

    #16
    Originally posted by Jez View Post
    Yes, I call plugin functions in the JowieHue and Pushover plugins
    Can you please post the examples how you call the functions

    Comment


      #17
      Originally posted by alexbk66 View Post

      Can you please post the examples how you call the functions
      Sure. I use hs.PluginFunction................

      For Pushover:

      Code:
      Dim CO(8) as object
      CO(0) = "All Clients"
      CO(1) = "Zappi is waiting for surplus."
      CO(2) = ""
      CO(3) = "normal"
      CO(4) = "magic"
      CO(5) = Nothing
      CO(6) = Nothing
      CO(7) = Nothing
      hs.PluginFunction("Pushover 3P", "", "Pushscript", CO)
      For JowieHue:

      Code:
      Dim Animations() as string = hs.PluginFunction("JowiHue", "", "GetAnimations", Nothing) 'get the list of animations

      Comment


        #18
        Thank you.

        Comment


          #19
          Please update to ver 4.0.0.21 (TmDS error should be fixed too).

          In all my plugins you can access device functions via PluginFunction by appending Ex to the function name and passing first arg. device ref., i.e. the color device has SetColorHex function, so to set the color to red (FF0000) use the following (second arg. 0 you can use to set the color by unsigned integer value, instead of the color string, but I never tried)

          Code:
          &shs.PluginFunction("AK Ikea", "", "SetColorHexEx",  new object[] {3368, 0, "FF0000"});
          The above code will call device 3368: SetColorHex(0, "FF0000")

          Note, you can use either root light ref. or the "custom color" device ref.

          Comment


            #20
            Originally posted by alexbk66 View Post
            Please update to ver 4.0.0.21 (TmDS error should be fixed too).

            In all my plugins you can access device functions via PluginFunction by appending Ex to the function name and passing first arg. device ref., i.e. the color device has SetColorHex function, so to set the color to red (FF0000) use the following (second arg. 0 you can use to set the color by unsigned integer value, instead of the color string, but I never tried)

            Code:
            &shs.PluginFunction("AK Ikea", "", "SetColorHexEx", new object[] {3368, 0, "FF0000"});
            The above code will call device 3368: SetColorHex(0, "FF0000")

            Note, you can use either root light ref. or the "custom color" device ref.
            Hi Alex

            I tried two combinations but nothing positive to report I'm afraid. My attempts and the errors are below:

            Attempt 1
            -------------
            shs.PluginFunction("AK Ikea", "", "SetColorHexEx", new object[] {2217, 0, "FF0000"})

            Error
            Running script(2) &shs.PluginFunction("AK Ikea", "", "SetColorHexEx", new object[] {2217, 0, "FF0000"}), init error: Expected ')'


            Attempt 2
            -------------
            shs.PluginFunction("AK Ikea", "", "SetColorHexEx", {2217, 0, "FF0000"})

            Error
            Running script(2) &shs.PluginFunction("AK Ikea", "", "SetColorHexEx", {2217, 0, "FF0000"}), init error: Invalid character

            Comment


              #21
              Originally posted by Jez View Post
              I tried two combinations but nothing positive to report I'm afraid. My attempts and the errors are below:
              Scripting is not my area of expertise. There's a few options for different scripting engines, i.e. hs, shs, nhs, the syntax should match the engine language, i.e. VB.NET, C#, etc.

              Attempt 1 is using C#, but missing semicolon at the end.

              Comment

              Working...
              X