mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Sat Jan 12, 2013 7:43 am Post subject: [bug?] onOpenProcess and autoAssemble(script,true) |
|
|
Example code:
Code: | function onOpenProcess()
print('onOpenProcess here')
end
function writeLocal()
script = [[
400500:
db (int)1
]]
autoAssemble(script,true)
end
if hk1~=nil then object_destroy(hk1); hk1=nil; end
hk1= createHotkey(writeLocal, VK_F2) |
I just run above code, then I attach CE to tutorial. "onOpenProcess here" shows up.
But, every time I press F2, "onOpenProcess here" is printed twice.
I know about "Note that the same process might be opened multiple times in a row". But this is weird.
This script works as should: Code: |
function onOpenProcess()
print('onOpenProcess here')
end
function writeLocal()
writeIntegerLocal('400500',1)
end
if hk1~=nil then object_destroy(hk1); hk1=nil; end
hk1= createHotkey(writeLocal, VK_F2) |
writeIntegerLocal('400500',1) does not trigger onOpenProcess. But autoAssemble(script,true) does.
The only thing I can do is this:
Code: | skipOnOpen = false
function onOpenProcess()
if skipOnOpen then return end
print('onOpenProcess here')
end
function writeLocal()
script = [[
400500:
db (int)1
]]
skipOnOpen=true
autoAssemble(script,true)
skipOnOpen=false
end
if hk1~=nil then object_destroy(hk1); hk1=nil; end
hk1= createHotkey(writeLocal, VK_F2) |
_________________
|
|