This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

clock.rb

By: a guest on Dec 29th, 2012  |  syntax: Ruby  |  size: 0.62 KB  |  views: 57  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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')
clone this paste RAW Paste Data