Not tested...
PHP Code:
<?php
if (!is_object($vbulletin->db))
{
exit;
}
$removePoints = 10;
$daysInactive = 1;
$cutOff = TIMENOW - (86400 * $daysInactive);
$result = $vbulletin->db->query_read("
SELECT userid
FROM " . TABLE_PREFIX . "user
WHERE lastactivity < $cutOff
");
while ($user = $vbulletin->db->fetch_array($result))
{
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET reputation = reputation - $removePoints
WHERE userid = $user[userid]
");
}
?>
You'll have to update their reputationlevelid as well... don't have time to look into that though.