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 


Saving values in a CSV

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

Joined: 28 Dec 2014
Posts: 8

PostPosted: Tue Jan 06, 2015 8:06 pm    Post subject: Saving values in a CSV Reply with quote

I am using cheat engine in a game to simply track data for data analysis, not change anything. I have all the addresses I need to see the values of things I want like character positions, health, etc. already using a combination of AoB scans and pointers. However, I have absolutely no idea how to save the values at the addresses into a text file. I believe this is possible using lua scripts but I am not sure where to begin after a lot of searching. Any help would be appreciated.
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: Wed Jan 07, 2015 6:32 am    Post subject: Reply with quote

Possible solution: use Stringlist object and its method saveToFile.


Here, I'm using Stringlist and SaveDialog objects.

Code:
-- Example
-- 3D. Hyperbolic Paraboloid

-- Constant
a = 1
b = 1

stringlist = createStringlist()


for x=-10,10,0.5 do
 for y=-10,10,0.5 do

  f_xy = ((x/a)^2 - (y/b)^2) / 10
  stringlist.add(x..';'..y..';'..f_xy)

 end
end

dialog=createSaveDialog()
dialog.DefaultExt=".csv"
dialog.Filter="Excel CSV File (*.csv)|*.csv"
dialog.FilterIndex=1
dialog.Options = '[ofOverwritePrompt, ofEnableSizing]'

if dialog.execute() then
  stringlist.saveToFile(dialog.Filename)
end

dialog.destroy()
stringlist.destroy()






Of course, you should use readInteger, readFloat (and whatever you need) and stringlist.add() inside a timer. After you finished recording, just call stringlist.saveToFile().

_________________
Back to top
View user's profile Send private message MSN Messenger
crumbleybumbley
How do I cheat?
Reputation: 0

Joined: 28 Dec 2014
Posts: 8

PostPosted: Wed Jan 07, 2015 7:02 pm    Post subject: Reply with quote

Yea that looks to do exactly what I want once i replace the paraboloid stuff and add a timer. Thanks a ton. I am still complete garbage, but I think what I need to do is first do an AoB scan for my 10 results that I will get (I want to track them all), then make a table of those 10 results, and read from that table. I assume I would be using things like createTableEntry, getTableEntry, and memrec_getValue then to finish it off. Is that about right?
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 55

Joined: 01 Oct 2008
Posts: 942

PostPosted: Wed Jan 07, 2015 7:52 pm    Post subject: Reply with quote

There is no createTableEntry,
the table entry is actually MemoryRecord
try createMemoryRecord under AddressList Class. and check
http://cheat-engine.googlecode.com/svn/trunk/Cheat%20Engine/bin/main.lua
this should be the same file under your ce install directory.
Back to top
View user's profile Send private message
crumbleybumbley
How do I cheat?
Reputation: 0

Joined: 28 Dec 2014
Posts: 8

PostPosted: Wed Jan 07, 2015 7:53 pm    Post subject: Reply with quote

Cool thank you, I'll get working on that.
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