Announcement

Collapse
No announcement yet.

Does entry point Main exist in script?

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

    Does entry point Main exist in script?

    Hi.

    I have a VB script that grabs a battery level from HSTouch devices. I believe it was OK in HS3, but now in HS4 I get an error in the startup log. Any ideas?

    Thank you
    Br,
    Dali


    Code:
    'HS4 Script 2020-11-02 JG
    'Modified by SER 2020-11-6
    Sub Main(ByVal parm As Object)
    
    Dim BattLevel
    BattLevel = parm(0).ToString ' Get string from HSTouch
    
    hs.SetDeviceValueByRef(2266, BattLevel, True)
    hs.SetDeviceValueEx(2266, BattLevel, True)
    
    
    ' hs.writelog("HSTouch", Zipcode + " Battery Level changed to: " + BattLevel & "%")
    ' hs.writelog("HSTouch", "Client Name: " & Zipcode)
    ' hs.writelog("HSTouch", "Battery Level changed to: " & BattLevel & "%")
    End Sub
    Log
    Click image for larger version  Name:	entry point.jpg Views:	0 Size:	23.9 KB ID:	1491032

    #2
    Remove the line:


    hs.SetDeviceValueEx(2266, BattLevel, True)

    This is an invalid scripting command.
    Jon

    Comment


      #3
      It did the job!

      Thank you so much!

      Br,
      Dali

      Comment

      Working...
      X