RMX-OS Online List
Authors: Wizered67
Version: 1.00
Type: RMX-OS Add-on
Key Term: RMX-OS Plugin
IntroductionAdding this script will add a new command for RMX-OS called "/online". By using this command it will give the player a list of all players online. This script requires Blizzard's User Logger for RMX-OS.
Features- Simple add-on that is easy to use
- Makes it easy for any player to find out who is online.
Screenshots
DemoN/A
Script#------------------------------------------------------------------------------
# RMX-OS Online List
# by Wizered67
# V 1.00
# All errors should be reported at www.chaos-project.com.
#------------------------------------------------------------------------------
module RMXOS
module Documentation
PARAMETERS['online'] = 'none'
DESCRIPTIONS['online'] = 'Shows the amount of players online.'
end
class Network
alias check_normal_commands_online_add check_normal_commands
def check_normal_commands(message)
case message
when /\A\/online\Z/
$network.send('POL')
return true
end
return check_normal_commands_online_add(message)
end
end
end
.rb server extension
module RMXOS
def self.load_current_extension
return PlayersOnline
end
end
#======================================================================
# module PlayersOnline
#======================================================================
module PlayersOnline
VERSION = 1.01
RMXOS_VERSION = 1.08
SERVER_THREAD = false
#This will not work if the user logger isn't listed before this.
LOG_LOCATION = UserLogger::ONLINELIST_FILENAME
def self.initialize
end
def self.main
while RMXOS.server.running
self.server_update
sleep(0.1)
end
end
def self.server_update
end
def self.client_update(client)
case client.message
when /\APOL\Z/
#set @players_online to equal an empty array
@players_online = []
#get info from the user logger log.
file = File.open(LOG_LOCATION , 'r')
#add each line to the @players_online array. Each line is a different user.
file.each_line {|line| @players_online.push(line)
}
#close file
file.close
#define a new variable, at first being equal to an empty string.
@players_on = ''
for i in 0...@players_online.size
#makes @players_on equal to the current @players_on plus the players that are online.
@players_on = @players_online[i] + @players_on
end
#sends final message
client.send("CHT#{RMXOS::Data::ColorInfo}\t0\tPlayers Online: #{@players_on}")
return true
end
return false
end
end
InstructionsJust put in the script below RMX-OS and add the .rb add-on to extension to the extensions list.
Make sure it comes after the user logger in the server config.
CompatibilityRequires RMX-OS and Blizzard's User Logger.
Credits and Thanks- Wizered67
- Blizzard for making RMX-OS and his user logger.
Author's NotesIf you have any problems, just report them. I may have missed something.