
|
# File rbot/auth.rb, line 24
def initialize(bot)
@bot = bot
@users = Hash.new(0)
@levels = Hash.new(0)
if(File.exist?("#{@bot.botclass}/users.rbot"))
IO.foreach("#{@bot.botclass}/users.rbot") do |line|
if(line =~ /\s*(\d+)\s*(\S+)/)
level = $1.to_i
mask = $2
@users[mask] = level
end
end
end
if(File.exist?("#{@bot.botclass}/levels.rbot"))
IO.foreach("#{@bot.botclass}/levels.rbot") do |line|
if(line =~ /\s*(\d+)\s*(\S+)/)
level = $1.to_i
command = $2
@levels[command] = level
end
end
end
end
|