barra733 Posted March 15, 2011 Posted March 15, 2011 (edited) A few months ago I messed about with the options lua's and the multi monitor set up to get BS running with a 10" touchscreen and a variant of TouchBuddy - TouchPal. It works but I get the message below everytime I load up BS. I'm running Vista 32 bit, BS 1.0.2. I click on ok and it goes away and the game runs fine but I would like to get rid of it. Any ideas what's causing this and if there's a soloution? Error: .\blackshark\modules\me_traceback.lua:110: bad argument #1 to 'member' (string expected, got no value) Stack traceback: ->stack: .\blackshark\modules\i18n.lua in line 213 in func: _ ->stack: ..\blackshark\modules\me_options.lua in line 194 in func: getMonitorProfiles ->stack: ..\blackshark\modules\me_options.lua in line 268 in func: ->stack: .\BlackShark\BlackShark.lua in line 234 in func: the following lines are from the lua's mentioned above: 213: local msg = gettext.translate(key) 194 dispName = _(env.name), 268: defaults.graphics.multiMonitorSetup.values = getMonitorProfiles(); 234: panel_options.loadOptions() The following is the whole of the me_traceback.lua: local base = _G module('me_traceback') --local winman = base.require('winman') local Modules = {} local Modules_By_Name = {}; interceptNames = {}; old_require = base.require; old_pairs = base.pairs; function stack() local t = ''; counter = 2; info = base.debug.getinfo(counter) while info do if (info.currentline ~= -1) and (not base.string.find(info.short_src, 'me_traceback')) then local fun = info.name or ''; local str = ' ->stack: ' .. info.short_src .. ' in line ' .. info.currentline .. ' in func: ' .. fun; base.print(str); t = t .. '\n' .. str; end; counter = counter + 1; info = base.debug.getinfo(counter) end; return t; end; function new_require(moduleName) if Modules_By_Name[moduleName] then -- ÷òî-òî óæå çàïèñàíî local empty = Modules_By_Name[moduleName]; --base.print('empty',empty); local module = base.rawget(empty, '__MODULE__') if not module then --base.U.stack(); module = base.package.loaded[moduleName]; --base.print('\t###cycling creating ', moduleName, module, empty); if base.type(module) == 'table' then base.rawset(empty, '__MODULE__', module); base.rawset(empty, '_NAME', module._NAME); base.rawset(empty, '_M', module._M); base.rawset(empty, '_PACKAGE', module._PACKAGE); base[moduleName] = empty; base.package.loaded[moduleName] = empty; Modules[empty] = module; else return module; end; end; --base.print('returning existing ', moduleName, 'real', module, 'empty', empty); return empty end; --base.print('new_require', moduleName); local empty = { __BLACKSHARK__ = true, __LOADED__ = false, }; local mtab = { __index = index, __newindex = newindex, }; base.setmetatable(empty, mtab); Modules_By_Name[moduleName] = empty; local module = old_require(moduleName); if 'table' == base.type(module) then if base.rawget(module,'__BLACKSHARK__') then return module; end; else return module; end; if not base.rawget(Modules_By_Name[moduleName], '__MODULE__') then --base.print('\tordinary creating ', moduleName); base.rawset(empty, '__MODULE__', module); base.rawset(empty, '_NAME', module._NAME); base.rawset(empty, '_M', module._M); base.rawset(empty, '_PACKAGE', module._PACKAGE); base[moduleName] = empty; base.package.loaded[moduleName] = empty; Modules[empty] = module; end; --base.print('<-new require: ' .. moduleName .. ' real:', module, 'empty:', empty ) return empty; end; function index(tbl, key) local h; --base.print('INDEX ', key); local module = Modules[tbl]; --local member = base.rawget(module, key); local member = module[key]; local safeCall = function (...) local arguments = {...} local err = function (errObj) local str = 'Error:\n' .. base.tostring(errObj) .. '\nStack traceback:\n'; base.print(str); local t = stack(); base.Gui.MessageBox(str .. t, 'Error'); return errObj; end; local fun = function () --base.print('fun---------------', key) return member(base.unpack(arguments)) end; local result = {base.xpcall(fun,err)}; if result[1] then base.table.remove(result, 1); --base.print('safeCall', base.unpack(result)); return base.unpack(result); end; return nil, result[2] end; local res; if 'function' == base.type(member) then res = safeCall; else res = member; end; processInterceptors(key, res); return res; end; function newindex(tbl, key, value) --base.print('NEWINDEX ' .. key); processInterceptors(key, value) local module = Modules[tbl]; return base.rawset(module, key, value); end; function new_pairs(t) if t and t.__BLACKSHARK__ then --base.print('blackshark pairs') return old_pairs(Modules[t]); else --base.print('old pairs pairs') --base.debug.debug() return old_pairs(t); end; end; function pushInterceptor(fieldName) interceptNames[fieldName] = true; end; function popInterceptor(fieldName) interceptNames[fieldName] = nil; end; function processInterceptors(fieldName, val) for field, tmp in old_pairs(interceptNames) do if field == fieldName then base.print('intercepted call to',fieldName, val); base.U.stack(); end; end; end; base.require = new_require; base.pairs = new_pairs; Help is very gratefully accepted, thanks. Edited March 15, 2011 by barra733 Forgot OS details
Recommended Posts