Weird timer+com issue - 18/03/17 02:26 AM
I'm not sure how else to explain this than to show it as code:
When the script is executed, the timer triggers while mIRC is waiting for the com to return:
Code:
alias -l addjs { bset -t &example $calc(1 + $bvar(&example,0)) $1- } alias example { addjs example=function(){ addjs var request = new ActiveXObject('MSXML2.SERVERXMLHTTP.6.0'); addjs request.open('GET', 'https://forums.mirc.com/ubbthreads.php/forum_summary', true); addjs request.send(); addjs request.waitForResponse(60); addjs if (request.readyState == 4) return "Done"; addjs request.abort(); addjs return "Timeout"; addjs }; var %js = example() comopen example MSScriptControl.ScriptControl echo -a Language: $com(example, language, 4, bstr, jscript) echo -a JS Load : $com(example, ExecuteStatement, 1, &bstr, &example) .timer -iom 1 0 echo -a Timer Triggered echo -a Calling function echo -a Called: $com(example, eval, 1, bstr, %js) $com(example).result comclose example }
When the script is executed, the timer triggers while mIRC is waiting for the com to return:
Code:
* Opened Com 'example' (MSScriptControl.ScriptControl) - Language: 1 JS Load : 1 Calling function Timer Triggered Called: 1 Done - * Closed Com 'example'