0

Send Zone Message from script?

I'm working on a project to build an animated odometer, which will display the value of a variable defined by a UDP message.
My presentation is built with a zone for each digit in the number, with an imagelist state in each zone. Each imagelist is set to advance to the next item on a zone event specific to that digit (D1 for first digit, D2 for second digit, etc.)
What I am trying to do is have the presentation receive the UDP input, set the new odometer value, then trigger a script to advance the digits until the current value equals the new value.
The difficulty I'm having now is that I can't figure out how to send a zone message from inside the script. I can't seem to find the information in any of the documentation or example scripts.

This is my preliminary code for the odometer run loop, with the missing Zone Message syntax commented:

while odoCURRENT<>odoNEW
  'Send Zone Message "D1"
  odoCURRENT=odoCURRENT+1
  CURRENTd1=CURRENTd1+1
  if CURRENTd1=10 AND odoCURRENT<>odoNEW
    CURRENTd1=0
    'Send Zone Message "D2"
    CURRENTd2=CURRENTd2+1
    if CURRENTd2=10 AND odoCURRENT<>odoNEW
      CURRENTd2=0
      'Send Zone Message "D3"
      CURRENTd3=CURRENTd3+1
      if CURRENTd3=10 AND odoCURRENT<>odoNEW
        'Send Zone Message "D4"
        CURRENTd4=CURRENTd4+1
        if CURRENTd4=10 AND odoCURRENT<>odoNEW
          'Send Zone Message "D5"
          CURRENTd5=CURRENTd5+1
          if CURRENTd5=10 AND odoCURRENT<>odoNEW
            'Send Zone Message "D6"
            CURRENTd6=CURRENTd6+1
            if CURRENTd6=10 AND odoCURRENT<>odoNEW
              'Send Zone Message "D7"
            end if
          end if
        end if
      end if
    end if
  end if
end while

So what code do I need to use to send the appropriate zone messages?

1 comment

  • 0
    Avatar
    Lyndon

     

    I assume you are using a plugin. The brightauthor autorun itself isn't documented, but I had a need for the same ability previously. So, I figured out how to send zone messages, as well as plugin messages from a plugin. You just need to enter your command using the first line, and then change the last line so it matches the correct object in your plugin that pointing to a copy of the msgport object. 

     

    sendZoneMessageParameter$ = "your command here"
    zoneMessageCmd = CreateObject("roAssociativeArray")
    zoneMessageCmd["EventType"] = "SEND_ZONE_MESSAGE"
    zoneMessageCmd["EventParameter"] = sendZoneMessageParameter$
    m.msgPort.PostMessage(zoneMessageCmd)

Please sign in to leave a comment.