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 


[HELP] Togglebox activate script from table

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

Joined: 25 Jun 2016
Posts: 2

PostPosted: Sat Jun 25, 2016 8:40 am    Post subject: [HELP] Togglebox activate script from table Reply with quote

Hello,

I was reading through some of the tutorials, because my girlfriend likes to play Farm Seasons on FB using Chrome.
I have successfully found the process which holds the game data, manipulated with water and feed variables to desired values.

But she is too lazy to actually learn to do it by herself, so I am trying to make a trainer for her. I have read some tutorial about scripting and AOB injection and successfully developed something that somehow works, but I don't really know how to activate the script from table by togglebox.

Picture 1. My table

Picture 2. Unlimited Feed script

And my Lua code
Code:
AboutText=[[nutin]]

form_show(UDF1)
getAutoAttachList().add("chrome.exe")

function CloseClick()
  closeCE()
  return caFree
end

UDF1.OnClose = CloseClick

addresslist=getAddressList()

function CEToggleBox2Click(sender)
   if (checkbox_getState(UDF1.CEToggleBox1) == 1) then
      getAddressList().getMemoryRecordByDescription("Feed99").Active=true
   else
      getAddressList().getMemoryRecordByDescription("Feed99").Active=false
   end
end
function CEToggleBox1Click(sender)
   if (checkbox_getState(UDF1.CEToggleBox1) == 1) then
      getAddressList().getMemoryRecordByDescription("Water99").Active=true
   else
      getAddressList().getMemoryRecordByDescription("Water99").Active=false
   end
end


I have used these tutorials to come up with something like that:
- viewtopic.php?p=5576412
- viewtopic.php?t=570083

and Google to actualy get the
Code:

getAddressList().getMemoryRecordByDescription("*").Active=*


After I have saved the outcome as .exe it won't do anything to the game. So I just thought that there is a problem with the piece of code I am using in the Click logic, or is there anything else that is wrong with this sh**?
Activating them from Cheat Engine window works just fine, exactly how it is supposed to behave. So please, can someone here help me with this?



tr2.png
 Description:
scriptFeed
 Filesize:  12.86 KB
 Viewed:  13893 Time(s)

tr2.png



tr1.png
 Description:
Table
 Filesize:  4.35 KB
 Viewed:  13893 Time(s)

tr1.png


Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4291

PostPosted: Sat Jun 25, 2016 9:25 am    Post subject: Reply with quote

Code:
getAutoAttachList().add("chrome.exe")

Did you look to see just how many processes named "chrome.exe" exist?

If it's a flash game, you can go through each process named "chrome.exe", enumerate the dlls, and search for "pepflashplayer.dll". Otherwise, give the user an option to attach to a process and let them figure out which one is correct.

_________________
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
ffredyk
How do I cheat?
Reputation: 0

Joined: 25 Jun 2016
Posts: 2

PostPosted: Sat Jun 25, 2016 9:55 am    Post subject: Reply with quote

Yeah I know that Chrome makes a new process for anything it does. But because I don't know where (if there is any) could I find some CE documentation, I didn't know how

Code:
getAutoAttachList().add("chrome.exe")


behaves exactly.

And because I don't have any sense on how to enumerate the DLLs or search for a specific one I give up on this.

Thank you for your reply though. I may continue with any tries on this sometime later.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4291

PostPosted: Sat Jun 25, 2016 10:02 am    Post subject: Reply with quote

The auto attach list is a list of strings. If CE isn't attached to a process, it takes a string from the list, searches for any processes with that name, and attaches to the first one it finds. If CE doesn't find that process name, it moves onto the next string in the auto attach list, and loops through it until CE attaches to something.

Use getProcesslist() to find all the chrome.exe process IDs. Use enumModules(processid) to enumerate all the modules of a specified process. Look in main.lua (in CE's directory) for documentation on everything mentioned.

_________________
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
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Sun Jun 26, 2016 5:27 am    Post subject: Reply with quote

Either use a script that will find the correct chrome process or just simply crash flash player -> refresh the page and then only start the trainer (newest chrome process will be picked by cheat engine and its most likely to be flash).
_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
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 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