Author Topic: List of server commands  (Read 1822 times)

Hm, I thought that was broken, or am I thinking of something else?
If it is, yell at badspot for breaking it. It worked when I used it a long time ago.

finished it B)

source code: http://pastebin.com/YTgA2t62

an example of the results:
Results can be found in server_commands.json.
Time taken: 0.33742081299213555


contents of server_commands.json:

{
    "Bot_Hole": {
        "packages": {
            "AddEvent": [
                "%a",
                "%b",
                "%c",
                "%d",
                "%e",
                "%f",
                "%g",
                "%h",
                "%i",
                "%j",
                "%k",
                "%l",
                "%m",
                "%n",
                "%o",
                "%p",
                "%q",
                "%r",
                "%s",
                "%t",
                "%u",
                "%v",
                "%w",
                "%x",
                "%y",
                "%z"
            ],
            "ClearAllBricks": [
                "%client"
            ],
            "ClearBrickGroup": [
                "%client",
                "%id"
            ],
            "ClearBricks": [
                "%client"
            ],
            "CreateMiniGame": [
                "%client",
                "%name",
                "%a",
                "%b",
                "%c",
                "%d",
                "%e"
            ],
            "SetWrenchData": [
                "%client",
                "%info"
            ]
        },
        "server": {
            "BotCount": [
                "%client"
            ],
            "BotMiniGame": [
                "%client",
                "%damage",
                "%respawnTime",
                "%points"
            ],
            "CurrentHoleBotOff": [
                "%client"
            ],
            "CurrentHoleBotOn": [
                "%client"
            ],
            "MyBotCount": [
                "%client"
            ],
            "ResetAllBots": [
                "%client"
            ],
            "ResetBots": [
                "%client",
                "%user"
            ],
            "RespawnCurrentHoleBot": [
                "%client"
            ]
        },
        "support": {
            "DoBotIcon": [
                "%client",
                "%data"
            ]
        }
    },
    "Brick_Checkpoint": {
        "server": {
            "ClearCheckpoint": [
                "%client"
            ]
        }
    },
    "Brick_Teledoor": {
        "server": {
            "CancelBrick": [
                "%client"
            ]
        }
    },
    "Brick_Treasure_Chest": {
        "server": {
            "NextChest": [
                "%client",
                "%arg"
            ],
            "TreasureStatus": [
                "%client"
            ]
        }
    },
    "Emote_Alarm": {
        "Emote_Alarm": {
            "Alarm": [
                "%client"
            ]
        }
    },
    "Emote_Confusion": {
        "Emote_Confusion": {
            "Confusion": [
                "%client"
            ],
            "Wtf": [
                "%client"
            ]
        }
    },
    "Emote_Hate": {
        "Emote_Hate": {
            "Hate": [
                "%client"
            ]
        }
    },
    "Emote_Love": {
        "Emote_Love": {
            "Love": [
                "%client"
            ]
        }
    },
    "GameMode_Blockheads_Ruin_Xmas": {
        "support": {
            "Start": [
                "%client"
            ],
            "Self Delete": [
                "%client"
            ],
            "UseHammer": [
                "%client"
            ],
            "UsePrintGun": [
                "%client"
            ]
        }
    },
    "GameMode_Rampage": {
        "server": {
            "EndSaveFileUpload": [
                "%client",
                "%a",
                "%b",
                "%c"
            ],
            "Self Delete": [
                "%client"
            ]
        }
    },
    "GameMode_SpeedKart": {
        "server": {
            "NextTrack": [
                "%client",
                "%i"
            ],
            "SetTrack": [
                "%client",
                "%i"
            ],
            "Self Delete": [
                "%client"
            ],
            "TrackList": [
                "%client"
            ]
        }
    },
    "Item_Sports": {
        "football": {
            "FootballRecord": [
                "%client"
            ],
            "ResetFootballRecord": [
                "%client"
            ]
        },
        "support": {
            "InstantUseBrick": [
                "%client",
                "%brick"
            ],
            "SetMiniGameData": [
                "%client",
                "%info",
                "%test"
            ],
            "UnUseTool": [
                "%client"
            ],
            "UseInventory": [
                "%client",
                "%slot"
            ],
            "UseSprayCan": [
                "%client",
                "%id"
            ],
            "UseTool": [
                "%client",
                "%slot"
            ]
        }
    },
    "Script_AntiTroll": {
        "Support_IPBanning": {
            "BanIP": [
                "%client",
                "%IP"
            ],
            "CheckIP": [
                "%client",
                "%name"
            ],
            "IPBan": [
                "%client",
                "%name"
            ],
            "ListIPBans": [
                "%client"
            ],
            "UnBanIP": [
                "%client",
                "%IP"
            ],
            "UnIPBan": [
                "%client",
                "%IP"
            ],
            "changeIPBanMode": [
                "%client"
            ]
        },
        "server": {
            "Ban": [
                "%this",
                "%a",
                "%b",
                "%c",
                "%d",
                "%e"
            ],
            "FindBLIDIP": [
                "%this",
                "%bl_id"
            ],
            "Kick": [
                "%this",
                "%a",
                "%b",
                "%c"
            ],
            "ListAllDatablocks": [
                "%this"
            ],
            "LoadDup": [
                "%this",
                "%a"
            ],
            "Sad": [
                "%this",
                "%a"
            ],
            "SaveDup": [
                "%this",
                "%a"
            ],
            "StopTalking": [
                "%this"
            ]
        }
    },
    "Script_Player_Persistence": {
        "server": {
            "ChangeMap": [
                "%client",
                "%mapName"
            ]
        }
    },
    "Support_Garage": {
        "server": {
            "ColorPart": [
                "%c",
                "%a",
                "%r",
                "%g",
                "%b"
            ],
            "CustomHelp": [
                "%c"
            ],
            "DefaultParts": [
                "%c"
            ],
            "Garage": [
                "%c"
            ],
            "Garage_ClientEdit": [
                "%c",
                "%w"
            ],
            "Garage_GetPartList": [
                "%c"
            ],
            "Garage_SaveParts": [
                "%c"
            ],
            "Garage_ToggleMessages": [
                "%c",
                "%a"
            ],
            "LoadParts": [
                "%c"
            ],
            "PaintPart": [
                "%c",
                "%a",
                "%r",
                "%g",
                "%b"
            ],
            "SaveParts": [
                "%c"
            ],
            "SetPart": [
                "%c",
                "%a",
                "%b"
            ],
            "getParts": [
                "%c"
            ]
        }
    },
    "Support_LegacyDoors": {
        "conversion": {
            "PlantBrick": [
                "%client"
            ]
        }
    },
    "System_ReturnToBlockland": {
        "modules/server/guiTransfer": {
            "MissionPreparePhase1Ack": [
                "%client",
                "%skip"
            ],
            "MissionPreparePhase2Ack": [
                "%client",
                "%skip"
            ]
        },
        "modules/server/serverControl": {
            "RTB_addAutoStatus": [
                "%client",
                "%bl_id",
                "%status"
            ],
            "RTB_adminPlayer": [
                "%client",
                "%victim"
            ],
            "RTB_clearAutoAdminList": [
                "%client"
            ],
            "RTB_clearBans": [
                "%client"
            ],
            "RTB_deAdminPlayer": [
                "%client",
                "%victim"
            ],
            "RTB_defaultServerPrefs": [
                "%client"
            ],
            "RTB_getAutoAdminList": [
                "%client"
            ],
            "RTB_getServerOptions": [
                "%client"
            ],
            "RTB_removeAutoStatus": [
                "%client",
                "%bl_id"
            ],
            "RTB_setServerOptions": [
                "%client",
                "%notify",
                "%options",
                "%v1",
                "%v2",
                "%v3",
                "%v4",
                "%v5",
                "%v6",
                "%v7",
                "%v8",
                "%v9",
                "%v10",
                "%v11",
                "%v12",
                "%v13",
                "%v14",
                "%v15",
                "%v16"
            ],
            "RTB_setServerPrefs": [
                "%client",
                "%prefs",
                "%var0",
                "%var1",
                "%var2",
                "%var3",
                "%var4",
                "%var5",
                "%var6",
                "%var7",
                "%var8",
                "%var9",
                "%var10",
                "%var11",
                "%var12",
                "%var13",
                "%var14",
                "%var",
                "%var15"
            ],
            "RTB_superAdminPlayer": [
                "%client",
                "%victim"
            ],
            "SAD": [
                "%client",
                "%pass"
            ]
        }
    }
}


