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 server detector -alert

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
!BEWARE!
!BEWARE! Deletes post on answer
Reputation: 0

Joined: 26 Jun 2013
Posts: 56
Location: !BEWARE!

PostPosted: Sat Sep 18, 2021 7:09 am    Post subject: LUA server detector -alert Reply with quote

Im looking for something like alert when someone create server.
In Parsec app people streaming games but you need all the time looking and reloading list to catch specific game.
I would like automatic this process. The idea is:
CE will be making for every few seconds "New Scan" in looking for "Hellish Quart" string. If someone make server with this game CE should detect new text string and this is alert which I am looking for.

Im tried to find simillar working LUA but without results.
Could somebody help me with creating it?

Its how look when someone host this game. Values are dynamic and jumping after every list reload
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Birdi
Expert Cheater
Reputation: 0

Joined: 08 Jun 2020
Posts: 122
Location: Migrating

PostPosted: Sat Sep 18, 2021 4:07 pm    Post subject: Reply with quote

Considering the string is written out in bytes, just use an AOBscan to find any instances of it, then do what you want when it's found; a lua pop-up alert for yourself? Not sure the end goal here.
_________________
Trying to learn!

Add me on Discord if you want hands-on help: Birdi#0007
Back to top
View user's profile Send private message Visit poster's website
!BEWARE!
!BEWARE! Deletes post on answer
Reputation: 0

Joined: 26 Jun 2013
Posts: 56
Location: !BEWARE!

PostPosted: Sun Sep 19, 2021 2:02 am    Post subject: Reply with quote

Will try describe more precislly
On this pic we see how looks hosting games. Three players hosting Cuphead. When Parsec app detecting supported game, then automaticly adding pic and name marks. So this is anchor point, a constantly repeating thing.

We want detecting only specific games, in this example Cuphead.
So when w throw "Cuphead" string to CheatEngine we get 3 results = 3 servers.
In picture we see yellow cover of Cuphead is faded. Thats mean game is full and started. So we waiting for another, fourth host of this game. When its become we get 4 results.

And now we are back to CheatEngine. We want detecting new servers of this game. And my idea looks like:
1. CE auto scaning for every 10 seconds and repeating this process in looking for Cuphead string or bytes
2. When scaning results growing +1 thats mean someone host new game. When -1 someone ended.
3. We are looking for grownig results, so when it up. I want getting alert (a short beep or notification in tray)

And thats it. I hope wrote it clearly enough. Now needing help with creating LUA script which will be contains it
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Skyrimfus
Cheater
Reputation: 1

Joined: 17 Mar 2016
Posts: 42

PostPosted: Sun Sep 19, 2021 4:20 am    Post subject: This post has 1 review(s) Reply with quote

Code:

utf16 = false
str = "Cuphead"
count = 0

bt = utf16 and wideStringToByteTable(str) or stringToByteTable(str)

if tm then tm.destroy() end
tm = createTimer()
tm.Interval = 10000
tm.OnTimer = function()
t = AOBScan(table.unpack(bt))
if t==nil then return end
if t.Count > count then
count = t.Count
executeCodeLocalEx("Beep",800,200)
end
t.destroy()
end

This will beep if the aob scan result count is greater than the last one

Edit:made some mistakes, now it's fixed
Back to top
View user's profile Send private message
!BEWARE!
!BEWARE! Deletes post on answer
Reputation: 0

Joined: 26 Jun 2013
Posts: 56
Location: !BEWARE!

PostPosted: Sun Sep 19, 2021 5:36 am    Post subject: Reply with quote

Thank you. Already tested and works pretty good.
But found "false flag"

Cuphead with < " > making false alarm
Cuphead with < . > is a good one
00 Byte is not readed as dot in string so i dont know how to correct

Wanna also ask about mechanical structure:
When count is 5 and then drop to 3 next grow to 4. So this four will be detected or script waiting for greater than 5?
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
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