Author Topic: Need help creating a constantly updating GUI element  (Read 815 times)

I want to monitor a few variables for a script I'm creating. How can I create a constantly updating GUI element that displays the variables?

If you only need it for your own testing purposes, it might make sense to just make a schedule loop that uses bottomprint and/or centerprint to show you your variables.
Code: [Select]
function showme(%client)
{
   %client.centerprint("<just:right>Something:" SPC $myVariable SPC "Else:" SPC $myOtherVariable);
   schedule(100, %client, showme, %client);
}


Code: [Select]
function showme(%client)
{
   cancel(%client.showMeSched);
   %client.centerprint("<just:right>Something:" SPC $myVariable SPC "Else:" SPC $myOtherVariable);
   %client.showMeSched = schedule(100, %client, showme, %client);
}
improving on pecons code in my case I would always make sure I cancel a schedule so that you don't accidently have multiple running

Nevermind.

If only we could sage.