dofile 'luac.out' fails

Posted by Glorimus on Mon 17 Oct 2016 08:43 AM — 2 posts, 15,995 views.

#0
in mushclient --


/Debug("summary")

MUSHclient version: 4.94
Compiled: Jul 28 2014.
Time now: Monday, October 17, 2016, 1:28 AM
Client running for:  2d 02h 52m 23s
World opened for:    1d 02h 37m 21s
Operating system: Windows XP
Libraries: Lua 5.1.4, PCRE 8.35, PNG 1.5.14, SQLite3 3.8.4.3, Zlib 1.2.8


on mymachine

>more test.lua
Note("HI IM LUA")
>luac -v
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> luac test.lua
> luac -l luac.out
main <test.lua:0,0> (4 instructions, 16 bytes at 0x7fef98404230)
0+ params, 2 slots, 0 upvalues, 0 locals, 2 constants, 0 functions
	1	[1]	GETGLOBAL	0 -1	; Note
	2	[1]	LOADK    	1 -2	; "HI IM LUA"
	3	[1]	CALL     	0 2 1
	4	[1]	RETURN   	0 1


set lua script to luac.out

Immediate execution
Script file: bad header in precompiled chunk


>more test2.lua
dofile 'luac.out'


Immediate execution
c:/test/luac.out: bad header in precompiled chunk
stack traceback:
[C]: in function 'dofile'
[string "Script file"]:45: in main chunk


is there anyway i can get the mushclient to load my compiled script?
Australia Forum Administrator #1
When I tested that I got a different version of luac than you, available from:

http://www.gammon.com.au/files/mushclient/lua5.1_extras/luac5.1.zip


C:\Program Files\MUSHclient\temp>luac5.1.exe -v
Lua 5.1.3  Copyright (C) 1994-2008 Lua.org, PUC-Rio



When I tested with the output of that, it worked OK in MUSHclient.