all of that in 0.3 seconds! nice

like the name of the file suggests, it's output as JSON, so you'll have to use Port's Jettison thing
...or ask me to let it output in a different format. I guess you could do it yourself, if you know how. but I'd be willing to do it
it's pretty much up to you where to put the output. changing the place that it sticks the file is relatively simple, just change
serv_cmd_json = open('server_commands.json', 'w+')
(which can be found near the bottom) to
serv_cmd_json = open('directory/to/put/it/in/server_commands.json', 'w+')

the JSON is formatted like so:
{
  "Addon_Name": {
    "scriptFileName": {
      "commandName": [
        "%argument"
      ]
    }
  }
}



how to use it
first of all, make sure Python 3 is installed, and file extensions are registered with it
then save the code in your blockland directory, with whatever file name you want as long as it ends in ".py", and double-click it. done!
it'll make a file in the same directory, named server_commands.json, with all the stuff it found

for people who care: it'll also work directly in your Add-Ons folder. that feature is actually intended for testing, so that I could use it in a folder separate from my blockland folder
it still works, though

if you have any questions, pls ask

Having to install something to run a program = :|

you can run dumpconsolefunctions(); and then just control+f for functions that start with servercmd

thank you so much, even though this will be the only reason I have Python installed on my computer..

could you output everything without the arguments? I don't really see a need for them when I only want to know command names and the add-ons they belong to

