OK, well here is the main script which is attached to a button - see what you make of it. As I said, this is written in visual Basic so I don't know how easy it might be to change it to Lua. But if you can see roughly what it's doing and how it might convert, then I could provide more bits and pieces. But I think there could be a major difference in approach as you seem to want to use an existing probe, so I'd not sure the concept works quite the same way.
Enjoy!