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 


script timed

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

Joined: 26 Sep 2019
Posts: 6

PostPosted: Thu Sep 26, 2019 9:48 am    Post subject: script timed Reply with quote

Do you know how I can do various timer functions? Example: I have a client.exe program in it has a character, all functions must occur in parallel not sequentially in programming must be 100% timed without a game address and settings should only influence the client.exe program, so 1st function "start of function every 15 minutes must be executed or command corresponding to number 1 of end function keypad" 2nd "start of function every 7 min should be executed or execute command corresponding to number 2 of end function keypad" 3rd "start of function every 23 min must be executed or the command corresponding to number 3 of the keyboard with function" 4th "start of function every 15 min must be executed or the central command of the letter (A) of the keyboard and key A for the activated logo must be executed the D key command end of function "all must occur independently except the 4th function which must have 2 commands where one only happens after the other" , it is possible to make everyone work with a single timer within the 23 min limit where each function has its own pace limit and act in accordance with the master timer would be cool. [/b]
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8516
Location: 127.0.0.1

PostPosted: Thu Sep 26, 2019 11:51 am    Post subject: Reply with quote

I assume you are referring to keeping your code thread-safe based on your wording. There are a few ways to try and do that depending on how you want to 'attach' to the game.

Generally, this would be done by hooking onto the game and finding a location that is invoked every frame. Often times, this is done through hooking the graphics API being used (ie. Direct3D, OpenGL, etc.) and using the rendering calls to ensure your code executes on the games rendering thread.

You can also hook onto other parts of the game that are known to run every frame, something like the main execution loop of the entire process. Certain engines have multiple points of entry you could hook onto depending on what the game uses.

Another useful thing that can be done is hooking/using the games own thread-safe locking mechanism if one is being used. This will be something like a critical section or mutex object that you can obtain the pointer to and invoke against to lock manually, do your stuff, then unlock.

If you hook onto the games rendering thread, or a similar function, you can use timing API to clamp your code to run on a proper 1 second tick rate as needed. An example of doing that would be something like this:

Code:

static DWORD tickCount = 0;
if ((::GetTickCount() - tickCount) >= 1000)
{
    tickCount = ::GetTickCount();

    // Execute your code here to check your personal timers, key presses, etc.
}

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Dsilencio
How do I cheat?
Reputation: 0

Joined: 26 Sep 2019
Posts: 6

PostPosted: Thu Sep 26, 2019 1:09 pm    Post subject: My purpose Reply with quote

I'm not even an expert and I don't have time to become one, I'm asking for help from people with Cheat Engine programming skills. I consider everyone who has knowledge of the tool as Gods, I humbly come to you for help.

My real goal with the Cheat engine is not to change pre-determined values ​​in a program by making use of it as a changer.
I want to use it as or what it creates which is the script as a remote control that has the functions that I put in the topic, I see that few people think of using the Cheat Engine this way and this makes my life difficult because people who deal with it uses the programmer language a lot but i'm just a mortal i don't understand the language you gods use giving me even more work.
The functions of this remote that I wanted to do is just to send the information that a key is being pressed for the program "client.exe" these keys are from "1" to "4" and the letters "A" and "D ", where they would all have a timer running so that when it gets to time X it runs without me having to run it myself.
Back to top
View user's profile Send private message
Dsilencio
How do I cheat?
Reputation: 0

Joined: 26 Sep 2019
Posts: 6

PostPosted: Sat Sep 28, 2019 9:40 am    Post subject: Reply with quote

I managed to make a script the way I want it to work but it is not in CE but AutoHotKey program but this last program can only perform its functions in active windows and not in the background so it didn't help me at all but I think for those which has an idea how to create a Lua script or an AutoAssembley script the script in AutoHotKey looks like this:

1 script
F1::
loop {
sleep, 900000
send {1 DOWN}
sleep, 100
send {1 UP}
}
return


2 script
F2::
loop {
sleep, 420000
send {2 DOWN}
sleep, 100
send {2 UP}
}
return


3 script
F3::
loop {
sleep, 1380000
send {3 DOWN}
sleep, 100
send {3 UP}
}
return


4 script
F4::
loop {
sleep, 900000
send {A DOWN}
sleep, 100
send {A UP}
send {D DOWN}
sleep, 100
send {D UP}
}
return



I don't know how to make the 4 scripts in 1 because they all have different times and when one is timed, the other must be executed my solution was to make 4 separate scripts no AutoHotKey so that after they were executed they would have their own time without having the influences others by running independently and sending information at the time set by the "sleep" command. Who has the least knowledge can write here you do not need to be a genius and know everything but if you know 1 command or if you know where I can find all the commands and their respective functions would be helping me a lot, thank you for your presence.
Back to top
View user's profile Send private message
Dsilencio
How do I cheat?
Reputation: 0

Joined: 26 Sep 2019
Posts: 6

PostPosted: Mon Oct 07, 2019 9:41 am    Post subject: Reply with quote

Making a script through CE is very difficult about make you take a while to learn how to program, I ended up migrating to a program that runs what I need called AutoIT, a much easier program to create this type of script it There are some limitations that the EC does not have, but to meet these characteristics that I put above it meets perfectly. For those who want the same just search for AutoIT on youtube and found several videos and programming is very simple and with 30min or 1h you will already be able to create an active script that sends a specific message in a specific window and at a predetermined time .


My Scripts in AutoIT

Func ()
WinActivate ("name of windows")
Send ("*******")
Send ("{tab}")
Send ("********")
send ("{enter}")
send ("{enter}")
send ("{enter}")
Sleep (5000)

WinActivate ("BloodStone - The Ancient Curse [v0.26]")

; Wait 10 seconds for the Notepad window to appear.
Local $hWnd = WinWait("[CLASS:Qt5QWindowIcon]", "", 10)

; Set the title of the Notepad window using the handle returned by WinWait.
WinSetTitle($hWnd, "", "Cavaleiro")

for $x = 1 to 204
WinActivate ("Cavaleiro")
send ("{1 down}")
sleep (250)
send ("{1 up}")
Sleep (420000)
Next

2-Func ()
WinActivate ("Cavaleiro")

for $x = 1 to 48
WinActivate ("Cavaleiro")
send ("{2 down}")
sleep (250)
send ("{2 up}")
Sleep (174000)
Sleep (870000)
Sleep (870000)
Next

3-
Func ()
WinActivate ("Cavaleiro")

for $x = 1 to 110
WinActivate ("Cavaleiro")
send ("{A down}")
sleep (100)
send ("{A up}")
sleep (150)
send ("{D down}")
sleep (100)
send ("{D up}")
Sleep (780000)
Next

4-Func()
WinActivate ("Cavaleiro")

for $x = 1 to 48
WinActivate ("Cavaleiro")
send ("{3 down}")
sleep (250)
send ("{3 up}")
sleep (600)
send ("{3 down}")
sleep (250)
send ("{3 up}")
sleep (600)
send ("{3 down}")
sleep (250)
send ("{3 up}")
sleep (600)
send ("{3 down}")
sleep (250)
send ("{3 up}")
Sleep (870000)
Sleep (870000)
Next

Now I can train my characters without having to be in front of the PC running myself and in free time I can play with my characters without being discouraged that they are too weak.
If someone who is not a programming expert does not understand how the script works, I can explain right here in the forum and what is programming is just create an account and ask your question.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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