you can run dumpconsolefunctions(); and then just control+f for functions that start with servercmd
I did something like that before, yet foxscotch's solution lists commands under the add-on they belong to, which is very helpful when I have no idea what a command is for

Note that many commands are not supposed to be called manually, though

Note that many commands are not supposed to be called manually, though
I really just want this for those pesky script/server add-ons with command names that I'll probably recognize after seeing the add-on they belong to

Also it won't include commands default to the game

could you output everything without the arguments? I don't really see a need for them when I only want to know command names and the add-ons they belong to
well, that's uh, not really for looking at. it's for another program to use
but I guess I can make it output in a human-readable format

as for elm's complaint



it is a pretty big file, but that's because py2exe includes everything that your program needs
I could try to make it in C, but I've never done anything like this with that, and it's not really worth the trouble for 10mb...

the issue is that, to my knowledge, you're not supposed to post executables on the forum

edit: finished what mikkel wanted

output example:

Bot_Hole
    DoBotIcon
    BotCount
    BotMiniGame
    CurrentHoleBotOff
    CurrentHoleBotOn
    MyBotCount
    ResetAllBots
    ResetBots
    RespawnCurrentHoleBot
    AddEvent
    ClearAllBricks
    ClearBrickGroup
    ClearBricks
    CreateMiniGame
    SetWrenchData

Brick_Checkpoint
    ClearCheckpoint

Brick_Teledoor
    CancelBrick

Brick_Treasure_Chest
    NextChest
    TreasureStatus

Emote_Alarm
    Alarm

Emote_Confusion
    Confusion
    Wtf

Emote_Hate
    Hate

Emote_Love
    Love

GameMode_Blockheads_Ruin_Xmas
    Start
    Self Delete
    UseHammer
    UsePrintGun

GameMode_Rampage
    EndSaveFileUpload
    Self Delete

GameMode_SpeedKart
    NextTrack
    SetTrack
    Self Delete
    TrackList

Item_Sports
    InstantUseBrick
    SetMiniGameData
    UnUseTool
    UseInventory
    UseSprayCan
    UseTool
    FootballRecord
    ResetFootballRecord

