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 


Question for a script

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

Joined: 21 May 2011
Posts: 46

PostPosted: Mon Dec 19, 2016 7:52 am    Post subject: Question for a script Reply with quote

Hello. Is it possible to write a script to look at two or more adresses's value? And if the values are true then set a third adress value to 100 ??

example:

ePSXe.exe+B6FD90 = FE9C ( only inside battle mode, otherwise value changes when out of battle, in a dialoge etc.)

and

ePSXe.exe+B6FD86 = 0006 ( only when inside battle and stay idle, otherwise it changes like above or when attack, use skill etc)

if the value of above are true then

set

ePSXe.exe+B6FDB6 = 0064 ( if freeze game will crash the moment you use limit break skill, that is why only set to value. at the moment you attack ePSXe.exe+B6FD86's value will change, so it won't crash)


Those adresses are static because it is an emulator game. Very Happy
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Mon Dec 19, 2016 8:59 am    Post subject: Reply with quote

something like this:
Code:

{$lua}
if t then
  t.destroy()
  t=nil
end
{$asm}

[enable]
{$lua}
if not syntaxcheck then
  t=createTimer()
  t.Interval=100
  t.OnTimer=function()
    local v1=readInteger('ePSXe.exe+B6FD90') & 0xffff;
    local v2=readInteger('ePSXe.exe+B6FD86') & 0xffff;

    if ((v1==0xfe9c) and (v2==0x0006)) then
      local v3=wordToByteTable(0x64)
      writeBytes('ePSXe.exe+B6FDB6',v3)
    end
  end
  t.Enabled=true
end

[disable]


_________________
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
oyyzj
Cheater
Reputation: 0

Joined: 21 May 2011
Posts: 46

PostPosted: Mon Dec 19, 2016 12:42 pm    Post subject: Reply with quote

Thank you for reply.

So it only works with a lua script? or can i just use auto assemble for this?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Mon Dec 19, 2016 12:44 pm    Post subject: Reply with quote

this is an auto assembe script with some lua additions. You can just plug it in there
_________________
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
oyyzj
Cheater
Reputation: 0

Joined: 21 May 2011
Posts: 46

PostPosted: Mon Dec 19, 2016 4:28 pm    Post subject: Reply with quote

is it possible to add or function between if ((v1==0xfe9c) and (v2==0x0006))

like: if ((v1==0xfe9c) or (v3==0x0004) and (v2==0x0006))

or i have to write it like: if ((v1==0xfe9c) and (v2==0x0006)) or if ((v3==0x0004) and (v2==0x0006)) ??
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Mon Dec 19, 2016 4:43 pm    Post subject: Reply with quote

just watch where you put the ()'s but yes. the first case will work.

e.g:
((v1==0xfe9c) or (v3==0x0004)) and (v2==0x0006)
is different from
(v1==0xfe9c) or ((v3==0x0004) and (v2==0x0006))

it's all up to you on what you want

_________________
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
oyyzj
Cheater
Reputation: 0

Joined: 21 May 2011
Posts: 46

PostPosted: Mon Dec 19, 2016 5:04 pm    Post subject: Reply with quote

Thanks for this ((v1==0xfe9c) or (v3==0x0004)) and (v2==0x0006)

i have test it on 1 character and it works. But it doesn't work well with a team that has 4 characters inside. I made 4 scripts for each character position 1, when activated only the last activated will set value to 0x64.

Is it because the timer built in ??


EDIT: I think I got this. I just deleted this part and all 4 scripts works well together:

{$lua}
if t then
t.destroy()
t=nil
end
{$asm}
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Mon Dec 19, 2016 6:48 pm    Post subject: Reply with quote

if you use different scripts, use different timer names. e.g t2, t3, t4 (else you can't disable them)
_________________
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
oyyzj
Cheater
Reputation: 0

Joined: 21 May 2011
Posts: 46

PostPosted: Tue Dec 20, 2016 1:04 am    Post subject: Reply with quote

Can I get some more instructions about the example v3=WordToByteTable(0x00) please.

How does it look like when you write for:

Word
Dword
Integer

just for future preferences.


Thank you
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