diff --git a/LocalPackages/BungeeCord/auto_include.ms b/LocalPackages/BungeeCord/auto_include.ms index ac5605a..63e9ec5 100644 --- a/LocalPackages/BungeeCord/auto_include.ms +++ b/LocalPackages/BungeeCord/auto_include.ms @@ -1,4 +1,4 @@ -proc(_writeUTF, @ba, @str, +proc _writeUTF(@ba, @str) { @len = length(@str) if (@len > 200) { die('String too long') @@ -6,9 +6,9 @@ proc(_writeUTF, @ba, @str, ba_put_byte(@ba, 0) ba_put_byte(@ba, @len) ba_put_bytes(@ba, string_get_bytes(@str, 'ascii')) -) +} -proc(_changeserver, @player, @server, +proc _changeserver(@player, @server) { @ba = byte_array() _writeUTF(@ba, 'Connect') _writeUTF(@ba, @server) @@ -16,15 +16,15 @@ proc(_changeserver, @player, @server, @servers = array('creative', 'pve', 'minigames', 'lobby') if (array_contains(@servers, to_lower(@server)) && to_lower(@server) != import('sharedata.source'), unbind('bc-'.@player) - bind(player_quit, array(priority: normal, id: 'bc-'.@player), array(player: @player), @event, @server, + bind('player_quit', array(priority: 'normal', id: 'bc-'.@player), array(player: @player), @event, @server, modify_event('message', color(yellow). @event['player'] . ' has switched to ' . @server) unbind() ) ) send_plugin_message(@player, 'BungeeCord', @ba) -) +} -proc(_sendPluginMessage, @player, @channel, @messages, +proc _sendPluginMessage(@player, @channel, @messages) { if (@player != '~console') { @ba = byte_array() foreach (@messages, @message, @@ -32,7 +32,7 @@ proc(_sendPluginMessage, @player, @channel, @messages, ) send_plugin_message(@player, @channel, @ba) } -) +} @mcb_tab_completer = closure(@alias, @sender, @args){ @res = array(); diff --git a/LocalPackages/CHMail2/auto_include.ms b/LocalPackages/CHMail2/auto_include.ms index a822e71..e031481 100644 --- a/LocalPackages/CHMail2/auto_include.ms +++ b/LocalPackages/CHMail2/auto_include.ms @@ -2,7 +2,7 @@ /** * Retrieves the player's uuid from the mail database, or null if no player is known with that username */ -proc(_mail_get_puuid, @playerName){ +proc _mail_get_puuid(@playerName){ @res = query('mail', 'SELECT uuid FROM user WHERE last_username=? LIMIT 1', to_lower(@playerName)); if(length(@res) == 0){ return(null); @@ -14,7 +14,7 @@ proc(_mail_get_puuid, @playerName){ /** * Gets the last known username from the mail database, or null, if no player is known with that uuid */ -proc(_mail_get_username_from_uuid, @uuid){ +proc _mail_get_username_from_uuid(@uuid){ @res = query('mail', 'SELECT last_username FROM user WHERE uuid=?', @uuid); if(length(@res) == 0){ return(null); @@ -26,7 +26,7 @@ proc(_mail_get_username_from_uuid, @uuid){ /** * Gets the last known display name from the mail database, or null, if no player is known with that uuid */ -proc(_mail_get_display_name_from_uuid, @uuid){ +proc _mail_get_display_name_from_uuid(@uuid){ @res = query('mail', 'SELECT last_display_name FROM user WHERE uuid=?', @uuid); if(length(@res) == 0){ return(null); diff --git a/LocalPackages/CHMail2/main.ms b/LocalPackages/CHMail2/main.ms index 36aabd2..32fa161 100644 --- a/LocalPackages/CHMail2/main.ms +++ b/LocalPackages/CHMail2/main.ms @@ -1,6 +1,6 @@ -bind(player_join, null, null, @event){ +bind('player_join', null, null, @event){ x_new_thread('mail_player_join', closure(){ // Sleep, so they are fully joined before we get their id. sleep(1); diff --git a/LocalPackages/CHMarquee/auto_include.ms b/LocalPackages/CHMarquee/auto_include.ms index 6ec50d9..a3f48b2 100644 --- a/LocalPackages/CHMarquee/auto_include.ms +++ b/LocalPackages/CHMarquee/auto_include.ms @@ -1,5 +1,5 @@ -proc(_init_marquee, @name, +proc _init_marquee(@name) { if(!has_value('chmarquee.list')){ store_value('chmarquee.list', array()) } @@ -8,18 +8,18 @@ proc(_init_marquee, @name, array_push(@list, @name) store_value('chmarquee.list', @list) } -) +} -proc(_check_marquee, @name, +proc _check_marquee(@name) { assign(@value, get_value('chmarquee.list')) if(!is_array(@value) || !array_contains(@value, @name)){ return(false) } else { return(true) } -) +} -proc(_start_marquee, @name, +proc _start_marquee(@name) { #Stop the marquee if it's already started marquee_stop(@name) msg('Starting \''.@name.'\' marquee.') @@ -58,13 +58,13 @@ proc(_start_marquee, @name, _stop_marquee(@name) ) )) -) +} -proc(_stop_marquee, @name, +proc _stop_marquee(@name) { marquee_stop(@name) -) +} -proc(_remove_marquee, @name, +proc _remove_marquee(@name) { _stop_marquee(@name) assign(@list, get_value('chmarquee.list')) array_remove_values(@list, @name) @@ -72,5 +72,5 @@ proc(_remove_marquee, @name, foreach(array_keys(get_values('chmarquee.' . @name)), @key, clear_value(@key) ) -) +} diff --git a/LocalPackages/Chaos/suppress_death_messages.ms b/LocalPackages/Chaos/suppress_death_messages.ms index 78679bd..d091913 100644 --- a/LocalPackages/Chaos/suppress_death_messages.ms +++ b/LocalPackages/Chaos/suppress_death_messages.ms @@ -1,5 +1,5 @@ -bind(player_death, null, null, @e, +bind('player_death', null, null, @e, if(get_value('supress_death_messages')){ console('Death message suppressed: ' . @e['death_message']) modify_event('death_message', null) diff --git a/LocalPackages/ItemFrameMapBan/main.ms b/LocalPackages/ItemFrameMapBan/main.ms index a56bb4d..b6a412c 100644 --- a/LocalPackages/ItemFrameMapBan/main.ms +++ b/LocalPackages/ItemFrameMapBan/main.ms @@ -1,6 +1,6 @@ # Lol, I love one liners -bind(player_interact_entity, null, null, @event, +bind('player_interact_entity', null, null, @event, if(@event['clicked'] == 'ITEM_FRAME' && pinv(player(), null) != null && (pinv(player(), null)['type'] == 395 diff --git a/LocalPackages/SessionTracker/main.ms b/LocalPackages/SessionTracker/main.ms index 2fdf1c9..c697459 100644 --- a/LocalPackages/SessionTracker/main.ms +++ b/LocalPackages/SessionTracker/main.ms @@ -1,10 +1,10 @@ -bind(player_join, null, null, @event, +bind('player_join', null, null, @event, @session_number=get_value('session_number.'.player())+1 store_value('session_number.'.player(), @session_number) store_value('session_start.'.player(), time()) ) -bind(player_quit, null, null, @event, +bind('player_quit', null, null, @event, @session_number=get_value('session_number.'.player()) @session_start=get_value('session_start.'.player()) console('SessionTracker: '.player().','.@session_number.','.@session_start.','.(time()-@session_start)) diff --git a/LocalPackages/ShareData/auto_include.ms b/LocalPackages/ShareData/auto_include.ms index a0b033b..0bc6ab7 100644 --- a/LocalPackages/ShareData/auto_include.ms +++ b/LocalPackages/ShareData/auto_include.ms @@ -2,7 +2,7 @@ /** * Stores a global shared value among the servers. */ -proc(_store_shared_value, @value, +proc _store_shared_value(@value) { @source = import('sharedata.source') @data = get_value('sharedata.data') if(!is_array(@data)){ @@ -11,13 +11,13 @@ proc(_store_shared_value, @value, @piece = array(timestamp: time(), source: @source, data: @value) array_push(@data, @piece) store_value('sharedata.data', @data) -) +} -proc(_bind_shared_value, @closure, +proc _bind_shared_value(@closure) { @binds = import('sharedata.binds') if(!is_array(@binds)){ @binds = array() } array_push(@binds, @closure) export('sharedata.binds', @binds) -) +} diff --git a/LocalPackages/creative-only/auto_include.ms b/LocalPackages/creative-only/auto_include.ms index 4b96a42..c4a236b 100644 --- a/LocalPackages/creative-only/auto_include.ms +++ b/LocalPackages/creative-only/auto_include.ms @@ -1,5 +1,5 @@ -proc(_ermagerd, @string, +proc _ermagerd(@string) { # Begin the transformations @string = reg_replace('(?i)oo?r?', 'er', @string) @string = reg_replace('a', 'er', @string) @@ -8,9 +8,9 @@ proc(_ermagerd, @string, @string = reg_replace('([^a-zA-Z])*?my', '$1ma', @string) @string = reg_replace('[\\.,;]', '', @string) #Pfft, who needs punctuation return(@string) -) +} -proc(_effecthelp, +proc _effecthelp() { _assertperm('effect'); msg(color(GOLD) . 'Usage:'); msg(color(YELLOW) . '/effect clear ' . color(GOLD) . '- Clear all potion effects.'); @@ -21,7 +21,7 @@ proc(_effecthelp, msg(color(GOLD) . ' - potion strength; 1, 2 etc.'); msg(color(GOLD) . ' - if true, hide particles'); return (null); -) +} // Check the cooldown time of a command. // @@ -32,7 +32,7 @@ proc(_effecthelp, // // returns: true if the cooldown is okay, or false if the timer is still // running. -proc(_checkCooldown, @commandName, @delay, +proc _checkCooldown(@commandName, @delay) { @varName = "cooldown." . @commandName . "." . player(); @cooldownTime = import(@varName); @currentTime = time(); @@ -41,5 +41,5 @@ proc(_checkCooldown, @commandName, @delay, } export(@varName, @currentTime + @delay); return(true); -) +} diff --git a/LocalPackages/creative-only/suppress_death_messages.ms b/LocalPackages/creative-only/suppress_death_messages.ms index 78679bd..d091913 100644 --- a/LocalPackages/creative-only/suppress_death_messages.ms +++ b/LocalPackages/creative-only/suppress_death_messages.ms @@ -1,5 +1,5 @@ -bind(player_death, null, null, @e, +bind('player_death', null, null, @e, if(get_value('supress_death_messages')){ console('Death message suppressed: ' . @e['death_message']) modify_event('death_message', null) diff --git a/LocalPackages/games/koth.ms b/LocalPackages/games/koth.ms index 5096d6d..a6bef07 100644 --- a/LocalPackages/games/koth.ms +++ b/LocalPackages/games/koth.ms @@ -3,7 +3,7 @@ # Return the team ID (0 - 15) of the current King of the Hill - the team who has # placed their block in the scoring location. Return -1 if nobody holds that block. -proc(_koth_king, +proc _koth_king() { @location = get_value('koth.location') if (!is_null(@location)) { @block = get_block_at(@location) @@ -15,7 +15,7 @@ proc(_koth_king, } } return (-1) -) +} # _koth_score_get() @@ -23,14 +23,14 @@ proc(_koth_king, # Get the array of scores, which are the number of seconds that each team (0 - 15) # has held the scoring block. -proc(_koth_score_get, +proc _koth_score_get() { @times = get_value('koth.times') if (is_null(@times)) { @times = array() array_resize(@times, 16, 0) } return (@times) -) +} # _koth_score_clear() @@ -38,19 +38,19 @@ proc(_koth_score_get, # Reset the accumulated time (score) for all teams to 0. # Return the initialised times array. -proc(_koth_score_clear, +proc _koth_score_clear() { @times = array() array_resize(@times, 16, 0) store_value('koth.times', @times) return (@times) -) +} # _koth_score_show() # # Show the current score. -proc(_koth_score_show, +proc _koth_score_show() { # The chat color corresponding to a particular team ID (wool data value) from 0 - 15. @COLOR = array( color(WHITE), color(GOLD), color(LIGHT_PURPLE), color(BLUE), @@ -75,7 +75,7 @@ proc(_koth_score_show, } ) msg(@message) -) +} # _koth_reset() @@ -83,7 +83,7 @@ proc(_koth_score_show, # Clear the accumulated scores. # If a team block (wool) is at the scoring location, set that block to air. -proc(_koth_reset, +proc _koth_reset() { _koth_score_clear() @team = _koth_king() if (@team >= 0) { @@ -91,19 +91,19 @@ proc(_koth_reset, @location = get_value('koth.location') set_block_at(@location, 0) } -) +} # _koth_stop() # # Stop the scorekeeping task. -proc(_koth_stop, +proc _koth_stop() { @task = get_value('koth.task') if (! is_null(@task)) { clear_task(@task) } -) +} # _koth_start() @@ -112,7 +112,7 @@ proc(_koth_stop, # the 'koth.block' location. Add to the score of whichever team has their # wool colour there. -proc(_koth_start, +proc _koth_start() { # Period between checks in seconds. @CHECK_PERIOD = 1 @@ -126,4 +126,4 @@ proc(_koth_start, } )) store_value('koth.task', @task) -) +} diff --git a/LocalPackages/global/EasySigns/auto_include.ms b/LocalPackages/global/EasySigns/auto_include.ms index dfb9216..483e89d 100644 --- a/LocalPackages/global/EasySigns/auto_include.ms +++ b/LocalPackages/global/EasySigns/auto_include.ms @@ -6,7 +6,7 @@ # if the arguments could not be parsed. # @args can be an array slice created with @args[cslice(first, last)]. -proc(_parse_location, @args, +proc _parse_location(@args) { if (array_size(@args) != 3 && array_size(@args) != 4) { return ('The location must be of the form [] .') } @@ -29,16 +29,16 @@ proc(_parse_location, @args, } return (array(@args[@start], @args[@start+1], @args[@start+2], @world)) -) +} /** * Changes the location array's new format into the old, expected format. */ -proc(_easy_sign_loc_conv, @location, +proc _easy_sign_loc_conv(@location) { @array = array() @array[] = integer(@location['x']) @array[] = integer(@location['y']) @array[] = integer(@location['z']) @array[] = @location['world'] return(@array) -) +} diff --git a/LocalPackages/global/EasySigns/main.ms b/LocalPackages/global/EasySigns/main.ms index 5f4e1bc..574f854 100644 --- a/LocalPackages/global/EasySigns/main.ms +++ b/LocalPackages/global/EasySigns/main.ms @@ -1,6 +1,6 @@ export('easysign.signs', get_value('easysign.signs')) -bind(player_interact, null, null, @e, +bind('player_interact', null, null, @e, if(array_index_exists(@e, 'location') && is_sign_at(@e['location'])){ @signdata = import('easysign.signs') # Have to refactor the new format to the old format. @@ -254,7 +254,7 @@ bind(player_interact, null, null, @e, } ) ,'cart', - spawn_entity(MINECART, 1, @data['location']) + spawn_entity('MINECART', 1, @data['location']) ,'launch', set_pvelocity(@data['x'], @data['y'], @data['z']) ,'randloc', diff --git a/LocalPackages/global/FirstJoin/main.ms b/LocalPackages/global/FirstJoin/main.ms index dc1b005..bbded5e 100644 --- a/LocalPackages/global/FirstJoin/main.ms +++ b/LocalPackages/global/FirstJoin/main.ms @@ -1,5 +1,5 @@ -bind(player_join, null, null, @event, +bind('player_join', null, null, @event, if(@event['first_login']){ #to add more books to firstjoin, just enter "clear_value('cooldowns.book.'.player())" on line preceding your "run_cmd('/book ___')" line run_cmd('/rulebook') diff --git a/LocalPackages/global/UUID/auto_include.ms b/LocalPackages/global/UUID/auto_include.ms index 5e7d28b..baf3a53 100644 --- a/LocalPackages/global/UUID/auto_include.ms +++ b/LocalPackages/global/UUID/auto_include.ms @@ -2,7 +2,7 @@ /** * Retrieves the player's uuid from the database, or null if no player is known with that username */ -proc(_get_puuid, @playerName) { +proc _get_puuid(@playerName) { @playerName = to_lower(strip_colors(@playerName)); if (ponline(@playerName)) { @@ -34,7 +34,7 @@ proc(_get_puuid, @playerName) { * Gets the last known username from the database, or null, if no player is known with that UUID. * Hyphens are automatically stripped from the UUID to match the database contents. */ -proc(_get_username_from_uuid, @uuid) { +proc _get_username_from_uuid(@uuid) { @nameCache = import('nameCache'); @uuid = replace(@uuid, '-', ''); @@ -55,7 +55,7 @@ proc(_get_username_from_uuid, @uuid) { /** * Gets the last known display name from the database, or null, if no player is known with that uuid */ -proc(_get_display_name_from_uuid, @uuid){ +proc _get_display_name_from_uuid(@uuid){ @res = query('uuid', 'SELECT last_display_name FROM user WHERE uuid=?', @uuid); if(length(@res) == 0){ return(null); diff --git a/LocalPackages/global/UUID/main.ms b/LocalPackages/global/UUID/main.ms index 6fc88bf..ecde232 100644 --- a/LocalPackages/global/UUID/main.ms +++ b/LocalPackages/global/UUID/main.ms @@ -5,7 +5,7 @@ export('nameCache', array()) /** * Player login event to log the uuid and latest name */ -bind(player_login, null, null, @event, +bind('player_login', null, null, @event, x_new_thread('uuid_player_join', closure(){ // Sleep, so they are fully joined before we get their id. sleep(1); diff --git a/LocalPackages/global/misc/NoSpace.ms b/LocalPackages/global/misc/NoSpace.ms index 96502da..92a1c8d 100644 --- a/LocalPackages/global/misc/NoSpace.ms +++ b/LocalPackages/global/misc/NoSpace.ms @@ -3,7 +3,7 @@ * in names cause many issues, so our solution is to just ban * the users at the git-go. */ -bind(player_login, null, null, @event){ +bind('player_login', null, null, @event){ if(reg_count('.*[ ]+.*', @event['player'])){ modify_event('result', 'KICK_BANNED'); modify_event('kickmsg', 'Unfortunately, usernames with spaces in them are not allowed on our servers.'); diff --git a/LocalPackages/home/warp.ms b/LocalPackages/home/warp.ms index 616e39a..767d014 100644 --- a/LocalPackages/home/warp.ms +++ b/LocalPackages/home/warp.ms @@ -65,7 +65,7 @@ if (_config_get('features.warp.enabled', true)) { @color = 'white'; if (@count % 2 == 0) { - @color = gray; + @color = 'gray'; } @count++; diff --git a/LocalPackages/inv/auto_include.ms b/LocalPackages/inv/auto_include.ms index 9dce47e..62b9f0b 100644 --- a/LocalPackages/inv/auto_include.ms +++ b/LocalPackages/inv/auto_include.ms @@ -4,7 +4,7 @@ # If successful, return an array(@itemid, @metadata, @quantity), all entries numeric. # Otherwise, return null. -proc(_parseiargs, @input, +proc _parseiargs(@input) { @m = reg_match('^([^ :]+)(:[0-9]+)?( [0-9]+)?$', @input) if (array_index_exists(@m,0)) { # CH docs tell lies. @itemid can be a string, e.g. '35:15' for 'blackwool'. @@ -37,4 +37,4 @@ proc(_parseiargs, @input, } else { return (null) } -) +} diff --git a/LocalPackages/mail/auto_include.ms b/LocalPackages/mail/auto_include.ms index 35ee287..f69825e 100644 --- a/LocalPackages/mail/auto_include.ms +++ b/LocalPackages/mail/auto_include.ms @@ -44,7 +44,7 @@ include('send.ms') include('senditem.ms') # Proc that will initialize multiline mail composition -proc(_init_mail_chat, @recipient, +proc _init_mail_chat(@recipient) { @mail_messages = import('mail.mail_messages') @recipients = import('mail.recipients') @@ -61,7 +61,7 @@ proc(_init_mail_chat, @recipient, # If there aren't, go ahead and bind everything. # Event for accumulating chat messages to be sent back to the user upon completion of their mail message - bind(player_chat, 'mail-hold-back-chat', null, @event, + bind('player_chat', 'mail-hold-back-chat', null, @event, @mail_messages = import('mail.mail_messages') @@ -74,9 +74,9 @@ proc(_init_mail_chat, @recipient, , # else # If they aren't, first make sure that their chat doesn't go to the people composing mail. foreach(array_keys(@mail_messages), @player, - foreach(@event[recipients], @i, - if(array_contains_ic(@event[recipients][@i], @player), - array_remove(@event[recipients], @i) + foreach(@event['recipients'], @i, + if(array_contains_ic(@event['recipients'][@i], @player), + array_remove(@event['recipients'], @i) ) ) ) @@ -84,7 +84,7 @@ proc(_init_mail_chat, @recipient, # Then, add their chat to each mail-composing player's hold queue. @held_back_chat = import('mail.held_back_chat') # The pinfo(4) here is to make sure the player's display name is used (instead of just player()) as it appears in the chat. - assign(@message, concat('<', pinfo(4), '> ', @event[message])) + assign(@message, concat('<', pinfo(4), '> ', @event['message'])) foreach(array_keys(@mail_messages), @player, assign(@held_back_chat[@player], @message) @@ -96,7 +96,7 @@ proc(_init_mail_chat, @recipient, ) # Event for composing multi-line mail messages - bind(player_chat, 'mail-compose', null, @event, + bind('player_chat', 'mail-compose', null, @event, @mail_messages = import('mail.mail_messages') @recipients = import('mail.recipients') @@ -110,9 +110,9 @@ proc(_init_mail_chat, @recipient, , # else # If they are, see what they typed. # But first, make sure their chat message doesn't actually end up being a chat message. :P - assign(@event[recipients], null) + assign(@event['recipients'], null) - switch(@event[message], + switch(@event['message'], '-send', # If they typed -send, send off the message! _send_mail(player(), @recipients[to_lower(player())], @mail_messages[to_lower(player())], 'multiline-mail') @@ -135,20 +135,20 @@ proc(_init_mail_chat, @recipient, # Firstly, though, is there actually a mail message there yet? if(not(@mail_messages[to_lower(player())]), # If not, simply set the mail message to the chat message. - assign(@mail_messages[to_lower(player())], @event[message]) + assign(@mail_messages[to_lower(player())], @event['message']) , # else # Otherwise, append to the mail message instead. - assign(@mail_messages[to_lower(player())], concat(@mail_messages[to_lower(player())], '\n', @event[message])) + assign(@mail_messages[to_lower(player())], concat(@mail_messages[to_lower(player())], '\n', @event['message'])) ) export('mail.mail_messages', @mail_messages) # Then, we give them back what they typed in the chat, for readability and mental organization. - msg(color(7), @event[message]) + msg(color(7), @event['message']) # ) ) ) ) -) +} diff --git a/LocalPackages/mail/dispatch.ms b/LocalPackages/mail/dispatch.ms index f1671b3..fe5c25b 100644 --- a/LocalPackages/mail/dispatch.ms +++ b/LocalPackages/mail/dispatch.ms @@ -1,4 +1,4 @@ -proc(_mail_dispatch, @args, +proc _mail_dispatch(@args) { # Parse the incoming command, depending on it's first # word. @@ -85,7 +85,7 @@ proc(_mail_dispatch, @args, if(equals(length(@args), 2), # Push the special value "i1" onto the last arg if an amount wasn't specified. # This way we send the whole stack if the item is "hand", or send 1 item if it's a name. - array_push(@args, i1) + array_push(@args, 'i1') ) if(_send_item(@args[0], @args[1], @args[2]), @@ -191,4 +191,4 @@ proc(_mail_dispatch, @args, msg('- ', color(green), '/mail set [global]