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 


How Can i Combine 2 Codes

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
ProB1
Advanced Cheater
Reputation: 0

Joined: 20 Jul 2019
Posts: 77
Location: At Home

PostPosted: Sun May 03, 2020 4:58 am    Post subject: How Can i Combine 2 Codes Reply with quote

local in = UDF1.CEMemo1
local out = UDF1.CEMemo2

local e = in.lines.text:gsub(".", function(bb) return "\\" .. bb:byte() end) or in.lines.text .. "\""
local o = encodeFunction(loadstring(in.lines.text))
--------------------------------------------------------
output.Lines.Text = "decodeFunction('"..e.."'); ()"
-----------------------------------------------------------
it obfuscates UDF1.CEMemo1.lines.text ( but this Num Obf )
e obfuscates that only
i want obfuscate to of them and results at UDF1.CEMemo2.lines.text

_________________
Hitler Hey im Back Smile
Discord: ProB1#0100
Back to top
View user's profile Send private message Visit poster's website
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Sun May 03, 2020 6:35 am    Post subject: Reply with quote

Not really understand what is the matter, but:

first, check again your script:

Code:
..
local out = UDF1.CEMemo2
..
--------------------------------------------------------
output.Lines.Text = "decodeFunction('"..e.."'); ()"
-----------------------------------------------------------


Questions:
1. From where this 'output' variable name comes?
2. When 'e' has encoded?

I tried with my own:

Code:
-- without form:
txt = [[
Hello worlds
this is cheat engine
]]


local e = txt:gsub(".", function(bb) return "\\" .. bb:byte() end) or txt .. "\""
print(e)
local o = encodeFunction(loadstring(e))
print(o)
output = "decodeFunction('"..o.."'); ()"
print(output)


---- with form
input = UDF1.CEMemo1
out = UDF1.CEMemo2

input.clear()
out.clear()

function test()
 input.lines.text = txt
 local e = input.lines.text:gsub(".", function(bb) return "\\" .. bb:byte() end) or input.lines.text .. "\""
 local o = encodeFunction(loadstring(e))
 out.lines.text = "decodeFunction('"..o.."'); ()"
end

UDF1.Show()
UDF1.CEButton1.onClick = test


My own doesn't have any problems.

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
ProB1
Advanced Cheater
Reputation: 0

Joined: 20 Jul 2019
Posts: 77
Location: At Home

PostPosted: Sun May 03, 2020 10:01 am    Post subject: Reply with quote

bro i say i want combine two codes
they working already
i cant combine two of them

_________________
Hitler Hey im Back Smile
Discord: ProB1#0100
Back to top
View user's profile Send private message Visit poster's website
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Sun May 03, 2020 11:55 am    Post subject: Reply with quote

I didn't see two codes from your original script.
Sorry then, I do not understand what you want

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1549

PostPosted: Sun May 03, 2020 12:51 pm    Post subject: Reply with quote

Code:
if f then f.Destroy() f=nil end

local f = createForm()
f.Position = poDesktopCenter
f.Width = 280
f.Height = 130

local m1=createMemo(f)
m1.Height=80 m1.Left=10 m1.Top=10 m1.Width=80 m1.Lines.Text="I'm the 1. code!"
m1.WordWrap=false m1.ScrollBars="ssAutoBoth"

local m2=createMemo(f)
m2.Height=80 m2.Left=100 m2.Top=10 m2.Width=80 m2.Lines.Text="I'm the 2. code!"
m2.WordWrap=false m2.ScrollBars="ssAutoBoth"

local m3=createMemo(f)
m3.Height=80 m3.Left=190 m3.Top=10 m3.Width=80
m3.WordWrap=false m3.ScrollBars="ssAutoBoth"

local b1=createButton(f)
b1.Left=110 b1.Top=100 b1.Width=60 b1.caption="Move"

b1.OnClick=function()
m3.Lines.Add(m1.Lines.Text)
m3.Lines.Add(m2.Lines.Text)  end

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Sun May 03, 2020 5:47 pm    Post subject: Reply with quote

@Aylin, do you sure and really understand what he want?.

For me, I am not understand at all, but my guess:

For example, say:

Code:
txt = [[
Hello worlds
this is cheat engine
]]

-- from his script:

local e = txt:gsub(".", function(bb) return "\\" .. bb:byte() end) or txt .. "\""
print(e)
local o = encodeFunction(loadstring(txt))
print(o)
output = "decodeFunction('"..e.."'); ()"
print(output)

--- result:
-- print(e) -> \72\101\108\108\111\32\119\111\114\108\100\115\10\116\104\105\115\32\105\115\32\99\104\101\97\116\32\101\110\103\105\110\101\10
-- print(p) -> c-jL100001
-- print(output) -> decodeFunction('\72\101\108\108\111\32\119\111\114\108\100\115\10\116\104\105\115\32\105\115\32\99\104\101\97\116\32\101\110\103\105\110\101\10'); ()


So, which one or which part need to combine?. I am not sure with this word 'combine' in case Lua has a function in word 'concatenation' with syntax as ..

My guess, maybe he want something like this as result:

Code:
\c\-\j\L\1\0\0\0\0\1


I fell I must learn again for whole rest of my life Laughing

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1549

PostPosted: Sun May 03, 2020 6:54 pm    Post subject: Reply with quote

Corroder wrote:
@Aylin, do you sure and really understand what he want?.

I fell I must learn again for whole rest of my life Laughing


I added the last word intentionally to the quote. Nice word. Smile
As for the problem; I may not have understood what you want.
He wanted to combine the codes, I guessed.
memo1 + memo2 = memo3 Cool

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website 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