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 


Cheat Engine Lua Script (Try or Catch or IgnoreError)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials
View previous topic :: View next topic  
Author Message
valera01
How do I cheat?
Reputation: 0

Joined: 04 Oct 2012
Posts: 3
Location: Italy

PostPosted: Thu Oct 04, 2012 12:52 pm    Post subject: Cheat Engine Lua Script (Try or Catch or IgnoreError) Reply with quote

Hey all.
here is my code:
Code:
function setAtkSpeed()
local base = getAddress('[[[[["aion.bin"+00066788]+200]+178]+390]+460]+4F6')
local val = readInteger(base)
   if(val == 1782)or(val == 1500)or(val == 1100)or(val == 2200)then
      writeInteger(base, 1100)
      print("worked.")
   end
end
createHotkey("setAtkSpeed",110)


,now the problem is that the base or the pointer is not always a value its (???????) sometimes as i saw in cheat engine.
So when its unknown i get a error if i try to execute this.
How could i prevent that error to open ? or ignore it, im looking for something like try{}catch(error e){} .
Ty for your attention Smile
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Thu Oct 04, 2012 1:21 pm    Post subject: Reply with quote

Execute this line:
Code:

errorOnLookupFailure(false)

Then just check if an address lookup is 0 or not

_________________
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
valera01
How do I cheat?
Reputation: 0

Joined: 04 Oct 2012
Posts: 3
Location: Italy

PostPosted: Thu Oct 04, 2012 1:53 pm    Post subject: Reply with quote

it gives a error:
attempt to call global "errorOnLookupFailure" a nil value.
(Im using cheat engine table lua script window.)
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Thu Oct 04, 2012 2:19 pm    Post subject: Reply with quote

errorOnLookupFailure(state) was added to ce6.2 so make sure you use that version
_________________
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
valera01
How do I cheat?
Reputation: 0

Joined: 04 Oct 2012
Posts: 3
Location: Italy

PostPosted: Thu Oct 04, 2012 11:59 pm    Post subject: Reply with quote

Thank you very much. Smile)
Lovely fast answers Very Happy
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 Tutorials 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