require 'cinch' require 'open-uri' require_relative '../classes/Util.rb' class RawCmd include Cinch::Plugin include Hooks::ACLHook include Util::PluginHelper set :prefix, /^:/ @clist = %w{raw eval} @@commands["raw"] = ":raw - run through terminal untouched (requires SUPER ADMIN OVER 9000 PRIVILEGES)"; @@commands["eval"] = ":eval - evaluate as ruby code (requires SUPER ADMIN OVER 9000 PRIVILEGES)"; @@levelRequired = 9001 match /raw (.+)/, method: :raw; match /eval (.+)/, method: :reval; def raw(m, cmd) aclcheck(m) if(!aclcheck(m)) m.reply("#{m.user.nick}: quit trynna hax nga") return end IO.popen(cmd).readlines.each { |line| m.reply line } end def reval(m, code) aclcheck(m) if(!aclcheck(m)) m.reply("#{m.user.nick}: quit trynna hax nga") return end m.reply(eval(code)); end end