Is there a Lua function to identify which computer I'm using?
getOs() is the closest I've found. It returns "mac" for both computers.
Use case: I have a 27" Mac and a 13" Macbook Air. I'd like my window layout scripts to check which computer (or maximum possible screen resolution?) they are working with and layout the window differently depending on that.
Long time lurker, first time poster. Love this client
Thanks!
Is there a Lua function to identify which computer I'm using?
Re: Is there a Lua function to identify which computer I'm using?
Taken and modified slightly from https://gist.github.com/h1k3r/089d43771bdf811eefe8 to assume instead that 'hostname' is in the path
On windows this will very briefly pop up a command window, but on MacOS it shouldn't do that.
That being said, you could skip over all that and just check Mudlet's window size using getMainWindowSize and adjust accordingly. Unless they're the same resolution, in which case yeah, go with the hostname option.
On windows this will very briefly pop up a command window, but on MacOS it shouldn't do that.
That being said, you could skip over all that and just check Mudlet's window size using getMainWindowSize and adjust accordingly. Unless they're the same resolution, in which case yeah, go with the hostname option.
Re: Is there a Lua function to identify which computer I'm using?
If that doesn't work how you want, you could always just make a tiny text file for each computer, and then read the contents.
Re: Is there a Lua function to identify which computer I'm using?
Brilliant thanks - this works perfectly!