How to save Lua scripts?

For scripts to aid with computation or simulation in cellular automata.
Post Reply
User avatar
gameoflifemaniac
Posts: 1032
Joined: January 22nd, 2017, 11:17 am
Location: There too

How to save Lua scripts?

Post by gameoflifemaniac » March 8th, 2017, 12:28 pm

How to save text files as Lua scripts? For example, when I tried to save PHPBB12345's rotate 60 degrees script, I couldn't save it as a Lua file. What to do?
I was so socially awkward in the past and it will haunt me for my entire life.

User avatar
dvgrn
Moderator
Posts: 6725
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: How to save Lua scripts?

Post by dvgrn » March 8th, 2017, 12:37 pm

gameoflifemaniac wrote:How to save text files as Lua scripts? For example, when I tried to save PHPBB12345's rotate 60 degrees script, I couldn't save it as a Lua file. What to do?
My guess is you're you're using Windows, maybe on a machine where that awful default is set that hides file extensions? In that situation, even if you rename a file to "filename.lua", its true name ends up being "filename.lua.txt". In that case, the icon will keep looking like a text-file icon. Look for a way to see the true name of the file -- right-click/Properties maybe -- and then right-click again to rename it and change the file extension to ".lua".

If you're using something like Notepad to save the file, you might have to change the drop-down in the Save As dialog to "All Files", to keep it from appending ".txt" to your filename. Notepad is pretty awful that way; most other text editors are much more polite.

Workaround: just copy the script file text and use File > Run From Clipboard in Golly.

User avatar
gameoflifemaniac
Posts: 1032
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: How to save Lua scripts?

Post by gameoflifemaniac » October 1st, 2017, 11:33 am

dvgrn wrote:
gameoflifemaniac wrote:How to save text files as Lua scripts? For example, when I tried to save PHPBB12345's rotate 60 degrees script, I couldn't save it as a Lua file. What to do?
My guess is you're you're using Windows, maybe on a machine where that awful default is set that hides file extensions? In that situation, even if you rename a file to "filename.lua", its true name ends up being "filename.lua.txt". In that case, the icon will keep looking like a text-file icon. Look for a way to see the true name of the file -- right-click/Properties maybe -- and then right-click again to rename it and change the file extension to ".lua".

If you're using something like Notepad to save the file, you might have to change the drop-down in the Save As dialog to "All Files", to keep it from appending ".txt" to your filename. Notepad is pretty awful that way; most other text editors are much more polite.

Workaround: just copy the script file text and use File > Run From Clipboard in Golly.
But I can't change the extension!
I was so socially awkward in the past and it will haunt me for my entire life.

User avatar
dvgrn
Moderator
Posts: 6725
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: How to save Lua scripts?

Post by dvgrn » October 2nd, 2017, 8:50 am

dvgrn wrote:
gameoflifemaniac wrote:Workaround: just copy the script file text and use File > Run From Clipboard in Golly.
But I can't change the extension!
Please explain. Are you in fact using Windows? What is the name of the text editor you're using? And more important, what happens when you right-click on an already-saved text file using Windows Explorer, and choose "Rename"? You should be able to change the extension to whatever you want, though Windows will annoy you with a silly warning that "file may become unusable".

Also, my recommendation above doesn't involve file extensions anyway. Does File > Run From Clipboard work for you?

Post Reply