exit 2
end
- #botclass = "#{Etc.getpwnam(Etc.getlogin).dir}/.rbot" unless botclass
- botclass = "#{ENV['HOME']}/.rbot" unless botclass
+ botclass = "#{Etc.getpwuid(Process::Sys.geteuid)[:dir]}/.rbot" unless botclass
+ #botclass = "#{ENV['HOME']}/.rbot" unless botclass
@botclass = botclass.gsub(/\/$/, "")
unless FileTest.directory? botclass
def mainloop
while true
begin
- connect
- @timer.start
+ connect
+ @timer.start
while true
if @socket.select
def log(message, where="server")
message.chomp!
stamp = Time.now.strftime("%Y/%m/%d %H:%M:%S")
+ where.gsub!(/[:!?$*()\/\\<>|"']/, "_")
unless(@logs.has_key?(where))
@logs[where] = File.new("#{@botclass}/logs/#{where}", "a")
@logs[where].sync = true
# call the save method for bot's config, keywords, auth and all plugins
def save
- @registry.flush
@config.save
@keywords.save
@auth.save