MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "batchcomplete": "",
    "continue": {
        "gapcontinue": "Ref",
        "continue": "gapcontinue||"
    },
    "warnings": {
        "main": {
            "*": "Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."
        },
        "revisions": {
            "*": "Because \"rvslots\" was not specified, a legacy format has been used for the output. This format is deprecated, and in the future the new format will always be used."
        }
    },
    "query": {
        "pages": {
            "9519": {
                "pageid": 9519,
                "ns": 0,
                "title": "ReMap",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "{{Useful_Function}}\nRe-maps a number from one range to another.\n\n==Syntax==\n<syntaxhighlight lang=\"lua\">int/float reMap(float value, float low1, float high1, float low2, float high2)</syntaxhighlight>\n\n===Required Arguments===\n* '''value''': The incoming value to be converted\n* '''low1''': Lower bound of the value's current range\n* '''high1''': Upper bound of the value's current range\n* '''low2''': Lower bound of the value's target range\n* '''high2''': Upper bound of the value's target range\n\n===Returns===\nReturns the re-mapped number.\n\n==Code==\n<syntaxhighlight lang=\"lua\">\nfunction reMap(value, low1, high1, low2, high2)\n    return low2 + (value - low1) * (high2 - low2) / (high1 - low1)\nend\n</syntaxhighlight>\n\n==Example==\n<section name=\"Clientside Example\" class=\"client\" show=\"true\">\n<syntaxhighlight lang=\"lua\" lang=\"lua\">\nlocal alpha = 127.5\nlocal opacity = reMap(alpha, 0, 255, 0, 1)\n\n-- And the \"opacity\" return 0.5 because 255/2 = 127.5 and 0 to 1 range is 0.5\n\n-- Reverse:\nlocal opacity = 0.5\nlocal alpha = reMap(opacity, 0, 1, 0, 255)\n\n-- And the \"alpha \" return 127.5 because 1/2 = 0.5 and 0 to 255 range is 127.5\n</syntaxhighlight>\n</section>\n\n==See Also==\n{{Useful_Functions}}"
                    }
                ]
            },
            "4269": {
                "pageid": 4269,
                "ns": 0,
                "title": "RedirectPlayer",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "__NOTOC__\n{{Server function}}\nThis function redirects the player to a specified server.\n{{Note|A resource using this function needs '''ACL rights''' in order to work (function.redirectPlayer)}}\n\n==Syntax==\n<syntaxhighlight lang=\"lua\">\nbool redirectPlayer ( player thePlayer, string serverIP = \"\", int serverPort = 0 [, string serverPassword = \"\" ] )\n</syntaxhighlight>\n{{OOP||[[player]]:redirect||}}\n===Required Arguments===\n*'''thePlayer:''' The player you want to redirect\n*'''serverIP:''' The IP address (or domain name that resolves to the IP address) of the server you want to redirect the player to. '''Use an empty string to reconnect to the same server.'''\n*'''serverPort:''' The game port of the server you want to redirect the player to, this is usually 22003. '''Set to zero to use the same port as the current server.'''\n\n===Optional Arguments===\n*'''serverPassword:''' The password for the server if it's protected\n\n===Returns===\nReturns ''true'' if the player was redirected successfully, ''false'' if bad arguments were passed.\n\n==Example==\n\nThis example auto-redirects all connecting players to another given servers' IP:port.\n<syntaxhighlight lang=\"lua\">\nlocal ip_port = \"123.123.1.2:1234\"\t-- enter IP and port in format: 192.168.1.1:22003\nlocal password = \"password_placeholder\" -- If the server is passworded insert password here (if no password, it wont use the value)\n\nfunction onConnectRedirect()\n\tredirectPlayer(source, gettok(ip_port,1,\":\"), tonumber(gettok(ip_port,2,\":\")), password)\nend\naddEventHandler (\"onPlayerJoin\", root, onConnectRedirect)\n</syntaxhighlight>\n\nThis example adds a \"joinserver\" command using the syntax, \"/joinserver serverIP serverPort [serverPassword]\".\n<syntaxhighlight lang=\"lua\">\nfunction joinserverHandlerFunction (playerSource, commandName, serverIP, serverPort, serverPassword)\n\tif serverIP and serverPort then --if IP and Port were specified\n\t\tif serverPassword then --if also a password was specified\n\t\t\tredirectPlayer (playerSource, serverIP, tonumber(serverPort), serverPassword) --redirect the player\n\t\telse -- else if no password was specified\n\t\t\tredirectPlayer (playerSource, serverIP, tonumber(serverPort))  --redirect the player without using the serverPassword parameter\n\t\tend\n\telse -- if no IP or Port have been specified\n\t\toutputChatBox (\"Error! Correct Syntax: /joinserver IP Port [Password]\", playerSource) --output an Error message to the chatbox\n\tend\nend\n\naddCommandHandler (\"joinserver\", joinserverHandlerFunction) \n</syntaxhighlight>\n\n{{New feature/item|3.0120|1.2|3429|\nThis example adds a \"rejoin\" command like the inbuilt reconnect command.\n<syntaxhighlight lang=\"lua\">\nfunction rejoinMe(thePlayer, theCommand)\n    redirectPlayer(thePlayer)\nend\naddCommandHandler(\"rejoin\", rejoinMe) -- Attach rejoin command to our function\n</syntaxhighlight>\n}}\n\n==See Also==\n{{Player_functions}}\n[[pt-br:RedirectPlayer]]"
                    }
                ]
            }
        }
    }
}