on_level gives you the acutal percent.

void loading(var progress)
{
..
}

...
on_level = loading;
...