Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: BR549 on January 29, 2015, 09:22:50 PM

Title: Phantom Lua Script running on load
Post by: BR549 on January 29, 2015, 09:22:50 PM
OK I created a small Lua script to send a file to the printer, Works fine.

NOW when every I load Mach4 it RUNS this script. I have moved the script out to the desktop but it still runs.

Any idea where MACH4 HID this script and WHY is it running on load ??

I have searched but cannot find it in mach4.

(;-) TP
Title: Re: Phantom Lua Script running on load
Post by: BR549 on January 29, 2015, 10:25:09 PM
OK I found the copy of the script BUT why is it RUNNING on mach4 load ??  DOes it run all scripts on load ????

(;- TP
Title: Re: Phantom Lua Script running on load
Post by: simpson36 on February 18, 2015, 08:25:43 AM
OK I found the copy of the script BUT why is it RUNNING on mach4 load ??  DOes it run all scripts on load ????

(;- TP

Note that is response is NOT from actual experience, but maybe worth parroting.

I recall reading somewhere that MACH4 compiles ALL available scripts into ONE master which it then runs on startup. If that is the case, then the question remains as to what would trigger a recompile (with your macro unavailable) which would theoretically make a new master sans your deleted script.

If nothing else, the 'master compiled script' process that I am recalling (from where I have no idea), would explain the script continuing to run after being removed from the folder.
Title: Re: Phantom Lua Script running on load
Post by: Chaoticone on February 18, 2015, 09:13:02 AM
Just another parrot.................. found this in my notes. Hopefully its useful to you.
Quote
> Lua: Error occurred while opening file cannot open
> C:\Mach4Hobby\Profiles\Mach4Mill\Macros\mcLua.mcc: No such file or
> directory
>
> I looked for this file in the install directory, and sub directories
> and could not find it.

This means that a script in your macro directory has an error.  The mcLus.mcc file is built from all of the *.mcs files.  It is like building a EXE.  .cpp files make .obj file.  Then all .obj files get linked in to make the .exe. So in the world of LUA, it takes all of the *.mcs files and compiles them into *.mcc files.  If all of that works without an error in one of the *.msc files, it links all of the *.mcc files into the one big chunk file that we call mcLua.mcc.
Title: Re: Phantom Lua Script running on load
Post by: simpson36 on February 18, 2015, 09:40:04 AM
Thanks!

This may be what I was remembering. It would appear then that deleting McLua.mcc would be the trigger to recompile another 'master'.

 . . . . on second thought . . .  renaming the file would be far safer . . .  ;)
Title: Re: Phantom Lua Script running on load
Post by: BR549 on February 18, 2015, 12:27:38 PM
Well I have learned working with Les at SheetCam that LUA scripts are all compiled ready to run on Mach4 load. IF the script does not have Functions() to act as a stop then the script will RUN  on compiling(opening Mach4).

Just a thought, (;-) TP
Title: Re: Phantom Lua Script running on load
Post by: poppabear on February 18, 2015, 01:41:11 PM
You can also do a key word search (something from in your script), in your .ini file, to see if you have any script in there.

Scott
Title: Re: Phantom Lua Script running on load
Post by: simpson36 on February 20, 2015, 07:27:56 PM
Posting here because I think it is related to this thread.

Getting this error. fresh install of 2214. How is this possible? Shouldn't MACH4 just recompile and make a new master?

(http://www.thecubestudio.com/CaptureLuaError.JPG)
Title: Re: Phantom Lua Script running on load
Post by: dude1 on February 20, 2015, 11:32:14 PM
 I had that once different version I just remove all .mcc file from the macro folder and it came right
Title: Re: Phantom Lua Script running on load
Post by: simpson36 on February 21, 2015, 05:57:29 AM
I did a fresh install of 2214 to a new folder (C:/Mach4/) and it is now running G-code.

The other install (C:/Mach4Hobby/) had been written over with new revs a couple of times and had a smoothstepper ESS installed at one point and also TCP Modbus. I removed the smoothstepper plug ins and disabled TCP Modbus, but nothing worked, so I did not know what the problem was.

It appears now that MachMAD is the culprit. The install created an other profile and McLua.mcc is no longer present in the original profile, but does exist in the new machMAD profile. Apparently there are some steps that I missed in the MAD install.
Title: Re: Phantom Lua Script running on load
Post by: simpson36 on February 21, 2015, 06:10:02 AM

OK, I was starting MACH4 from the normal desktop icon and not using the new MachMAD profile.