No announcement yet.

Change Color of button depending on ping reply

  • Filter
  • Time
  • Show
Clear All
new posts

  • Change Color of button depending on ping reply

    Hi guys,

    I have a small simple app that has a number of buttons.

    Each button when clicked opens a webpage of a device on my small home network.

    I want to have a ping run every say 30 seconds whilst my app is open and try and change the button color depending on the ping reply. So if a specific device is up, the relevant button would be green green and if down and no ping reply the button would turn say red.

    Any help is much appreciated

  • #2
    You can use reteset's CommandLine plugin to perform the Ping test from your page's On Timer event. It'll pipe the Std.Out result directly back into AMS. But how you interpret the results of the Ping is up to you. Decide on a benchmark and if the Std.Out result meets that benchmark, use an if/then statement to code the appropriate color change. (The plugin's already been re-upped a number of times, so have a look for it. It comes with an example of how to code the Ping test).


    • #3
      as an alternative to the suggestion of BioHazard



      • #4
        try this with some adjustment instead of the one created "on the fly"



        • #5
          what is this ping plugin your using, I thought I seen many but that one I haven't seen before or if I had I over looked it.
          Plugins or Sources MokoX
          BunnyHop Here