View previous topic :: View next topic |
Author |
Message |
LastExceed Expert Cheater Reputation: 1
Joined: 05 Nov 2014 Posts: 130
|
Posted: Mon Mar 23, 2015 1:11 pm Post subject: Shared Memory Blocks |
|
|
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 |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Mon Mar 23, 2015 1:38 pm Post subject: |
|
|
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 |
|
|
LastExceed Expert Cheater Reputation: 1
Joined: 05 Nov 2014 Posts: 130
|
Posted: Mon Mar 23, 2015 2:11 pm Post subject: |
|
|
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 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 |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Mon Mar 23, 2015 3:05 pm Post subject: |
|
|
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 |
|
|
LastExceed Expert Cheater Reputation: 1
Joined: 05 Nov 2014 Posts: 130
|
Posted: Mon Mar 23, 2015 4:09 pm Post subject: |
|
|
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 |
|
|
|