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 


Need Help with lua script variable string input...

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

Joined: 23 Sep 2024
Posts: 3

PostPosted: Mon Sep 23, 2024 8:34 pm    Post subject: Need Help with lua script variable string input... Reply with quote

Hi there,

After a lot of search in the forum I managed to make the following code to work pretty good, but I need a way to have a window open saying enter your username (input username) and then after typing and pressing enter it would go to chose the color (input color) and add the color code before the name (don't know if it's even possible).

The color codes for this particular game are "^1" to "^9" each being a color so 9 colors to chose (without the ""). Example: "^1username" would look like "username" in this game.

Also I need it to be able to compile into a ".exe" so I can share if that's allowed and work stand-alone without needing cheatengine.

I don't know much about coding or Lua script Sad

My current script:
Code:
PROCESS_NAME = 'XXXXXXXXX.exe'
--------
-------- Auto Attach
--------
local autoAttachTimer = nil ---- variable to hold timer object
local autoAttachTimerInterval = 1000 ---- Timer intervals are in milliseconds
local autoAttachTimerTicks = 0 ---- variable to count number of times the timer has run
local autoAttachTimerTickMax = 5000 ---- Set to zero to disable ticks max
local function autoAttachTimer_tick(timer) ---- Timer tick call back
        ---- Destroy timer if max ticks is reached
   if autoAttachTimerTickMax > 0 and autoAttachTimerTicks >= autoAttachTimerTickMax then
      timer.destroy()
   end
        ---- Check if process is running
   if getProcessIDFromProcessName(PROCESS_NAME) ~= nil then
      timer.destroy() ---- Destroy timer
      openProcess(PROCESS_NAME) ---- Open the process
   end
   autoAttachTimerTicks = autoAttachTimerTicks + 1 ---- Increase ticks
end
autoAttachTimer = createTimer(getMainForm()) ---- Create timer with the main form as it's parent
autoAttachTimer.Interval = autoAttachTimerInterval ---- Set timer interval
autoAttachTimer.OnTimer = autoAttachTimer_tick ---- Set timer tick call back

function onOpenProcess()
local string_to_find = 'Username'
local string_to_write = '^1Username'

ms = createMemScan()
ms.firstScan(soExactValue, vtString, 0, string_to_find, "" , 0, 0xffffffffffffffff, "", fsmNotAligned, "1", false, false, false, false)
ms.waitTillDone()

f=createFoundList(ms);
f.initialize();

resultToWrite = stringToByteTable(string_to_write .. string.char(0))

for i = 0, f.Count - 1 do
  writeString(f.Address[i], string_to_write)
  writeBytes(("0x" .. f.Address[i]) + 17, 0)
end
f.destroy()
ms.destroy()
Sleep(30000) ---- Enough for this game and I like to keep it like this instead of a check
closeCE()
end


ps: also is there any easy way to make the compiled ".exe" to not be detected as virus by most antivirus???
Back to top
View user's profile Send private message
guily6669
How do I cheat?
Reputation: 0

Joined: 23 Sep 2024
Posts: 3

PostPosted: Fri Sep 27, 2024 2:40 pm    Post subject: Reply with quote

I already have it fully working, now is there any easy way to make the lua script as ".exe" to be undetected by most antivirus?

By hex editing I could only reduce the virus detection from 30 something to like 28 but still isn't enough Crying or Very sad
Back to top
View user's profile Send private message
xxhehe
Expert Cheater
Reputation: 0

Joined: 11 Mar 2015
Posts: 154

PostPosted: Fri Sep 27, 2024 7:41 pm    Post subject: Reply with quote

guily6669 wrote:
I already have it fully working, now is there any easy way to make the lua script as ".exe" to be undetected by most antivirus?

By hex editing I could only reduce the virus detection from 30 something to like 28 but still isn't enough Crying or Very sad

Lua2Exe :
attempt to call global 'getMainForm' (a nil value)

Code Obfuscation
Back to top
View user's profile Send private message
guily6669
How do I cheat?
Reputation: 0

Joined: 23 Sep 2024
Posts: 3

PostPosted: Sat Sep 28, 2024 6:45 pm    Post subject: Reply with quote

xxhehe wrote:
guily6669 wrote:
I already have it fully working, now is there any easy way to make the lua script as ".exe" to be undetected by most antivirus?

By hex editing I could only reduce the virus detection from 30 something to like 28 but still isn't enough Crying or Very sad

Lua2Exe :
attempt to call global 'getMainForm' (a nil value)

Code Obfuscation

I have made the code in C++ with the help of a friend and ChatGPT, now only 2 detection's...

But I gladly managed to make the lua script to .exe undetected at least by Microsoft antivirus.

Do you mind elaborate in a noob way or PM me please on how to reduce more the detection's of lua script from CheatEngine to executable???
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