SHARE
TWEET

clock.rb

a guest Dec 29th, 2012 70 Never
  1. require 'clockwork'
  2. include Clockwork
  3.  
  4. handler do |job|
  5.         UserStats = ::UgloungeSkills.find(:all)
  6.  
  7.         UserStats.each do |row|
  8.                 powerLevel = row['taming'] + row['mining'] + row['woodcutting'] + row['repair'] + row['unarmed'] + row['herbalism'] + row['excavation'] + row['archery'] + row['swords'] + row['axes'] + row['acrobatics'] + row['fishing']
  9.                 userName = UgloungeUser.find(row['user_id'])
  10.                 McMMO_id = row['user_id']
  11.                 User.create(name: userName, power_level: powerLevel, mcmmo_id: McMMO_id)
  12.         end
  13. end
  14.  
  15. every(1.minute, 'update.user.table')
RAW Paste Data
Top