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 


Simple Trainer Making script.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Wed May 08, 2013 6:31 pm    Post subject: Simple Trainer Making script. This post has 1 review(s) Reply with quote

Well,
This is an simple trainer script.

Recommended tools:
Notepad++

Required tools/stuff:
Eyes.exe
Brain.exe
Your hacks.

Notes:
This was written mainly/only for Assembly hacks, and/or LUA functions (that activate your hacks).
Improved script (with disable option too).

http://forum.cheatengine.org/viewtopic.php?p=5473302#5473302

Steps:
Copy the code below,
Paste in notepad++ (recommended ALOT again)
Edit the setHack_Information()


Code:
function setHack_Information()
--################################################--
--########### Trainer Appearance edit ############--
--################################################--
--Trainer Name
control_setCaption(ht[1], '*Game* Hacks! - Created using Cheat Engine')
--Edit Credits Text
control_setCaption(ht[1.1], 'Hack was made by ...')
--Edit Title Text
control_setCaption(ht[1.2], 'Game Title...')
--Edit video url if you got (put them between the "") , if you don't keep it as "".
--DO NOT FORGET to add http://
VideoURL = ""
--############################################--
--
--
--################################################--
--######### Hacks Assembly, and details ##########--
--################################################--
--################################################--
-- Place here your enabling assembly scripts and/or self functions.


-- Place here your disabling assembly scripts and/or self functions.


-- Place here your hacks names (if you don't want to write them in the t table)


-- Place here your hack enabling success messages (if you don't want to write them in the t table)


-- Place here your hack disabling success messages (if you don't want to write them in the t table)


-- Place here your hack descriptions (if you don't want to write them in the t table)


--################################################--
-- Edit the t table entries according to what you want
-- Optinal stuff are not a must, you may use the deafults message by setting it to nil.
-- Scroll down to see an example
-- Or remove the -- from the next line and copy paste this into Cheat Engine and execute it
-- Example=1
--
t =
{
--{Hack name, Hack script/function, Hack description, Optinal* hack success message (set '' to disable),Disable Feature ("yes"/"no"), Disable Script, Disable Message (set '' to disable)}
}
end

--[[# Simple Trainer LUA Making #
   Created by DaSpamer, 09 May 2013.
   Enjoy guys                        ]]--

ht      = {}
ht[1]   = createForm(false)
ht[2]   = createPanel(ht[1])
ht[1.1] = createLabel(ht[2])
ht[1.2] = createLabel(ht[2])
ht[1.3] = createLabel(ht[2])
ht[3]   = createGroupBox(ht[2])
ht[3.1] = createLabel(ht[3])
ht[3.2] = createLabel(ht[3])
ht[3.3] = createLabel(ht[3])
ht[3.4] = createLabel(ht[3])
ht[4]   = createListBox(ht[3])
ht[5]   = createButton(ht[3])

setProperty(ht[1] , "Position", "poScreenCenter")
setProperty(ht[1] , "BorderIcons", "[biSystemMenu]")
setProperty(ht[1] , "BiDiMode", "bdLeftToRight")
setProperty(ht[1] , "Borderstyle", "bsToolWindow")
setProperty(ht[2] , "BiDiMode", "bdLeftToRight")

local FontHeight = getProperty(ht[1.2] , "Font")
setProperty(FontHeight , "Color", 0x000000FE)
setProperty(FontHeight , "Style", "[fsBold]")
setProperty(FontHeight , "Height", "20")
local FontHeight = getProperty(ht[3.1] , "Font")
setProperty(FontHeight , "Color", 0x00007F00)
setProperty(FontHeight , "Style", "[fsBold]")
setProperty(FontHeight , "Height", "16")
local FontHeight = getProperty(ht[3.3] , "Font")
setProperty(FontHeight , "Color", 0x00F21200)
local FontHeight = getProperty(ht[1.3] , "Font")
setProperty(FontHeight , "Color", 0x00FF0482)
setProperty(FontHeight , "Style", "[fsBold]")

control_setSize(ht[1], 400, 300)
x,y = control_getSize(ht[1])
control_setSize(ht[2], x,y)
control_setPosition(ht[1.1], 5, y-17)
control_setPosition(ht[1.3], 313, y-17)
control_setPosition(ht[1.2], 10, 2.5)
control_setSize(ht[3], x*0.965, y*0.85)
control_setPosition(ht[3], 5,y*1.095-y)
control_setCaption(ht[3], 'Hacks')
control_setPosition(ht[3.1], 5, 0)
control_setCaption(ht[3.1],'Select an hack from the list, then press enable!')
X,Y = control_getSize(ht[3])
control_setSize(ht[4], X*0.75-6, 64)
control_setPosition(ht[4],5, 20)
control_setSize(ht[5], X*0.25-6, 64)
X,Y = control_getSize(ht[4])
control_setPosition(ht[5],X+6, 20)
control_setCaption(ht[5], 'Enable')
control_setPosition(ht[3.3] ,5, Y+20)
control_setCaption(ht[3.3] , 'Selected hack description :')
control_setPosition(ht[3.4] ,5, Y+35)
control_setCaption(ht[3.4] , 'No hack was selected...')

setHack_Information()

local TeL = listbox_getItems(ht[4])
strings_clear(TeL)
check = 0
i = 0
repeat
if t[i+1]==nil then
check = 1
else
i = i+1
strings_add(TeL, t[i][1])
--Saving data
if t[i][8]==nil then t[i][8]=2 end
TempSave[i] = {}
TempSave[i][1] = t[i][1]
TempSave[i][2] = t[i][2]
TempSave[i][3] = t[i][3]
TempSave[i][4] = t[i][4]
TempSave[i][5] = t[i][5]
TempSave[i][6] = t[i][6]
TempSave[i][7] = t[i][7]
TempSave[i][8] = t[i][8]
--
check = 0
end
until check == 1


function ExecuteHacksScripts()
    HLS = listbox_getItemIndex(ht[4])

    if HLS == -1 then return end

    i = HLS+1

if t[i][5]=="no" or t[i][5]==nil and t[i][2]==nil then return showMessage(t[i][4]) end

if t[i][5]=="yes" and TempSave[i][8]==1 then

      Asm=false
      if type(t[i][6])=='string' then
      Asm = autoAssemble(t[i][6])
      elseif type(t[i][6])=='function' then
      t[i][6]() --Executes it as an function
      Asm=true
      end

      if Asm~=true then return showMessage('Hack failed to disable!') end

   --Replacing it caption and setting it as Enabled already

   t[i][1] = TempSave[i][1]
   t[i][2] = TempSave[i][2]
   t[i][3] = TempSave[i][3]
   t[i][4] = TempSave[i][4]
   t[i][5] = TempSave[i][5]
   t[i][6] = TempSave[i][6]
   t[i][7] = TempSave[i][7]
   t[i][8] = TempSave[i][8]

    local TempText
    TempText = t[i][1]
    for x = 0, strings_getCount( TeL ) - 1 do
        strings_setString( TeL, HLS, TempText )
    end

   OriginalCap=nil

   control_setCaption(ht[5], 'Enable')

   if t[i][7]=='' then
      elseif t[i][7]==nil then
      showMessage('Done disabling hack')
      else
      showMessage(t[i][7])
   end

   TempSave[i][8] = 0

end

if TempSave[i][8] == 2 then
   if type(t[i][2])=='string' then
   Asm = autoAssemble(t[i][2])
   elseif type(t[i][2])=='function' then
   t[i][2]() --Executes it as an function
   Asm=true
   elseif type(t[i][2])=='nil' then
   Asm=true
   end

   if Asm~=true then return showMessage('Hack failed to enable!') end

    --Replacing it caption and setting it as Enabled already
    local TempText
    TempText = t[i][1]..' - Enabled!'
    for x = 0, strings_getCount( TeL ) - 1 do
        local str = strings_getString( TeL, x )
        if (str == t[i][1]) then
        strings_setString( TeL, x, TempText )
        end
    end

   if t[i][5]=="yes" then control_setCaption(ht[5], 'Disable') end

   if t[i][4]=='' then
   --does nothing
      elseif t[i][4]==nil then --Display an predefined Message which is 1 line below
      showMessage('Done enabling hack')
      else
      showMessage(t[i][4])
      --Note that in Flashacking Project, I have overrided the showMessage function and its messageDialog instead.
   end

    t[i][2] = nil
    t[i][4] = 'You already enabled this hack!'

   TempSave[i][8] = 1
end

if TempSave[i][8] == 0 then TempSave[i][8] = 2 end
end

function HackDescriptionsChange()
    HLS = listbox_getItemIndex(ht[4])

    if HLS == -1 then return end

    i = HLS+1

   if t[i][3]~='' or t[i][3]~=nil then
   control_setCaption(ht[3.4],t[i][3])
   else
   control_setCaption(ht[3.4],'Theres no descriptions available about this hack')
   end

   if t[i][5]=="yes" and TempSave[i][8]==1 then control_setCaption(ht[5], 'Disable') end
   if t[i][5]=="yes" and TempSave[i][8]==2 then control_setCaption(ht[5], 'Enable') end
    if t[i][5]==nil then control_setCaption(ht[5], 'Enable') end

end


if Example==1 then
FirstHackON = [[luacall(print("Enable Success!"))]]
FirstHackOFF = [[luacall(print("Disable Success!"))]]
--
ExMsg1 = [[Hi, this an enable Example Message!]]
ExMsg2 = [[Hi, this an disable Example Message!]]
--
ExDesc = [[Second Hack
Descriptions
Yes theres 3 lines of this]]
t =
{
--{Hack name, Hack script/function, Hack description, Optinal* hack success message (set '' to disable),Disable Feature (True/False), Disable Script, Disable Message (set '' to disable)}
--if you don't want disable option you could also disable it by adding } after the Success Message param
{'First Hack'  , FirstHackON  , ExDesc , ExMsg1 , "yes" , FirstHackOFF , ExMsg2 },
{'Fir123st Hack'  , FirstHackON  , ExDesc , ExMsg1 }-- , "yes" , FirstHackOFF , ExMsg2 }
}


local TeL = listbox_getItems(ht[4])
strings_clear(TeL)
TempSave = {}
check = 0
i = 0
repeat
if t[i+1]==nil then
check = 1
else
i = i+1
strings_add(TeL, t[i][1])
--Saving data
if t[i][8]==nil then t[i][8]=2 end
TempSave[i] = {}
TempSave[i][1] = t[i][1]
TempSave[i][2] = t[i][2]
TempSave[i][3] = t[i][3]
TempSave[i][4] = t[i][4]
TempSave[i][5] = t[i][5]
TempSave[i][6] = t[i][6]
TempSave[i][7] = t[i][7]
TempSave[i][8] = t[i][8]
--
check = 0
end
until check == 1
end

function CloseProgram()
form_hide(ht[1])
--CloseCE()
end

function OpenVideoURL()
shellExecute(VideoURL)
end

if VideoURL~="" then
control_setCaption(ht[1.3], "Video Tutorial")
control_onClick(ht[1.3],OpenVideoURL)
setProperty(ht[1.3] , "Cursor", "-21")
end


form_onClose(ht[1],CloseProgram)
control_onClick(ht[5],ExecuteHacksScripts)
setMethodProperty(ht[4], "OnSelectionChange", HackDescriptionsChange)
form_show(ht[1])


Enjoy guys,
You may Rep me or post here if I helped you =).


P.S
mgr.inz.Player, if you got any suggestion to improve it, tell me Very Happy.
I bet you'd make it 10000x better =P.


Gonna try to write an trainer that will generate trainer scripts for you guys Very Happy.

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919


Last edited by DaSpamer on Sat May 11, 2013 12:15 pm; edited 3 times in total
Back to top
View user's profile Send private message
chiyoko10
Cheater
Reputation: 0

Joined: 30 Mar 2013
Posts: 35
Location: Philippines

PostPosted: Wed May 08, 2013 11:14 pm    Post subject: Reply with quote

Thank you very much bro!!
I owe you alot!
How to +rep?

_________________
Hi ! Smile
Back to top
View user's profile Send private message Yahoo Messenger
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Thu May 09, 2013 3:15 am    Post subject: Reply with quote

Np mate.
To rape press on the + or - hand that is shown under my or anyone else post username.

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
chiyoko10
Cheater
Reputation: 0

Joined: 30 Mar 2013
Posts: 35
Location: Philippines

PostPosted: Thu May 09, 2013 4:15 am    Post subject: Reply with quote

Well i dont really kinda see it
_________________
Hi ! Smile
Back to top
View user's profile Send private message Yahoo Messenger
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Thu May 09, 2013 8:50 am    Post subject: Reply with quote

Well someone asked me to make an disable option too
Alright all you gotta do is edit this:
Code:
{Hack name, Hack script/function, Hack description, Optinal* hack success message (set '' to disable),Disable Feature (True/False), Disable Script, Disable Message (set '' to disable)}

Put it under the t table (line 99)

Code:
--[[# Simple Trainer LUA Making #
   Created by DaSpamer, 09 May 2013.
   Enjoy guys                        ]]--

ht      = {}
ht[1]   = createForm()--false)
ht[2]   = createPanel(ht[1])
ht[1.1] = createLabel(ht[2])
ht[1.2] = createLabel(ht[2])
ht[3]   = createGroupBox(ht[2])
ht[3.1] = createLabel(ht[3])
ht[3.2] = createLabel(ht[3])
ht[3.3] = createLabel(ht[3])
ht[3.4] = createLabel(ht[3])
ht[4]   = createListBox(ht[3])
ht[5]   = createButton(ht[3])

setProperty(ht[1] , "Position", "poScreenCenter")
setProperty(ht[1] , "BorderIcons", "[biSystemMenu]")
setProperty(ht[1] , "BiDiMode", "bdLeftToRight")
setProperty(ht[1] , "Borderstyle", "bsToolWindow")
setProperty(ht[2] , "BiDiMode", "bdLeftToRight")

local FontHeight = getProperty(ht[1.2] , "Font")
setProperty(FontHeight , "Color", 0x000000FE)
setProperty(FontHeight , "Style", "[fsBold]")
setProperty(FontHeight , "Height", "20")
local FontHeight = getProperty(ht[3.1] , "Font")
setProperty(FontHeight , "Color", 0x00007F00)
setProperty(FontHeight , "Style", "[fsBold]")
setProperty(FontHeight , "Height", "16")
local FontHeight = getProperty(ht[3.3] , "Font")
setProperty(FontHeight , "Color", 0x00F21200)

control_setSize(ht[1], 300, 250)
x,y = control_getSize(ht[1])
control_setSize(ht[2], x,y)
control_setPosition(ht[1.1], 5, y-17)
control_setPosition(ht[1.2], 10, 2.5)
control_setSize(ht[3], x*0.965, y*0.85)
control_setPosition(ht[3], 5,y*1.095-y)
control_setCaption(ht[3], 'Hacks')
control_setPosition(ht[3.1], 5, 0)
control_setCaption(ht[3.1],'Select an hack from the list, then press enable!')
X,Y = control_getSize(ht[3])
control_setSize(ht[4], X*0.75-6, 64)
control_setPosition(ht[4],5, 20)
control_setSize(ht[5], X*0.25-6, 64)
X,Y = control_getSize(ht[4])
control_setPosition(ht[5],X+6, 20)
control_setCaption(ht[5], 'Enable')
control_setPosition(ht[3.3] ,5, Y+20)
control_setCaption(ht[3.3] , 'Selected hack description :')
control_setPosition(ht[3.4] ,5, Y+35)
control_setCaption(ht[3.4] , 'No hack was selected...')


--################################################--
--########### Trainer Appearance edit ############--
--################################################--
--Trainer Name
control_setCaption(ht[1], '*Game* Hacks! - Created using Cheat Engine')
--Edit Credits Text
control_setCaption(ht[1.1], 'Hack was made by ...')
--Edit Title Text
control_setCaption(ht[1.2], 'Game Title...')
--############################################--
--
--
--################################################--
--######### Hacks Assembly, and details ##########--
--################################################--
--################################################--
-- Place here your enabling assembly scripts and/or self functions.


-- Place here your disabling assembly scripts and/or self functions.


-- Place here your hacks names (if you don't want to write them in the t table)


-- Place here your hack enabling success messages (if you don't want to write them in the t table)


-- Place here your hack disabling success messages (if you don't want to write them in the t table)


-- Place here your hack descriptions (if you don't want to write them in the t table)


--################################################--
-- Edit the t table entries according to what you want
-- Optinal stuff are not a must, you may use the deafults message by setting it to nil.
-- Scroll down to see an example
-- Or remove the -- from the next line and copy paste this into Cheat Engine and execute it
-- Example=1
--
t =
{
--{Hack name, Hack script/function, Hack description, Optinal* hack success message (set '' to disable),Disable Feature ("yes"/"no"), Disable Script, Disable Message (set '' to disable)}
--if you don't want disable option you could also disable it by adding } after the Success Message param
}


-- Below this line, are the scripts which apply what you've edited
-- Do not edit unless you know what you're doing.
--################################################--

local TeL = listbox_getItems(ht[4])
strings_clear(TeL)
check = 0
i = 0
repeat
if t[i+1]==nil then
check = 1
else
i = i+1
strings_add(TeL, t[i][1])
--Saving data
if t[i][8]==nil then t[i][8]=2 end
TempSave[i] = {}
TempSave[i][1] = t[i][1]
TempSave[i][2] = t[i][2]
TempSave[i][3] = t[i][3]
TempSave[i][4] = t[i][4]
TempSave[i][5] = t[i][5]
TempSave[i][6] = t[i][6]
TempSave[i][7] = t[i][7]
TempSave[i][8] = t[i][8]
--
check = 0
end
until check == 1


function ExecuteHacksScripts()
    HLS = listbox_getItemIndex(ht[4])

    if HLS == -1 then return end

    i = HLS+1

if t[i][5]=="no" or t[i][5]==nil and t[i][2]==nil then return showMessage(t[i][4]) end

if t[i][5]=="yes" and TempSave[i][8]==1 then

      Asm=false
      if type(t[i][6])=='string' then
      Asm = autoAssemble(t[i][6])
      elseif type(t[i][6])=='function' then
      t[i][6]() --Executes it as an function
      Asm=true
      end

      if Asm~=true then return showMessage('Hack failed to disable!') end

   --Replacing it caption and setting it as Enabled already

   t[i][1] = TempSave[i][1]
   t[i][2] = TempSave[i][2]
   t[i][3] = TempSave[i][3]
   t[i][4] = TempSave[i][4]
   t[i][5] = TempSave[i][5]
   t[i][6] = TempSave[i][6]
   t[i][7] = TempSave[i][7]
   t[i][8] = TempSave[i][8]

    local TempText
    TempText = t[i][1]
    for x = 0, strings_getCount( TeL ) - 1 do
        strings_setString( TeL, HLS, TempText )
    end

   OriginalCap=nil

   control_setCaption(ht[5], 'Enable')

   if t[i][7]=='' then
      elseif t[i][7]==nil then
      showMessage('Done disabling hack')
      else
      showMessage(t[i][7])
   end

   TempSave[i][8] = 0

end

if TempSave[i][8] == 2 then
   if type(t[i][2])=='string' then
   Asm = autoAssemble(t[i][2])
   elseif type(t[i][2])=='function' then
   t[i][2]() --Executes it as an function
   Asm=true
   elseif type(t[i][2])=='nil' then
   Asm=true
   end

   if Asm~=true then return showMessage('Hack failed to enable!') end

    --Replacing it caption and setting it as Enabled already
    local TempText
    TempText = t[i][1]..' - Enabled!'
    for x = 0, strings_getCount( TeL ) - 1 do
        local str = strings_getString( TeL, x )
        if (str == t[i][1]) then
        strings_setString( TeL, x, TempText )
        end
    end

   if t[i][5]=="yes" then control_setCaption(ht[5], 'Disable') end

   if t[i][4]=='' then
   --does nothing
      elseif t[i][4]==nil then --Display an predefined Message which is 1 line below
      showMessage('Done enabling hack')
      else
      showMessage(t[i][4])
      --Note that in Flashacking Project, I have overrided the showMessage function and its messageDialog instead.
   end

    t[i][2] = nil
    t[i][4] = 'You already enabled this hack!'

   TempSave[i][8] = 1
end

if TempSave[i][8] == 0 then TempSave[i][8] = 2 end
end

function HackDescriptionsChange()
    HLS = listbox_getItemIndex(ht[4])

    if HLS == -1 then return end

    i = HLS+1

   if t[i][3]~='' or t[i][3]~=nil then
   control_setCaption(ht[3.4],t[i][3])
   else
   control_setCaption(ht[3.4],'Theres no descriptions available about this hack')
   end

   if t[i][5]=="yes" and TempSave[i][8]==1 then control_setCaption(ht[5], 'Disable') end
   if t[i][5]=="yes" and TempSave[i][8]==2 then control_setCaption(ht[5], 'Enable') end
    if t[i][5]==nil then control_setCaption(ht[5], 'Enable') end

end


if Example==1 then
FirstHackON = [[luacall(print("Enable Success!"))]]
FirstHackOFF = [[luacall(print("Disable Success!"))]]
--
ExMsg1 = [[Hi, this an enable Example Message!]]
ExMsg2 = [[Hi, this an disable Example Message!]]
--
ExDesc = [[Second Hack
Descriptions
Yes theres 3 lines of this]]
t =
{
--{Hack name, Hack script/function, Hack description, Optinal* hack success message (set '' to disable),Disable Feature (True/False), Disable Script, Disable Message (set '' to disable)}
--if you don't want disable option you could also disable it by adding } after the Success Message param
{'First Hack'  , FirstHackON  , ExDesc , ExMsg1 , "yes" , FirstHackOFF , ExMsg2 },
{'Fir123st Hack'  , FirstHackON  , ExDesc , ExMsg1 }-- , "yes" , FirstHackOFF , ExMsg2 }
}


local TeL = listbox_getItems(ht[4])
strings_clear(TeL)
TempSave = {}
check = 0
i = 0
repeat
if t[i+1]==nil then
check = 1
else
i = i+1
strings_add(TeL, t[i][1])
--Saving data
if t[i][8]==nil then t[i][8]=2 end
TempSave[i] = {}
TempSave[i][1] = t[i][1]
TempSave[i][2] = t[i][2]
TempSave[i][3] = t[i][3]
TempSave[i][4] = t[i][4]
TempSave[i][5] = t[i][5]
TempSave[i][6] = t[i][6]
TempSave[i][7] = t[i][7]
TempSave[i][8] = t[i][8]
--
check = 0
end
until check == 1
end

function CloseProgram()
form_hide(ht[1])
--CloseCE()
end

form_onClose(ht[1],CloseProgram)
control_onClick(ht[5],ExecuteHacksScripts)
setMethodProperty(ht[4], "OnSelectionChange", HackDescriptionsChange)

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
chiyoko10
Cheater
Reputation: 0

Joined: 30 Mar 2013
Posts: 35
Location: Philippines

PostPosted: Thu May 09, 2013 9:17 am    Post subject: Reply with quote

Simple Trainer Lua Making:100 expected near 'name'
_________________
Hi ! Smile
Back to top
View user's profile Send private message Yahoo Messenger
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Thu May 09, 2013 9:22 am    Post subject: Reply with quote

Chiyoko what?
_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
chiyoko10
Cheater
Reputation: 0

Joined: 30 Mar 2013
Posts: 35
Location: Philippines

PostPosted: Thu May 09, 2013 9:32 am    Post subject: Reply with quote

Solved!
_________________
Hi ! Smile
Back to top
View user's profile Send private message Yahoo Messenger
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Thu May 09, 2013 9:44 am    Post subject: Reply with quote

Haha great.
_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
chiyoko10
Cheater
Reputation: 0

Joined: 30 Mar 2013
Posts: 35
Location: Philippines

PostPosted: Thu May 09, 2013 9:51 am    Post subject: Reply with quote

Is positioning not included??
_________________
Hi ! Smile
Back to top
View user's profile Send private message Yahoo Messenger
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Thu May 09, 2013 9:56 am    Post subject: Reply with quote

positioning of what?
p.s
it might be really confusing.
then use this
(Just edit the setHack_Information, put inside your functions/assembly/description name or whatever).
Code:
   

    function setHack_Information()
    --################################################--
    --########### Trainer Appearance edit ############--
    --################################################--
    --Trainer Name
    control_setCaption(ht[1], '*Game* Hacks! - Created using Cheat Engine')
    --Edit Credits Text
    control_setCaption(ht[1.1], 'Hack was made by ...')
    --Edit Title Text
    control_setCaption(ht[1.2], 'Game Title...')
    --############################################--
    --
    --
    --################################################--
    --######### Hacks Assembly, and details ##########--
    --################################################--
    --################################################--
    -- Place here your enabling assembly scripts and/or self functions.
     
     
    -- Place here your disabling assembly scripts and/or self functions.
     
     
    -- Place here your hacks names (if you don't want to write them in the t table)
     
     
    -- Place here your hack enabling success messages (if you don't want to write them in the t table)
     
     
    -- Place here your hack disabling success messages (if you don't want to write them in the t table)
     
     
    -- Place here your hack descriptions (if you don't want to write them in the t table)
     
     
    --################################################--
    -- Edit the t table entries according to what you want
    -- Optinal stuff are not a must, you may use the deafults message by setting it to nil.
    -- Scroll down to see an example
    -- Or remove the -- from the next line and copy paste this into Cheat Engine and execute it
    -- Example=1
    --
    t =
    {
    --{Hack name, Hack script/function, Hack description, Optinal* hack success message (set '' to disable),Disable Feature ("yes"/"no"), Disable Script, Disable Message (set '' to disable)}
    }
    end
     
    --[[# Simple Trainer LUA Making #
   Created by DaSpamer, 09 May 2013.
   Enjoy guys                        ]]--

ht      = {}
ht[1]   = createForm()--false)
ht[2]   = createPanel(ht[1])
ht[1.1] = createLabel(ht[2])
ht[1.2] = createLabel(ht[2])
ht[3]   = createGroupBox(ht[2])
ht[3.1] = createLabel(ht[3])
ht[3.2] = createLabel(ht[3])
ht[3.3] = createLabel(ht[3])
ht[3.4] = createLabel(ht[3])
ht[4]   = createListBox(ht[3])
ht[5]   = createButton(ht[3])

setProperty(ht[1] , "Position", "poScreenCenter")
setProperty(ht[1] , "BorderIcons", "[biSystemMenu]")
setProperty(ht[1] , "BiDiMode", "bdLeftToRight")
setProperty(ht[1] , "Borderstyle", "bsToolWindow")
setProperty(ht[2] , "BiDiMode", "bdLeftToRight")

local FontHeight = getProperty(ht[1.2] , "Font")
setProperty(FontHeight , "Color", 0x000000FE)
setProperty(FontHeight , "Style", "[fsBold]")
setProperty(FontHeight , "Height", "20")
local FontHeight = getProperty(ht[3.1] , "Font")
setProperty(FontHeight , "Color", 0x00007F00)
setProperty(FontHeight , "Style", "[fsBold]")
setProperty(FontHeight , "Height", "16")
local FontHeight = getProperty(ht[3.3] , "Font")
setProperty(FontHeight , "Color", 0x00F21200)

control_setSize(ht[1], 300, 250)
x,y = control_getSize(ht[1])
control_setSize(ht[2], x,y)
control_setPosition(ht[1.1], 5, y-17)
control_setPosition(ht[1.2], 10, 2.5)
control_setSize(ht[3], x*0.965, y*0.85)
control_setPosition(ht[3], 5,y*1.095-y)
control_setCaption(ht[3], 'Hacks')
control_setPosition(ht[3.1], 5, 0)
control_setCaption(ht[3.1],'Select an hack from the list, then press enable!')
X,Y = control_getSize(ht[3])
control_setSize(ht[4], X*0.75-6, 64)
control_setPosition(ht[4],5, 20)
control_setSize(ht[5], X*0.25-6, 64)
X,Y = control_getSize(ht[4])
control_setPosition(ht[5],X+6, 20)
control_setCaption(ht[5], 'Enable')
control_setPosition(ht[3.3] ,5, Y+20)
control_setCaption(ht[3.3] , 'Selected hack description :')
control_setPosition(ht[3.4] ,5, Y+35)
control_setCaption(ht[3.4] , 'No hack was selected...')

setHack_Information()

local TeL = listbox_getItems(ht[4])
strings_clear(TeL)
TempSave = {}
check = 0
i = 0
repeat
if t[i+1]==nil then
check = 1
else
i = i+1
strings_add(TeL, t[i][1])
--Saving data
if t[i][8]==nil then t[i][8]=2 end
TempSave[i] = {}
TempSave[i][1] = t[i][1]
TempSave[i][2] = t[i][2]
TempSave[i][3] = t[i][3]
TempSave[i][4] = t[i][4]
TempSave[i][5] = t[i][5]
TempSave[i][6] = t[i][6]
TempSave[i][7] = t[i][7]
TempSave[i][8] = t[i][8]
--
check = 0
end
until check == 1


function ExecuteHacksScripts()
    HLS = listbox_getItemIndex(ht[4])

    if HLS == -1 then return end

    i = HLS+1

if t[i][5]=="no" or t[i][5]==nil and t[i][2]==nil then return showMessage(t[i][4]) end

if t[i][5]=="yes" and TempSave[i][8]==1 then

      Asm=false
      if type(t[i][6])=='string' then
      Asm = autoAssemble(t[i][6])
      elseif type(t[i][6])=='function' then
      t[i][6]() --Executes it as an function
      Asm=true
      end

      if Asm~=true then return showMessage('Hack failed to disable!') end

   --Replacing it caption and setting it as Enabled already

   t[i][1] = TempSave[i][1]
   t[i][2] = TempSave[i][2]
   t[i][3] = TempSave[i][3]
   t[i][4] = TempSave[i][4]
   t[i][5] = TempSave[i][5]
   t[i][6] = TempSave[i][6]
   t[i][7] = TempSave[i][7]
   t[i][8] = TempSave[i][8]

    local TempText
    TempText = t[i][1]
    for x = 0, strings_getCount( TeL ) - 1 do
        strings_setString( TeL, HLS, TempText )
    end

   OriginalCap=nil

   control_setCaption(ht[5], 'Enable')

   if t[i][7]=='' then
      elseif t[i][7]==nil then
      showMessage('Done disabling hack')
      else
      showMessage(t[i][7])
   end

   TempSave[i][8] = 0

end

if TempSave[i][8] == 2 then
   if type(t[i][2])=='string' then
   Asm = autoAssemble(t[i][2])
   elseif type(t[i][2])=='function' then
   t[i][2]() --Executes it as an function
   Asm=true
   elseif type(t[i][2])=='nil' then
   Asm=true
   end

   if Asm~=true then return showMessage('Hack failed to enable!') end

    --Replacing it caption and setting it as Enabled already
    local TempText
    TempText = t[i][1]..' - Enabled!'
    for x = 0, strings_getCount( TeL ) - 1 do
        local str = strings_getString( TeL, x )
        if (str == t[i][1]) then
        strings_setString( TeL, x, TempText )
        end
    end

   if t[i][5]=="yes" then control_setCaption(ht[5], 'Disable') end

   if t[i][4]=='' then
   --does nothing
      elseif t[i][4]==nil then --Display an predefined Message which is 1 line below
      showMessage('Done enabling hack')
      else
      showMessage(t[i][4])
      --Note that in Flashacking Project, I have overrided the showMessage function and its messageDialog instead.
   end

    t[i][2] = nil
    t[i][4] = 'You already enabled this hack!'

   TempSave[i][8] = 1
end

if TempSave[i][8] == 0 then TempSave[i][8] = 2 end
end

function HackDescriptionsChange()
    HLS = listbox_getItemIndex(ht[4])

    if HLS == -1 then return end

    i = HLS+1

   if t[i][3]~='' or t[i][3]~=nil then
   control_setCaption(ht[3.4],t[i][3])
   else
   control_setCaption(ht[3.4],'Theres no descriptions available about this hack')
   end

   if t[i][5]=="yes" and TempSave[i][8]==1 then control_setCaption(ht[5], 'Disable') end
   if t[i][5]=="yes" and TempSave[i][8]==2 then control_setCaption(ht[5], 'Enable') end
    if t[i][5]==nil then control_setCaption(ht[5], 'Enable') end

end


if Example==1 then
FirstHackON = [[luacall(print("Enable Success!"))]]
FirstHackOFF = [[luacall(print("Disable Success!"))]]
--
ExMsg1 = [[Hi, this an enable Example Message!]]
ExMsg2 = [[Hi, this an disable Example Message!]]
--
ExDesc = [[Second Hack
Descriptions
Yes theres 3 lines of this]]
t =
{
--{Hack name, Hack script/function, Hack description, Optinal* hack success message (set '' to disable),Disable Feature (True/False), Disable Script, Disable Message (set '' to disable)}
--if you don't want disable option you could also disable it by adding } after the Success Message param
{'First Hack'  , FirstHackON  , ExDesc , ExMsg1 , "yes" , FirstHackOFF , ExMsg2 },
{'Fir123st Hack'  , FirstHackON  , ExDesc , ExMsg1 }-- , "yes" , FirstHackOFF , ExMsg2 }
}


local TeL = listbox_getItems(ht[4])
strings_clear(TeL)
TempSave = {}
check = 0
i = 0
repeat
if t[i+1]==nil then
check = 1
else
i = i+1
strings_add(TeL, t[i][1])
--Saving data
if t[i][8]==nil then t[i][8]=2 end
TempSave[i] = {}
TempSave[i][1] = t[i][1]
TempSave[i][2] = t[i][2]
TempSave[i][3] = t[i][3]
TempSave[i][4] = t[i][4]
TempSave[i][5] = t[i][5]
TempSave[i][6] = t[i][6]
TempSave[i][7] = t[i][7]
TempSave[i][8] = t[i][8]
--
check = 0
end
until check == 1
end

function CloseProgram()
form_hide(ht[1])
--CloseCE()
end

form_onClose(ht[1],CloseProgram)
control_onClick(ht[5],ExecuteHacksScripts)
setMethodProperty(ht[4], "OnSelectionChange", HackDescriptionsChange)


_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919


Last edited by DaSpamer on Thu May 09, 2013 10:24 am; edited 1 time in total
Back to top
View user's profile Send private message
chiyoko10
Cheater
Reputation: 0

Joined: 30 Mar 2013
Posts: 35
Location: Philippines

PostPosted: Thu May 09, 2013 9:57 am    Post subject: Reply with quote

Thanks Solved!
+Rep on u!

_________________
Hi ! Smile
Back to top
View user's profile Send private message Yahoo Messenger
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Thu May 09, 2013 10:07 am    Post subject: Reply with quote

Haha thanks.
Its a bit of a mess.
Because disabling part, it mindfuked me I have no clue what I've done.

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
chiyoko10
Cheater
Reputation: 0

Joined: 30 Mar 2013
Posts: 35
Location: Philippines

PostPosted: Thu May 09, 2013 10:10 am    Post subject: Reply with quote

LoL
Your the greatest teacher of all!

_________________
Hi ! Smile
Back to top
View user's profile Send private message Yahoo Messenger
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Thu May 09, 2013 10:19 am    Post subject: Reply with quote

Say thanks to mgr.inz.Player, I learned 90% of all this from checking his scripts and from the scripts he has written for me!
Hes an legend.

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
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
Goto page 1, 2  Next
Page 1 of 2

 
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