Skip to content

Instantly share code, notes, and snippets.

@Maw-Fox
Created January 25, 2012 15:40
Show Gist options
  • Save Maw-Fox/1676837 to your computer and use it in GitHub Desktop.
Save Maw-Fox/1676837 to your computer and use it in GitHub Desktop.
Mako pools
$include lib/rp
: wwwmakopool[ arr:data ref:player str:param -- ]
{ "Current active pools:"
rpsys "Mako Pool/" array_get_propvals dup array_count not if pop "No pools are active at the moment." else
"<table width=700>"
"<tr><th>Name</th><th>Description</th><th>Current Contribution</th><th>Percent Complete</th></tr>"
foreach var! desc var! name
"<tr><td>" name @ "</td><td>"
desc @ "</td><td>"
rpsys { "Mako Pool/" name @ "/Total Contributions" }cat getpropint dup "/" swap
rpsys { "Mako Pool/" name @ "/Goal" }cat getpropint dup rot swap / var! poolpercent "</td><td>"
poolpercent @
repeat
"</table>"
then
}cat .tell
"</body>" .tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment