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 


Code Registration and Editing Tool

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions
View previous topic :: View next topic  
Author Message
Aylin
Master Cheater
Reputation: 7

Joined: 16 Feb 2017
Posts: 383

PostPosted: Sat Jun 29, 2019 4:47 pm    Post subject: Code Registration and Editing Tool Reply with quote

And again I,
and again a useful tool with collection codes.
First of all, I should mention the ones who contributed in the code:
Source: CEF
Code Creators and Thanks:
Grand Master: mgrInzPlayer
Grand Master: Corroder (asVCLBro)
Grand Master: DaSpamer
Grand Master: FreeER
and big thanks: CEF and DarkByte
Creator: Aylin


What is it and What does it do? Watch:
https://www.youtube.com/watch?v=XwIrCvynaY4&list=PL1yPHiegVpRoWx7jy6ecTqmbejos75O37&index=96&t=0s

What is it: Text writing and saving tool
What it does:
    Allows you to edit text.
    Automatically saves text to a Txt file.
    It lets you open a new text file.
    Saves all your text and your list continuously.


and some nice codes:

This code: Trainer will automatically open a folder at startup.
folder name: Games_Code
Code:
local sf = TrainerOrigin or getMainForm()
path = (sf.."\\Games_Code\\")
if path then
os.execute([[mkdir "]]..TrainerOrigin..[[\Games_Code"]])
end


This code will open you a txt file into the corresponding folder:
Code:
function CreateFile(sender)
txt = UDF1.CEEdit2.Text
txt = txt:gsub("%s+", "_")
if path then
local name = path..txt..".txt"
        local file = io.open(name, "wb")
        file:close()
end
end


This code is the registration code. Records the contents of txt:
Code:
function CodeSave() --Memo1
local index = 1
if path then
local settingsFile = io.open(path..UDF1.CELabel1.Caption..".txt", "w")
    if (settingsFile ~= nil) then
      settingsFile:write(control_getCaption(UDF1.CEMemo1)) --or settingsFile:write("======================\n"..date.."\n======================\n"..control_getCaption(UDF1.CEMemo1))
      settingsFile:close()
end
end
end



This code allows you to restore the text you saved:
Code:
function CodeLoad(sender)
  if path then
  name=UDF1.CEMemo2.seltext
UDF1.CELabel1.Caption = name
    local settingsFile = io.open(path..UDF1.CEMemo2.seltext..".txt", "r")
    if (settingsFile ~= nil) then
      UDF1.CEMemo1.Lines.Text = settingsFile:read("*a")
      settingsFile:close()
    end
  end
end


And Final:
Complete coding of the vehicle you are watching in the video:

Code:
RequiredCEVersion=6.8
if (getCEVersion==nil) or (getCEVersion()<RequiredCEVersion) then
local answer = messageDialog("Please install Cheat Engine-Update 6.8\nCheat Engine Yükleyin-Güncelleyin 6.8\nCheat Engine sayfasına bağlanmak istemisiniz?\nDo you want to connect to the Cheat Engine page?", mtWarning, mbYes, mbNo)
if answer == mrYes then
shellExecute("https://www.cheatengine.org/")
  closeCE()
 return caFree()
else
  closeCE()
 return caFree()
end
end

UDF1.show()

UDF1.CELabel4.Caption="To open the code page: Double-click\nthe title to from the list"

local sf = TrainerOrigin or getMainForm()
path = (sf.."\\Games_Code\\")
if path then
os.execute([[mkdir "]]..TrainerOrigin..[[\Games_Code"]])
end

local date = tostring(os.date('%d-%m-%Y / %H:%M:%S'))

function CEButton5Click(sender)
shellExecute(path)
end


UDF1.CEButton6.OnClick = function()
if UDF1.CELabel1.caption=="" then
showMessage("First open a file from the list.'Open and Save File'\nIf the file does not exist, produce it.\n'Create and Save List File'\nExisting File not found.")
else
shellExecute(path..UDF1.CELabel1.caption..[[.txt]])
end
end

UDF1.CELabel1.Caption="Code txt File";
UDF1.CEEdit2.Text="";
UDF1.CEMemo1.Lines.Text="";

function CreateFile(sender)
txt = UDF1.CEEdit2.Text
txt = txt:gsub("%s+", "_")
if path then
local name = path..txt..".txt"
        local file = io.open(name, "wb")
        file:close()
end
end

function CodeSave() --Memo1
local index = 1
if path then
local settingsFile = io.open(path..UDF1.CELabel1.Caption..".txt", "w")
    if (settingsFile ~= nil) then
      settingsFile:write("======================\n"..date.."\n======================\n"..control_getCaption(UDF1.CEMemo1))
      settingsFile:close()
end
end
end

function CodeLoad(sender)
  if path then
  name=UDF1.CEMemo2.seltext
UDF1.CELabel1.Caption = name
    local settingsFile = io.open(path..UDF1.CEMemo2.seltext..".txt", "r")
    if (settingsFile ~= nil) then
      UDF1.CEMemo1.Lines.Text = settingsFile:read("*a")
      settingsFile:close()
    end
  end
end

function ListSave(sender)
local index = 1
if path then
local settingsFile = io.open(path.."List.txt", "w") --
    if (settingsFile ~= nil) then
    settingsFile:write(control_getCaption(UDF1.CEMemo2))

    settingsFile:close()
    end
  end
end

function ListLoad(sender)
  if path then
    local settingsFile = io.open(path.. "List.txt", "r")
    if (settingsFile ~= nil) then
      UDF1.CEMemo2.Lines.Text = settingsFile:read("*a")
    settingsFile:close()
   end
  end
end
ListLoad()


function CEMemo2MouseUp(sender, button, x, y)
CodeSave()
sleep(500)
  if path then
    local settingsFile = io.open(path..UDF1.CEMemo2.SelText..".txt", "r")
    if (settingsFile ~= nil) then
      UDF1.CEMemo1.Lines.Text = settingsFile:read("*a")
sleep(500)
UDF1.CELabel1.Caption = UDF1.CEMemo2.SelText
CodeLoad()
settingsFile:close()
   end
  end
end

function CEButton2Click(sender)
   local caption = (UDF1.CEEdit2.Text):gsub(' ','_');
   for line in (UDF1.CEMemo2.Lines.Text):gmatch('[^\r\n]+') do
      if (line == caption) then
         showMessage('Name already exists in the list\npick a different one');
         return; -- end the function here
      end
   end
   UDF1.CEMemo2.Lines.Add(caption);
   ListSave()
   CreateFile()
   showMessage("Code page successfully added to list!")
end

UDF1.CEButton1.OnClick = function()
form = createForm(true)
form.Position = poDesktopCenter
form.Width = 620
form.Height = 240
form.Caption = "Creator ByKARAHANLI Trainers (2019)"
form.BorderStyle = "bsSizeable"

m1 = createMemo(form)
m1.Width=form.Width
m1.Height=form.Height

m1.Lines.Text=UDF1.CEMemo1.Lines.Text
m1.WordWrap=false
m1.ScrollBars="ssAutoBoth"

form.OnResize = function()
m1.Width=form.Width
m1.Height=form.Height
end

form.OnClose = function()
local answer = messageDialog("You're closing editing.\nDo you want to move the existing text to the main form?", mtWarning, mbYes, mbNo)
if answer == mrYes then
UDF1.CEMemo1.Lines.Text=m1.Lines.Text
form.Destroy()
else
form.Destroy()
end
end
end
--------------------------------------------------------------------------------
function CETimer1Timer(sender)
UDF1.CELabel2.Caption = tostring(os.date('Hour/ %H:%M:%S'))
UDF1.CELabel6.Caption = tostring(os.date('Date/ %d-%m-%Y '))
end

function CloseClick()
ListSave()
CodeSave()
 closeCE()
 return caFree()
end
-----------------------------------------------------------------


and Trainer: https://www.dosyaupload.com/nec1

If it works, don't forget to score +1 to the Masters.

Enjoy it Wink



Ekran 111.JPG
 Description:
 Filesize:  67.54 KB
 Viewed:  2012 Time(s)

Ekran 111.JPG



_________________
Hi Hitler Make a Youtube Web for Trainer
https://forum.cheatengine.org/viewtopic.php?t=609146
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 MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Extensions 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