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": "Shell_stuff",
        "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": {
            "32": {
                "pageid": 32,
                "ns": 0,
                "title": "Roblox",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "I joined Roblox on January 27, 2009 and have occasionally made something with it. A lot of it was made when I was younger.\n\nI once had [https://www.roblox.com/games/7919515/My-History-The-Shortest-Obby-Ever a place] on the front page back in 2009.\n\n* [https://www.roblox.com/users/2090435/profile Profile]\n\n{{subpages}}"
                    }
                ]
            },
            "33": {
                "pageid": 33,
                "ns": 0,
                "title": "Roblox/Minecraft server link",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "I once created a very simple link between a Roblox and Minecraft Java game server. It only reported positions from the Minecraft world to Roblox. Later I made something that could return chunks from the Minecraft world and recreate it in Roblox but the code for that is buried somewhere. (Maybe it would be more efficient these days due to parallel Luau!)\n\nThe Minecraft side uses the [https://methodscript.com/ CommandHelper] plugin, which uses the MethodScript language.\n\nThis does NOT work on a live Roblox server since it expects there to be little to no latency (it doesn't deal with this well). And Roblox may not like the high volume of HTTP requests going out. It also does not filter Minecraft usernames, which would not work that well anyway.\n\n* [https://www.youtube.com/watch?v=9LZulfFOEvA Video on YouTube]\n* [https://gist.github.com/ihaveamac/489fe85276917a4ae7e364c4de3d25e9 Original gist]\n\n== CommandHelper main.ms ==\n<syntaxhighlight lang=\"text\">\n<!\n\tstrict;\n\tauthor: Ian Burgwin (ihaveahax)\n\tcreated: 2020-03-17\n\tdescription: Return player positions. (Eventually will handle Roblox player positions.)\n>\nhttpd_listen(29295) #-- 0x726F (ro)\n\nbind('http_request', null, null, @event) {\n\tmodify_event('code', 200);\n\thttpd_set_header('Content-Type', 'application/json');\n\n\tarray @positions = array();\n\n\tarray @smaller_ploc;\n\tarray @c; # current position\n\tforeach(all_players(), @player) {\n\t\t@c = location_shift(ploc(@player), 'UP', 1);\n\t\t@smaller_ploc = array('x': @c['x'], 'y': @c['y'], 'z': @c['z'], 'pitch': @c['pitch'], 'yaw': @c['yaw']);\n\t\t@positions[@player] = @smaller_ploc;\n\t}\n\n\tmodify_event('body', json_encode(@positions));\n}\n</syntaxhighlight>\n\n== Roblox object hierarchy ==\n* Workspace\n** MCCurrentPlayers (Folder)\n* ServerScriptService\n** MCServerLink (Folder)\n*** HttpHandler (Script)\n*** PlayerHandler (Script)\n* ServerStorage\n** MCServerLink (Folder)\n*** MakeRequest (BindableEvent)\n*** PlayerAdded (BindableEvent)\n*** PlayerMove (BindableEvent)\n*** PlayerRemoving (BindableEvent)\n*** Base (Model)\n\n=== ServerScriptService.MCServerLink.HttpHandler ===\nMakes a request to the server roughly every 1/6th of a second, making up to 360 requests per minute.\n<syntaxhighlight lang=\"lua\">\nlocal HttpService = game:GetService('HttpService')\nlocal ServerStorage = game:GetService('ServerStorage')\n\nlocal Storage = ServerStorage.MCServerLink\nlocal MakeRequest = Storage.MakeRequest\nlocal PlayerAdded = Storage.PlayerAdded\nlocal PlayerRemoving = Storage.PlayerRemoving\nlocal PlayerMove = Storage.PlayerMove\n\nlocal Url = 'http://localhost:29295'\n\n-- key is the username, value is always true\n-- this loses order, but is faster than an ordered table\nlocal CurrentPlayers = {}\n\nlocal function HandleMakeRequest()\n\tprint('Requesting...')\n\tlocal Positions = HttpService:JSONDecode(HttpService:GetAsync(Url))\n\tprint('Got data')\n\tfor Username, _ in pairs(CurrentPlayers) do\n\t\tif not Positions[Username] then\n\t\t\tprint('Player removed: '..Username)\n\t\t\tPlayerRemoving:Fire(Username)\n\t\tend\n\tend\n\t\n\tfor Username, PositionData in pairs(Positions) do\n\t\tlocal Position = Vector3.new(PositionData['x'], PositionData['y'], PositionData['z'])\n\t\tlocal Orientation = Vector3.new(0, PositionData['yaw'], -PositionData['pitch'])\n\t\tif not CurrentPlayers[Username] then\n\t\t\tprint('Player added: '..Username)\n\t\t\tPlayerAdded:Fire(Username, Position, Orientation)\n\t\t\tCurrentPlayers[Username] = true\n\t\telse\n\t\t\tprint('Player moved: '..Username)\n\t\t\tPlayerMove:Fire(Username, Position, Orientation)\n\t\tend\n\tend\nend\n\nMakeRequest.Event:Connect(HandleMakeRequest)\n\nprint('HttpHandler ready')\n\nwhile wait(1/6) do\n\tMakeRequest:Fire()\nend\n</syntaxhighlight>\n\n=== ServerScriptService.MCServerLink.PlayerHandler ===\n<syntaxhighlight lang=\"lua\">\nlocal HttpService = game:GetService('HttpService')\nlocal ServerStorage = game:GetService('ServerStorage')\nlocal TextService = game:GetService('TextService')\nlocal TweenService = game:GetService('TweenService')\n\nlocal Storage = ServerStorage.MCServerLink\nlocal PlayerAdded = Storage.PlayerAdded\nlocal PlayerRemoving = Storage.PlayerRemoving\nlocal PlayerMove = Storage.PlayerMove\nlocal BaseModel = Storage.Base\n\nlocal CurrentPlayersFolder = workspace.MCCurrentPlayers\n\nlocal TInfo = TweenInfo.new(1/6, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false)\n\nlocal function GetPlayerModel(Username)\n\tlocal Model = CurrentPlayersFolder:FindFirstChild(Username)\n\tif not Model then\n\t\tModel = BaseModel:Clone()\n\t\tModel.Name = Username\n\t\tModel.Head.NameGui.NameLabel.Text = Username\n\t\t-- not depending on the label here\n\t\tlocal TextSize = TextService:GetTextSize(Username, 100, Enum.Font.Gotham, Vector2.new(2000, 100))\n\t\tModel.Head.NameGui.Background.Size = UDim2.new((TextSize.X / 2000) + 0.01, 0, 1, 0)\n\t\tModel.Parent = CurrentPlayersFolder\n\tend\n\treturn Model\nend\n\nlocal function MovePlayer(Model, Position, Orientation)\n\tlocal CF = CFrame.Angles(0, -math.rad(Orientation.Y + 180), 0)\n\tCF = CF:ToWorldSpace(CFrame.new())\n\tlocal Goal = {['CFrame'] = CF + (Position * 4)}\n\tlocal Tween = TweenService:Create(Model.PrimaryPart, TInfo, Goal)\n\tTween:Play()\nend\n\nlocal function HandlePlayerChange(Username, Position, Orientation)\n\tlocal Model = GetPlayerModel(Username)\n\tMovePlayer(Model, Position, Orientation)\nend\n\nlocal function HandlePlayerRemove(Username)\n\tlocal Model = CurrentPlayersFolder:FindFirstChild(Username)\n\tif Model then\n\t\tModel:Destroy()\n\tend\nend\n\nPlayerAdded.Event:Connect(HandlePlayerChange)\nPlayerMove.Event:Connect(HandlePlayerChange)\nPlayerRemoving.Event:Connect(HandlePlayerRemove)\n</syntaxhighlight>"
                    }
                ]
            }
        }
    }
}