Page 1 of 1

How to save Lua scripts?

Posted: March 8th, 2017, 12:28 pm
by gameoflifemaniac
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?

Re: How to save Lua scripts?

Posted: March 8th, 2017, 12:37 pm
by dvgrn
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.

Re: How to save Lua scripts?

Posted: October 1st, 2017, 11:33 am
by gameoflifemaniac
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!

Re: How to save Lua scripts?

Posted: October 2nd, 2017, 8:50 am
by dvgrn
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?