Script_AntiTroll
    BanIP
    CheckIP
    IPBan
    ListIPBans
    UnBanIP
    UnIPBan
    changeIPBanMode
    Ban
    FindBLIDIP
    Kick
    ListAllDatablocks
    LoadDup
    Sad
    SaveDup
    StopTalking

Script_Player_Persistence
    ChangeMap

Support_Garage
    ColorPart
    CustomHelp
    DefaultParts
    Garage
    Garage_ClientEdit
    Garage_GetPartList
    Garage_SaveParts
    Garage_ToggleMessages
    LoadParts
    PaintPart
    SaveParts
    SetPart
    getParts

Support_LegacyDoors
    PlantBrick

System_ReturnToBlockland
    MissionPreparePhase1Ack
    MissionPreparePhase2Ack
    RTB_addAutoStatus
    RTB_adminPlayer
    RTB_clearAutoAdminList
    RTB_clearBans
    RTB_deAdminPlayer
    RTB_defaultServerPrefs
    RTB_getAutoAdminList
    RTB_getServerOptions
    RTB_removeAutoStatus
    RTB_setServerOptions
    RTB_setServerPrefs
    RTB_superAdminPlayer
    SAD


http://pastebin.com/tzgEA5DK

if you want to change it back to outputting JSON, change "plain" in output_type = 'plain' to "json"
« Last Edit: October 22, 2015, 03:16:46 PM by Foxscotch »

well, that's uh, not really for looking at. it's for another program to use
but I guess I can make it output in a human-readable format

as for elm's complaint



it is a pretty big file, but that's because py2exe includes everything that your program needs
I could try to make it in C, but I've never done anything like this with that, and it's not really worth the trouble for 10mb...

the issue is that, to my knowledge, you're not supposed to post executables on the forum

...

edit: finished what mikkel wanted

thank you
however, py2exe does not work with 3.x versions of Python, what would I use instead if I want to make an executable?

however, py2exe does not work with 3.x versions of Python, what would I use instead if I want to make an executable?
yeah it does, just not the stuff that the website links to (why? idk. old people are hard to decipher)
you have to get it from the python package index
the easiest way to install a module that's on the package index is with pip
so, with a default install of python, you'd only need to type this into a command prompt:
pip install py2exe

except, you see, it doesn't totally work with python 3.5.0 at the moment. 3.4.3? no problem. but I suppose there aren't any binaries compiled against cpython 3.5 (p.s. cpython is not a typo) yet, so until someone deals with that you'd need to use python 3.4 instead. the code I've written is compatible with both (evidenced by the fact that I successfully made an exe for it, meaning I had to use 3.4)

however!! the need to create an exe is mostly something that I alone would have to worry about. it just makes it easier to distribute the program
if you've already installed python, you should just keep doing it the way you have been. it'll be marginally faster that way, anyway. very, very marginally. but the bigger advantage is that it means you'll have python installed, and python is amazing. then if you ever come across something neat, written in python, you'll be ready to go!
« Last Edit: October 22, 2015, 10:17:30 PM by Foxscotch »

yeah it does, just not the stuff that the website links to (why? idk. old people are hard to decipher)
you have to get it from the python package index
the easiest way to install a module that's on the package index is with pip
so, with a default install of python, you'd only need to type this into a command prompt:
pip install py2exe

except, you see, it doesn't totally work with python 3.5.0 at the moment. 3.4.3? no problem. but I suppose there aren't any binaries compiled against cpython 3.5 (p.s. cypthon is not a typo) yet, so until someone deals with that you'd need to use python 3.4 instead. the code I've written is compatible with both (evidenced by the fact that I successfully made an exe for it, meaning I had to use 3.4)

however!! the need to create an exe is mostly something that I alone would have to worry about. it just makes it easier to distribute the program
if you've already installed python, you should just keep doing it the way you have been. it'll be marginally faster that way, anyway. very, very marginally. but the bigger advantage is that it means you'll have python installed, and python is amazing. then if you ever come across something neat, written in python, you'll be ready to go!

okay then python it is