Don't Starve Together

Don't Starve Together

Console Pro
 This topic has been pinned, so it's probably important
star  [developer] 24 Feb, 2017 @ 8:51am
Commands
get(s)
Will find a player or an object with specified name.
get("wilson") - wilson object.
get("flint") - a flint in the world.
get("Pe") - a player with name "Peter".
get("fli") - a flint in the world.
Example:
x = get("Pe") print(x["name"]) --will print "Peter". y = get("portal") print(y.prefab) --will print "multiplayer_portal"

Aliases
me == "me" == means admin player who typed the command.
portal == "portal" == means multiplayer portal.

shutdown(message, sec) / reboot(message, sec)
Will shutdown the server in sec seconds. First, it shows the message message. Then it starts countdown timer. Example:
shutdown("Sorry guys, i have to go. Thank you all for playing on my server.", 60)
It will shutdown server in 60 seconds. And 60 is default even if you did not specify the number of seconds.

reboot() is same as above but periodic message is a little bit different. There is word "rebooted" instead of "shutdown". You should start the server manually. Example:
reboot("Some mods were updated, I have to reboot the server.") --by default 60 secs

r()
Reveal map. You should be an admin. Example:
r() --reveal whole map for current player. r("Peter") -- reveal whole map for Peter.

move(A,B) / moveto(A,B) / teleport(A,B)
Moves object B to object A. By default object B is current player. Example:
move("Peter") --moves me to player Peter. move("Peter", me) --same as above. move("flint") --moves me to nearest flint. move("flint", "rocks") --moves nearest rocks item to nearest flint. move("portal", "Peter") --moves Peter to multiplayer_portal.

pull(A)
Moves object A to current player. Example:
pull("flint")

speed(player, num) / speed(num)
Change player speed. Server reboot will drop the boost. Example:
speed(3) --Makes my run speed 300%. speed(1) --Back to normal speed (100%). speed("Peter",2) --Makes speed x2 for player Peter. speed("pigman", 2) --Change speed of nearest pig man.

inv(1)
Makes the current player invincible. Example:
inv() --invincible inv(1) --invincible inv(0) --not invincible inv(true) --invincible inv(false) --not invincible inv("Peter",1) --makes Peter invincible inv("spider",1) --makes nearest spider invincible

kill(player, reason)
Will kill the player. reason is the prefab. Example:
kill("Peter") kill("spider") --kill nearest spider kill("Peter", "flint") --Will announce "killed by flint". kill(all) --Kill all prefabs in range 30

circle(prefab, center, radius, num)
prefab - the prefab name of spawning objects;
center - the object in the center of the circle;
radius - the radius of circle, default is 10;
num - the number of spawning objects, default is 10;
Example:
circle("flint", "Peter", 15, 20) circle("flint", 15, 20) circle("flint", "Peter") --default is 10/10 circle("log", 15) -- radius==15, num==10 circle("log") --10 logs around current player on radius 10

fe(prefab, range, coords)
"Find entity".
Default range is 50. So there will be empty result if no items in range 50 and if you doesn't spicify range.
Default coords are coords of current player. Or you can type exact coords, e.g. {100, 0, 150}. Y should be 0. Examples:
fe("flint") --Find a flint in range 50. fe("flint", 2000) --Find a flint on the server. fe("flint, nil, {0, 0, 0}) --Find a fline in range 50 near center of the world.

fe_nearest()
Will show ~15 nearest prefab names in server log.
On common servers with caves admin doesn't see the log but they can see the file "server_log.txt".
Also you can use local command fe_nearest() near prefab if you are not sure what is its name (items from mods, new bosses etc).

ca_all()
Calculate all prefabs. Will get info about all prefabs in the world and write it to "world.txt" in data folder.

scale(speed)
Scales server time. Works only for host (without caves). It's not recommendet for live servers. Examples:
scale(4) -- x4 speed of time. scale(1) -- Back to normal time. scale(0.1) --Very slow time. Each day will be an hour of real time.
Last edited by star; 11 May, 2017 @ 12:47am