Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[bug?] onOpenProcess and autoAssemble(script,true)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sat Jan 12, 2013 7:43 am    Post subject: [bug?] onOpenProcess and autoAssemble(script,true) Reply with quote

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)

_________________
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites