I do not know Factorio's console yet, let me demonstrate

Things that has been reported already before.
User avatar
Taehl
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Sun Jan 18, 2015 2:23 am
Contact:

I do not know Factorio's console yet, let me demonstrate

Post by Taehl »

Since I have little idea on what and where data is in this game, first I wanted a print function so I could start inspecting what's in the tables. Following the example on the wiki ("/c game.local_player.print(1234 * 5678)"), I gave it:

Code: Select all

/c OLDprint = print ; print = game.local_player.print
/c print"Ah, much better."
Image
That code may look fishy at first glance, but it's syntactically correct Lua. I backup the old print function just in case, the semicolon is optional, I assign a shorter alias for that function, and called it. Lua syntax says print"blah", print("blah"), and print ( "blah" ) are all equivalent.
The aftermath
Also, PLEASE add item-filtering to the player's inventory. I'm always fighting with random wire and iron rods cluttering my toolbelt, it would be so much nicer to prevent that. :)
Rseding91
Factorio Staff
Factorio Staff
Posts: 15896
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: I do not know Factorio's console yet, let me demonstrate

Post by Rseding91 »

If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Duplicates”