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 in line 16 This instruction can't be compiled)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Enksx1
Newbie cheater
Reputation: 0

Joined: 21 Jun 2016
Posts: 14
Location: United States

PostPosted: Fri Oct 28, 2016 11:01 pm    Post subject: (Error in line 16 This instruction can't be compiled) Reply with quote

Code:
[ENABLE]
{$Lua}
function code()
       local list = getAddressList()
   list.getMemoryRecordByDescription("My X").Value = list.getMemoryRecordByDescription("Their X").Value
   list.getMemoryRecordByDescription("My Y").Value = list.getMemoryRecordByDescription("Their Y").Value
   list.getMemoryRecordByDescription("My Z").Value = list.getMemoryRecordByDescription("Their Z").Value
   end

      t=createTimer(nil)
      timer_setInterval(t, 1)
      timer_onTimer(t, code)

[DISABLE]

t.destroy();
      t=nil
   end
{$Asm}
{

}


What's wrong with this code?

The cheat works partially right.. but doesn't want to disable and I end up getting stack overflow...
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25803
Location: The netherlands

PostPosted: Sat Oct 29, 2016 3:40 am    Post subject: Reply with quote

disable needs {$Lua} as well
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
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 Oct 29, 2016 7:42 am    Post subject: Re: (Error in line 16 This instruction can't be compiled) Reply with quote

Also

- code indentation is awful
- one not needed "end"
- code not efficient ( getAddressList and getMemoryRecordByDescription should be done outside)



Code:
[ENABLE]
{$Lua}
local getMemRecByDesc = getAddressList().getMemoryRecordByDescription

MR_MyX = getMemRecByDesc("My X")
MR_MyY = getMemRecByDesc("My Y")
MR_MyZ = getMemRecByDesc("My Z")

MR_TheirX = getMemRecByDesc("Their X")
MR_TheirY = getMemRecByDesc("Their Y")
MR_TheirZ = getMemRecByDesc("Their Z")

function code()
   MR_MyX.Value = MR_TheirX.Value
   MR_MyY.Value = MR_TheirY.Value
   MR_MyZ.Value = MR_TheirZ.Value
end

t=createTimer(nil)
timer_setInterval(t, 1)
timer_onTimer(t, code)

[DISABLE]

{$Lua}
t.destroy();
t=nil

_________________
Back to top
View user's profile Send private message MSN Messenger
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sat Oct 29, 2016 8:15 am    Post subject: Reply with quote

Smile
Code:
t.Interval = 1
t.OnTimer = code
Back to top
View user's profile Send private message
Enksx1
Newbie cheater
Reputation: 0

Joined: 21 Jun 2016
Posts: 14
Location: United States

PostPosted: Sat Oct 29, 2016 10:12 am    Post subject: Reply with quote

Thanks everyone . ^^
Back to top
View user's profile Send private message
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