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 


Exporting values to excel/google docs in real time

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

Joined: 19 Aug 2009
Posts: 4

PostPosted: Tue Feb 25, 2020 10:15 pm    Post subject: Exporting values to excel/google docs in real time Reply with quote

Hello,

I am currently playing The Guild 3 and I have been enjoying creating spreadsheets in excel and google docs to help me optimize what my businesses produce based on current market prices.
Until now I have been updating market prices in my spreadsheet manually by looking at the market price in-game and then alt-tabbing to my spreadsheet and updating the relevant cells, however, since market prices change multiple times an in-game day, and I am dealing with multiple commodities, doing so is quite tedious.
I am trying to find an efficient way of capturing the buy and sell prices of a given commodity/commodities and then exporting these values in some way that can be imported to excel or google docs in real-time. Naturally, Cheat Engine came to mind.
I have already done a little snooping and discovered that the relevant values are simple 4-byte, exact values whose addresses were easily ascertained with two scans.
I am clueless as to how to proceed beyond this point and was hoping someone a lot smarter and more skilled than I would be generous enough to help me figure out the best way of accomplishing my goal.

Thanks in advance for any help!
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4717

PostPosted: Wed Feb 26, 2020 12:03 am    Post subject: Reply with quote

If I'm not mistaken, most spreadsheet programs parse tabs and newlines as "next column" and "next row" operations when pasting a string. Generate the string by reading values from addresses, write it to the clipboard, and make a macro that switches to excel and updates the spreadsheet. Trigger all this perhaps with a hotkey.

The hotkey and clipboard are easy with the functions createHotkey and writeToClipboard respectively. Generating the string shouldn't be too difficult, but it would obviously depend on how the spreadsheet is organized and how you're getting the addresses. The macro part might be more annoying than it would be worth- switching to the spreadsheet and pasting it in yourself might be the best option.

Pointers can help with finding the addresses automatically. If this is a game where good base addresses aren't exactly easy to find, you can still get a non-static base common to all the addresses through a code injection (or just get the values themselves through a code injection; however, the order those values are in might be difficult to determine).

See DB's video on step 8 of the CE tutorial (link) for information on pointers and the pointer scanner, and search for "injection copy" / "injection copies" for information on this code injection technique. There are also plenty of tutorials on Lua out there (CE uses Lua 5.3), CE-related Lua stuff is documented in celua.txt, and examples are in these forums.

Some more information would help others give more practical help to you. What does the spreadsheet look like? How many values are there? Are you fine with finding the addresses yourself every time the game starts? How are the values stored in memory? (consecutively and/or in the same order?)

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
kein92
How do I cheat?
Reputation: 0

Joined: 19 Aug 2009
Posts: 4

PostPosted: Fri Feb 28, 2020 1:40 pm    Post subject: Reply with quote

I appreciate your taking the time to respond to me Penguin!

I'm pasting a link to the spreadsheet here so you can see what I've got going on: docs.google.xxx/spreadsheets/d/1qE7VKXPaY8jcZxm_Xt4odPuNPkkStb_gsHtux-uxeSo/edit?usp=sharing

The values being pulled from the game would be the buy price and the sell price for each commodity and would be updated in rows 5 and 6 of the spreadsheet.

Based on your response it seems like maybe using a spreadsheet isn't the best way of going about this. I'm thinking it might be simpler in the long run to code some kind of app that does this rather than trying to use a mixture of cheat engine and spreadsheets.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4717

PostPosted: Fri Feb 28, 2020 4:29 pm    Post subject: Reply with quote

You could have a look at CE's form designer if you want. Click on "Create form" under the Table menu in the main CE window and play with stuff. e.g. editboxes to input data, listview or treeview to display data, anchors to position everything...
The CE wiki has a page on this:
https://wiki.cheatengine.org/index.php?title=Tutorial:LuaFormGUI

_________________
I don't know where I'm going, but I'll figure it out when I get there.
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