Just tested. Two scripts. Left ("Test 2"): function test2Func() { sendChat('', 'test2.js'); } var test2Var = 'test2'; on('ready', function() { log('test2.js onReady begin'); try { log('calling test.js'); testFunc(); test2Var += testVar; } catch(e){} log('test2.js onReady end'); }); Right ("Test"): function testFunc() { sendChat('', 'test.js'); } var testVar = 'test'; on('ready', function() { log('test.js onReady begin'); try { log('calling test2.js'); test2Func(); testVar += test2Var; } catch(e) {} log('test.js onReady complete'); }); Log output: "test2.js onReady begin" "calling test.js" "test2.js onReady end" "test.js onReady begin" "calling test2.js" "test.js onReady complete" Chat output:
test.js
test2.js
I tried replicating your script as well, and it worked fine. Hell, because it's all functions involved, switching the order still worked, too. Edit: Was writing my post before you deleted your previous one. I'm actually kind of curious how you managed to get the reference error, since I didn't get one no matter how I arranged your same code.