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 


Error before click OK in script AA

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
24quant42
Cheater
Reputation: 0

Joined: 19 Apr 2023
Posts: 31

PostPosted: Thu Nov 09, 2023 1:00 pm    Post subject: Error before click OK in script AA Reply with quote

Hello, I get an error when I want to change the code created through AA.
There is an "Auto Assemble script" item in the list of cheats. If I click "Change script" I can change it, but if I accidentally click the "OK" button, which is in the middle, I get an error like in the screenshot.

And after that I can no longer open this element and correct the code, because I always get an error like in the screenshot.

What should I do DarkByte?


My code example:
{$lua}
[ENABLE]
-- lua code
[DISABLE]
-- lua code



AND Errror file:

File ExceptionAutoSave.CT


Code:

<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="45">
  <CheatEntries>
    <CheatEntry>
      <ID>0</ID>
      <Description>"Auto Assemble script"</Description>
      <VariableType>Auto Assembler Script</VariableType>
      <AssemblerScript>{$lua}

memscan = getCurrentMemscan()

function firstScan()
  protectionflags = "+W-C"
  memscan.firstScan(soExactValue, vtDouble, rtRounded,
  "15", nil,
  0, 0x7fffffffffff, protectionflags, fsmAligned, "4", false, false, false, false)
end

function nextScan()
  memscan.nextScan(soExactValue, rtRounded,
  "33", nil,
  false, false, false, false,false)
end


[ENABLE]
if vkF11 then vkF11.destroy() end
vkF11=createHotkey(firstScan, {VK_F11})
if vkF12 then vkF12.destroy() end
vkF12=createHotkey(nextScan, {VK_F12})

[DISABLE]
if vkF11 then vkF11.destroy() end
if vkF12 then vkF12.destroy() end
</AssemblerScript>
    </CheatEntry>
  </CheatEntries>
  <UserdefinedSymbols/>
</CheatTable>




err.png
 Description:
 Filesize:  25.95 KB
 Viewed:  2446 Time(s)

err.png


Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1516

PostPosted: Thu Nov 09, 2023 1:37 pm    Post subject: Reply with quote

Code:

[ENABLE]
{$lua}

memscan = getCurrentMemscan()

function firstScan()
  protectionflags = "+W-C"
  memscan.firstScan(soExactValue, vtDouble, rtRounded,
  "15", nil,
  0, 0x7fffffffffff, protectionflags, fsmAligned, "4", false, false, false, false)
end

function nextScan()
  memscan.nextScan(soExactValue, rtRounded,
  "33", nil,
  false, false, false, false,false)
end

//{$asm}
//[ENABLE]

{$lua}
if vkF11 then vkF11.destroy() end
vkF11=createHotkey(firstScan, {VK_F11})
if vkF12 then vkF12.destroy() end
vkF12=createHotkey(nextScan, {VK_F12})

{$asm}

[DISABLE]

{$lua}
if vkF11 then vkF11.destroy() end
if vkF12 then vkF12.destroy() end

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4696

PostPosted: Thu Nov 09, 2023 2:22 pm    Post subject: Reply with quote

Missing `if syntaxcheck then return end`

Not setting destroyed objects to nil (they get destroyed twice- very bad)

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
24quant42
Cheater
Reputation: 0

Joined: 19 Apr 2023
Posts: 31

PostPosted: Thu Nov 09, 2023 11:10 pm    Post subject: Reply with quote

AylinCE wrote:
Code:

[ENABLE]
{$lua}
if vkF12 then vkF12.destroy() end


Still, after clicking OK I get an error and can no longer change the code.

----------

When I click on the script in the list of cheats, I also get the following error.
The most interesting thing is that if you open AA and click New Window, then while a new AA window is open, and click on the script, then everything works and I can change the code.

But as soon as you close the new AA window, the error appears again. Apparently, after opening the AA windows and closing them, the CE code does not clear the object or component.... So CE cannot normally open the script in the AA window for editing



11.png
 Description:
 Filesize:  17.33 KB
 Viewed:  2339 Time(s)

11.png


Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1516

PostPosted: Fri Nov 10, 2023 6:13 am    Post subject: This post has 1 review(s) Reply with quote

1)
Code:
[ENABLE]
{$lua}
if syntaxcheck then return end
memscan = getCurrentMemscan()


2) No key tablet ..

Code:
if vkF11 then vkF11.destroy() end
vkF11=createHotkey(firstScan, {VK_F11})
if vkF12 then vkF12.destroy() end
vkF12=createHotkey(nextScan, {VK_F12})


Use;

Code:
if vkF11 then vkF11.destroy() vkF11=nil end
if vkF12 then vkF12.destroy()  vkF12=nil  end
vkF11=createHotkey(firstScan, VK_F11)
vkF12=createHotkey(nextScan, VK_F12)

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
24quant42
Cheater
Reputation: 0

Joined: 19 Apr 2023
Posts: 31

PostPosted: Fri Nov 10, 2023 9:07 am    Post subject: Reply with quote

AylinCE wrote:
1)
Code:
[ENABLE]
{$lua}
if syntaxcheck then return end



Thank you very much)) the errors are gone, everything works now.

Please tell me, does CE have a discord? I'd like to subscribe.

And yes, this topic can be closed, the problem is solved =)
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1516

PostPosted: Fri Nov 10, 2023 10:29 am    Post subject: Reply with quote

Patreon CE
https://www.patreon.com/cheatengine

Twitter CE
https://twitter.com/_cheatengine

For more about CE;
www.cheatengine.org

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website 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