Forum

> > CS2D > Scripts > [Fix] HC Admin Script
Forums overviewCS2D overview Scripts overviewLog in to reply

English [Fix] HC Admin Script

21 replies
Page
To the start Previous 1 2 Next To the start

old [Fix] HC Admin Script

Starkkz
Moderator Off Offline

Quote
Hello, a lot of people has been complaining about errors on HC Admin Script since CS2D was updated, I modified a file and I'm getting no errors after that. I'd like to share that with you, and see if there's more to fix or not.

sys/lua/hc/core/main.lua
http://pastebin.com/7AM97661

old Re: [Fix] HC Admin Script

Starkkz
Moderator Off Offline

Quote
@user The Gajos: There's no big difference, somehow the functions weren't accepting arg as a value that is set as default on functions. So I modified unpack(arg) to ... The script should work with that anyway.
edited 2×, last 22.06.15 03:46:01 pm

old Re: [Fix] HC Admin Script

Ajmin
User Off Offline

Quote
Actually whats happening?

How can be sure that any other scripts are not enquering the same problem?
edited 1×, last 22.06.15 03:51:36 pm

old Re: [Fix] HC Admin Script

Starkkz
Moderator Off Offline

Quote
@user Ajmin:
LuaJIT FAQ has written
Q: Why do I get this error: "attempt to index global 'arg' (a nil value)"?
Q: My vararg functions fail after switching to LuaJIT!
LuaJIT is compatible to the Lua 5.1 language standard. It doesn't support the implicit arg parameter for old-style vararg functions from Lua 5.0.
Please convert your code to the Lua 5.1 vararg syntax.

Mike disabled 'arg', but '...' is still compatible.

1
2
3
function f(...)
	local arg = {...} -- This would be the "quickest" replacement
end

old Re: [Fix] HC Admin Script

Starkkz
Moderator Off Offline

Quote
@user The Gajos: Lua 5.1 has arg built in, there's no need to define it in that case.
1
2
3
4
5
6
function f(...)
	print("arg = "..tostring(arg))
	for k, v in pairs(arg) do
		print("argument "..tostring(k).." = "..tostring(v))
	end
end

old Re: [Fix] HC Admin Script

GeoB99
Moderator Off Offline

Quote
@user Kirito2K: He said within this week. He'll post the hot-fix to cover all known bugs include those who prevent the scripts to work properly. I talked with him about that on IRC.
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview