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 


Lua script with pointers

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

Joined: 25 Jan 2014
Posts: 73

PostPosted: Thu Sep 18, 2014 12:10 pm    Post subject: Lua script with pointers Reply with quote

Hello, i try to make teleport with game map
I have 3 pointers of coords car
I have 3 ponters of game map
i try use this script :
*********************************************
function checkKeys(timer)
if (isKeyPressed(VK_X)) then
A = readFloat('[[[[["Game.exe"+01D9CC08]+1c8]+240]+70]+238]+f4')
B = readFloat('[[[[["Game.exe"+01D9CC08]+1c8]+240]+70]+238]+88')
C = readFloat('[[[[["Game.exe"+01D9CC08]+1c8]+240]+70]+238]+80')

writeFloat('[[[[["Game.exe"+01D048D0]+f8]+28]+1b0]+30]+1c4', A)
writeFloat('[[[[["Game.exe"+01D048D0]+f8]+28]+1b0]+30]+1c8', B)
writeFloat('[[[[["Game.exe"+01D048D0]+f8]+28]+1b0]+30]+1c0', C)
end
end

t=createTimer(nil)
timer_setInterval(t, 1)
timer_onTimer(t, checkKeys)
timer_setEnabled(t, true)
***************************************************
A,B,C - it is map pointers
This script dont work, but this pointers always work in CE table
I try to write instead [[[[["Game.exe"+01D048D0]+f8]+28]+1b0]+30]+1c0
dinamic adress and script work
In another game this script with another pointers of another game worked
Can you help me?[/code]
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Thu Sep 18, 2014 12:42 pm    Post subject: Reply with quote

Is it possible that those pointers only work while you are in pause menu ?

Try checking "Repeat rescan until stoppped" in "rescan pointer" window. And while rescanning is turned on, go back to game and play for a while.

_________________
Back to top
View user's profile Send private message MSN Messenger
AntonVit
Advanced Cheater
Reputation: 0

Joined: 25 Jan 2014
Posts: 73

PostPosted: Fri Sep 19, 2014 9:58 am    Post subject: Reply with quote

Yes, pointers of map work only in menu. Pointers of car work always.
And i tryed to teleportated when game was in menu, when all 6 pointers has values.
I try make saveing teleport with only cars pointers and it script dont work too:
****************************************************
local savedA = 0;
local savedB = 0;
local savedC = 0;


function savePosition()
savedA = readFloat('[[[[["Game.exe"+01D048D0]+f8]+28]+1b0]+30]+1c4');
savedB = readFloat('[[[[["Game.exe"+01D048D0]+f8]+28]+1b0]+30]+1c8');
savedC = readFloat('[[[[["Game.exe"+01D048D0]+f8]+28]+1b0]+30]+1c0');
end

function loadPosition()
writeFloat('[[[[["Game.exe"+01D048D0]+f8]+28]+1b0]+30]+1c4', savedA);
writeFloat('[[[[["Game.exe"+01D048D0]+f8]+28]+1b0]+30]+1c8', savedB);
writeFloat('[[[[["Game.exe"+01D048D0]+f8]+28]+1b0]+30]+1c0', savedC);
end

createHotkey("savePosition", VK_0);
createHotkey("loadPosition", VK_P);
****************************************************
In another games which i tryed,this type of script always worked
I try make it teleport with map on NFS Rival by EA games
Today i tryed use this lua scripts on game Battlefield by too EA games and it too dont worked
In Mafia 2, Assiscried Black flag, dirt 3 - this types of scripts are worked
In EA games product - not
Lua engine cant find pointers, but in table CE they are always work, alwayse has value. And i dont know why Lua engine cant find it
Dark Byte what You think aboute that? I think you can help
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Fri Sep 19, 2014 12:20 pm    Post subject: Reply with quote

Check the order of your offsets and print out getAddress(pointer) and confirm it is the correct address

Also, are you using 6.3 or 6.4? If 6.3 try upgrading to 6.4 and confirm the cheat table entry still works. 6.3 and earlier have a 'bug' where if a pointer becomes unreadable(e.g pointers only valid when paused) the last known address will be used instead of not working at all

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

Joined: 25 Jan 2014
Posts: 73

PostPosted: Fri Sep 19, 2014 1:14 pm    Post subject: Reply with quote

Yes, correct adress and offsets
In scripts all offsets like in ce table pointer, i made many game with this way and cant whrite error now.
I use 6.4 but try on 6.3 1nd 6.1 too
Cheat table worked on all versions
For me dificult use instruction for making teleport, lua much easyest
Is there way to copy value from pointer in CE table to another pointer in CE table, for example with using name of pointers in CE table?
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sat Sep 20, 2014 10:26 am    Post subject: Reply with quote

AntonVit wrote:
Yes, pointers of map work only in menu. Pointers of car work always.





Code:
A,B,C = nil,nil,nil

function smartDestroy(obj)
  if obj and obj.destroy then obj.destroy() end
end

function readMapCoords(timer)

  local Al,Bl,Cl

  Al = readFloat('[[[[["Game.exe"+01D9CC08]+1c8]+240]+70]+238]+f4')
  Bl = readFloat('[[[[["Game.exe"+01D9CC08]+1c8]+240]+70]+238]+88')
  Cl = readFloat('[[[[["Game.exe"+01D9CC08]+1c8]+240]+70]+238]+80')

  if Al==nil or Bl==nil or Cl==nil then return end

  A,B,C = Al,Bl,Cl

end


function teleport()

  if A==nil or B==nil or C==nil then return end

  writeFloat('[[[[["Game.exe"+01D048D0]+f8]+28]+1b0]+30]+1c4', A)
  writeFloat('[[[[["Game.exe"+01D048D0]+f8]+28]+1b0]+30]+1c8', B)
  writeFloat('[[[[["Game.exe"+01D048D0]+f8]+28]+1b0]+30]+1c0', C)

end


smartDestroy(timer); timer=nil
timer = createTimer(nil,true)
timer.OnTimer  = readMapCoords
timer.Interval = 100

smartDestroy(teleportHotkey); teleportHotkey=nil
teleportHotkey = createHotkey(teleport,VK_X)

_________________
Back to top
View user's profile Send private message MSN Messenger
AntonVit
Advanced Cheater
Reputation: 0

Joined: 25 Jan 2014
Posts: 73

PostPosted: Sat Sep 20, 2014 12:25 pm    Post subject: Reply with quote

Thank You very much for helping.
But this script i cant use, couse lua engine cant understand this my pointers. This pointers worked only in CE table. 3 of them - cars pointers has value in CE table always, another 3 pointers of map- has value in CE table only when game in menu. Lua engine cant find pointers for readinf and cant find pointers for writing, in another game it alwayse finded.
Ok, i thanks for help again, i dont want try to make it teleport else, i think its game protect
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