Page 1 of 1

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

Posted: Tue Apr 12, 2016 5:18 am
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. :)

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

Posted: Tue Apr 12, 2016 6:41 am
by Rseding91