#!/usr/local/bin/ruby -w # Author:: Dirk Meyer # Copyright:: Copyright (c) 2008 - 2021 Dirk Meyer # License:: Distributes under the same terms as Ruby # Do not change the name of this class. class IrofferEvent # subroutine custom announce def sub_ann( pack ) megabytes = info_pack( pack, "size" ) # human readable desc = info_pack( pack, "desc" ) text = "\"#" text << pack.to_s text << " 0x " text << "[" text << megabytes text << "] " text << desc text << "\"" command( "AMSG", text ) end # called on each pack added def on_added sub_ann( added_pack ) end # Admin Command: RUBY cleanlost # Note: "noduplicatefiles" must be off in config def cleanlost changed = 0 pack = 0 while true do pack += 1 file = info_pack(pack, "file" ) break if file.nil? next if File.exist?( file ) command( "chfile", pack, "/tmp/incorrect.txt" ) command( "chdesc", pack, "file was removed" ) sub_ann( pack ) changed += 1 break if changed >= 50 end end end # eof