+ def probability?
+ prob = @registry['probability']
+ prob = 25 if prob.kind_of? Array;
+ prob = 0 if prob < 0
+ prob = 100 if prob > 100
+ return prob
+ end
+
+ def status(m,params)
+ enabled = @registry['enabled']
+ if (enabled)
+ m.reply "markov is currently enabled, #{probability?}% chance of chipping in"
+ else
+ m.reply "markov is currently disabled"
+ end
+ end
+
+ def ignore?(user=nil)
+ @registry['ignore_users'].each do |mask|
+ return true if Irc.netmaskmatch mask, user
+ end
+ return false
+ end
+
+ def ignore(m, params)
+ if @registry['ignore_users'].nil?
+ @registry['ignore_users'] = []
+ end
+ action = params[:action]
+ user = params[:option]
+ case action
+ when 'remove':
+ if @registry['ignore_users'].include? user
+ s = @registry['ignore_users']
+ s.delete user
+ @registry['ignore_users'] = s
+ m.reply "#{user} removed"
+ else
+ m.reply "not found in list"
+ end
+ when 'add':
+ if user
+ if @registry['ignore_users'].include?(user)
+ m.reply "#{user} already in list"
+ else
+ @registry['ignore_users'] = @registry['ignore_users'].push user
+ m.reply "#{user} added to markov ignore list"
+ end
+ else
+ m.reply "give the name of a person to ignore"
+ end
+ when 'list':
+ m.reply "I'm ignoring #{@registry['ignore_users'].join(", ")}"
+ else
+ m.reply "have markov ignore the input from a hostmask. usage: markov ignore add <mask>; markov ignore remove <mask>; markov ignore list"
+ end
+ end
+