--- userpoints_rules.module.orig	2009-04-12 18:47:52.000000000 +0200
+++ userpoints_rules.module	2009-04-22 19:20:23.546875000 +0200
@@ -68,3 +68,50 @@ function userpoints_rules_userpoints($op
     break;
   }
 }
+/**
+ * Rules Conditions - compare userpoints with a defined amount
+ */
+
+/**
+ * Implementation of hook_rules_condition_info().
+ */
+function userpoints_rules_rules_condition_info() {
+  return array(
+    'userpoints_rules_amount' => array(
+      'label' => t('Userpoints amount is >= than x'),
+      'arguments' => array(
+        'user' => array('type' => 'user', 'label' => t('User'))
+      ),
+      'module' => 'Userpoints',
+      'eval input' => array('amount'),
+    ),
+  );
+}
+
+/**
+ * Rules Condition form configuration - set the amount to compare
+ */
+function userpoints_rules_amount_form($settings = array(), &$form) {
+  $form['settings']['amount'] = array(
+    '#type' => 'textfield',
+    '#title' => t('amount to compare'),
+    '#default_value' => isset($settings['amount']) ? $settings['amount'] : '',
+    '#description' => t('The amount to compare if userpoints are >=. Example:30, will trigger the condition if the user userpoints are >= than 30 points.')
+  );
+  $form['settings']['type'] = array(
+    '#type' => 'select',
+    '#title' => t('Userpoints Categories to analyze'),
+    '#options' => userpoints_get_categories(),
+    '#default_value' => isset($settings['type']) ? $settings['type'] : '',
+    '#description' => t('Userpoints Categories to analyze'),
+    '#required' => TRUE,
+  );
+}
+
+/**
+ * Rules Condition - Userpoints amount is >= than
+ */
+function userpoints_rules_amount($account, $settings) {
+  $balance = userpoints_get_current_points($account->uid, $settings['type']);
+  return ($balance >= $settings['amount']);
+}
\ No newline at end of file
