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 


Shared Memory Blocks

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
LastExceed
Expert Cheater
Reputation: 1

Joined: 05 Nov 2014
Posts: 130

PostPosted: Mon Mar 23, 2015 1:11 pm    Post subject: Shared Memory Blocks Reply with quote

We get more and more errors so I think this would be the easiest and fastest way:
We want to sync the character position of two game clients by using a shared memory block with 2 CE clients.
Can somebody give us the full lua code for each CE client?
We're tired of seeking for solutions for endless amounts of errors...

Thanks in advanced

zac & chris
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Mon Mar 23, 2015 1:38 pm    Post subject: Reply with quote

let's assume X is at 00400500 and Y is at 00400600
we setup the shared memory block as:

0=x
4=y

CE1 (open the source)
Code:

--reader script
shm=allocateSharedMemory("mymem",4096)

t=createTimer()
t.OnTimer=function(sender)
  writeInteger(shm+0, readInteger(0x00400500))
  writeInteger(shm+4, readInteger(0x00400600))
end
t.Interval=10
t.Enabled=true



CE2(open the destination)
Code:

--writer script
shm=allocateSharedMemory("mymem",4096)
fullAccess(0x00400500,0x200) --just for the ce tutorial

t=createTimer()
t.OnTimer=function(sender)
  writeInteger(0x00400500, readInteger(shm+0))
  writeInteger(0x00400600, readInteger(shm+4))
end
t.Interval=10
t.Enabled=true


for addresses you can also use the addresslist class if you like, but that is a completely different subject matter

_________________
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
LastExceed
Expert Cheater
Reputation: 1

Joined: 05 Nov 2014
Posts: 130

PostPosted: Mon Mar 23, 2015 2:11 pm    Post subject: Reply with quote

Dark Byte wrote:
let's assume X is at 00400500 and Y is at 00400600
we setup the shared memory block as:

0=x
4=y

CE1 (open the source)
Code:

--reader script
shm=allocateSharedMemory("mymem",4096)

t=createTimer()
t.OnTimer=function(sender)
  writeInteger(shm+0, readInteger(0x00400500))
  writeInteger(shm+4, readInteger(0x00400600))
end
t.Interval=10
t.Enabled=true



CE2(open the destination)
Code:

--writer script
shm=allocateSharedMemory("mymem",4096)
fullAccess(0x00400500,0x200) --just for the ce tutorial

t=createTimer()
t.OnTimer=function(sender)
  writeInteger(0x00400500, readInteger(shm+0))
  writeInteger(0x00400600, readInteger(shm+4))
end
t.Interval=10
t.Enabled=true


for addresses you can also use the addresslist class if you like, but that is a completely different subject matter


first of all great thanks for the quick reply, we finally managed to get it to work with your help Smile just three more things:
1) how to stop the script?
2) how to use pointers in here?
3) is it possible to link 2 Ce clients that run on different computers (same local network) ?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Mon Mar 23, 2015 3:05 pm    Post subject: Reply with quote

1: t.Enabled=false
2:use the addresslist class, or use the way you normal do pointers in code (read base, add offset, read value, add offset read value, add offset, till last offset and that is the address
3: that is a completely different thing. look into sockets

_________________
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
LastExceed
Expert Cheater
Reputation: 1

Joined: 05 Nov 2014
Posts: 130

PostPosted: Mon Mar 23, 2015 4:09 pm    Post subject: Reply with quote

Dark Byte wrote:
1: t.Enabled=false
2:use the addresslist class, or use the way you normal do pointers in code (read base, add offset, read value, add offset read value, add offset, till last offset and that is the address
3: that is a completely different thing. look into sockets


@Cellux give this man a coockie.

Thanks alot DB!
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 Lua Scripting 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