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 


New to lua and am trying to/cant make an automated script

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

Joined: 28 Apr 2017
Posts: 5

PostPosted: Fri Apr 28, 2017 11:16 am    Post subject: New to lua and am trying to/cant make an automated script Reply with quote

I got tired of halo online not saving my sensitivity so i'm looking to make a automatic script that...

loads with the game on launch (if possible)
is not visible
waits 20 seconds
sets value of 9 pointers to 9
closes

I'd like to also know how the script works too in hopes that i can get my foot in the door with CE lua scripting. Been working on probably laughable scripts that do nothing close to what the goal is. I understand the basics mostly.

Thanks for your time! I really have nowhere else to turn to besides more hours of guesswork.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Fri Apr 28, 2017 4:15 pm    Post subject: Reply with quote

Code:
myForm = createForm(false)
myForm.Height = 120
myForm.Width = 450
myForm.Caption = 'Sensitivity setter'
myForm.Position = 'poScreenCenter'
myForm.ShowInTaskBar = 'stAlways'

myLabel = createLabel(myForm)
myLabel.AnchorSideLeft.Control = myForm
myLabel.AnchorSideTop.Control = myForm
myLabel.Height = 40
myLabel.BorderSpacing.Left = 10
myLabel.BorderSpacing.Top = 10
myLabel.Caption = 'Waiting for game process...'
myLabel.Font.Color = 0x8000 --'clGreen'
myLabel.Font.Height = -32
myLabel.Font.Name = 'Tahoma'

myForm.OnClose = function() closeCE() end
myForm.show()


if setSensitivityTimer==nil then setSensitivityTimer = createTimer(myForm,false) end
setSensitivityTimer.Interval = 20000 -- milliseconds
setSensitivityTimer.OnTimer =
 function (t1)
   t1.destroy()

   -- EDIT THIS
   writeInteger()  -- pointer 1
   writeInteger()  -- pointer 2
   writeInteger()  -- pointer 3
   writeInteger()  -- pointer 4
   writeInteger()  -- pointer 5
   writeInteger()  -- pointer 6
   writeInteger()  -- pointer 7
   writeInteger()  -- pointer 8
   writeInteger()  -- pointer 9

   myLabel.Caption = 'Updated :)'
   createTimer().OnTimer = function (t2) t2.destroy(); closeCE() end
 end


function onOpenProcess(processid)
  myLabel.Caption = 'Waiting 20 seconds...'
  setSensitivityTimer.Enabled = true
end

-- EDIT THIS
getAutoAttachList().add("game process name here")


Of course you have to edit few lines.

Change
writeInteger() -- pointer 1
to
writeInteger('pointerstring 1 here', 9) -- pointer 1


If it is a float value, use writeFloat or writeDouble.


Then you can save it as CETRAINER.

_________________
Back to top
View user's profile Send private message MSN Messenger
BFTaco
How do I cheat?
Reputation: 0

Joined: 28 Apr 2017
Posts: 5

PostPosted: Sat Apr 29, 2017 10:47 am    Post subject: Reply with quote

Thank you so much! Man I was way off on getting this to work myself! I need to learn lua now. Also sorry for the late reply, I haven't had much time to myself. Ill try this as soon as I can and tell you how it works! Thanks again!
Back to top
View user's profile Send private message
BFTaco
How do I cheat?
Reputation: 0

Joined: 28 Apr 2017
Posts: 5

PostPosted: Sat Apr 29, 2017 9:04 pm    Post subject: Reply with quote

well now I have this and it works well except it doesn't change any values, i'm sorry to bother again btw but I can't tell what I did wrong. :/

Code:
 myForm = createForm(false)
myForm.Height = 120
myForm.Width = 450
myForm.Caption = 'Sensitivity setter'
myForm.Position = 'poScreenCenter'
myForm.ShowInTaskBar = 'stAlways'

myLabel = createLabel(myForm)
myLabel.AnchorSideLeft.Control = myForm
myLabel.AnchorSideTop.Control = myForm
myLabel.Height = 40
myLabel.BorderSpacing.Left = 10
myLabel.BorderSpacing.Top = 10
myLabel.Caption = 'Waiting for game process...'
myLabel.Font.Color = 0x8000 --'clGreen'
myLabel.Font.Height = -32
myLabel.Font.Name = 'Tahoma'

myForm.OnClose = function() closeCE() end
myForm.show()


if setSensitivityTimer==nil then setSensitivityTimer = createTimer(myForm,false) end
setSensitivityTimer.Interval = 1000 -- milliseconds
setSensitivityTimer.OnTimer =
 function (t1)
   t1.destroy()

   -- EDIT THIS
   writeInteger("[[eldorado.exe+0067D020]+10]", 7) -- pointer 1
   writeInteger("[[eldorado.exe+0067D0C8]+1c]", 7) -- pointer 2
   writeInteger("[[eldorado.exe+0067D1DC]+24]", 7) -- pointer 3
   writeInteger("[[eldorado.exe+0067D798]+24]", 7) -- pointer 4
   writeInteger("[[eldorado.exe+0067DAC8]+24]", 7) -- pointer 5
   writeInteger("[[eldorado.exe+0067DC08]+24]", 7) -- pointer 6
   writeInteger("[[eldorado.exe+0067DDD4]+24]", 7) -- pointer 7
   writeInteger("[[eldorado.exe+0017ADD4]+484]", 7) -- pointer 8
   writeInteger("[[eldorado.exe+0067C624]+4e4]", 7) -- pointer 9

   myLabel.Caption = 'Updated :)'
   createTimer().OnTimer = function (t2) t2.destroy(); closeCE() end
 end


function onOpenProcess(processid)
  myLabel.Caption = 'Waiting 1 seconds...'
  setSensitivityTimer.Enabled = true
end

-- EDIT THIS
getAutoAttachList().add("eldorado.exe")
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sun Apr 30, 2017 7:05 am    Post subject: Reply with quote

what happens when you open game process and execute this script:
Code:
   writeInteger("[[eldorado.exe+0067D020]+10]", 7) -- pointer 1
   writeInteger("[[eldorado.exe+0067D0C8]+1c]", 7) -- pointer 2
   writeInteger("[[eldorado.exe+0067D1DC]+24]", 7) -- pointer 3
   writeInteger("[[eldorado.exe+0067D798]+24]", 7) -- pointer 4
   writeInteger("[[eldorado.exe+0067DAC8]+24]", 7) -- pointer 5
   writeInteger("[[eldorado.exe+0067DC08]+24]", 7) -- pointer 6
   writeInteger("[[eldorado.exe+0067DDD4]+24]", 7) -- pointer 7
   writeInteger("[[eldorado.exe+0017ADD4]+484]", 7) -- pointer 8
   writeInteger("[[eldorado.exe+0067C624]+4e4]", 7) -- pointer 9



Maybe you have to wait more than 20 seconds before executing?

_________________
Back to top
View user's profile Send private message MSN Messenger
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Apr 30, 2017 8:42 am    Post subject: Reply with quote

Try removing the outside square brackets. Many people mistakenly dereference the pointer path one more time than what's necessary.
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sun Apr 30, 2017 11:20 am    Post subject: Reply with quote

True.
_________________
Back to top
View user's profile Send private message MSN Messenger
BFTaco
How do I cheat?
Reputation: 0

Joined: 28 Apr 2017
Posts: 5

PostPosted: Sun Apr 30, 2017 7:26 pm    Post subject: Reply with quote

Ok i just tested it without the brackets like so
Code:
myForm = createForm(false)
myForm.Height = 120
myForm.Width = 450
myForm.Caption = 'Sensitivity setter'
myForm.Position = 'poScreenCenter'
myForm.ShowInTaskBar = 'stAlways'

myLabel = createLabel(myForm)
myLabel.AnchorSideLeft.Control = myForm
myLabel.AnchorSideTop.Control = myForm
myLabel.Height = 40
myLabel.BorderSpacing.Left = 10
myLabel.BorderSpacing.Top = 10
myLabel.Caption = 'Waiting for game process...'
myLabel.Font.Color = 0x8000 --'clGreen'
myLabel.Font.Height = -32
myLabel.Font.Name = 'Tahoma'

myForm.OnClose = function() closeCE() end
myForm.show()


if setSensitivityTimer==nil then setSensitivityTimer = createTimer(myForm,false) end
setSensitivityTimer.Interval = 1000 -- milliseconds
setSensitivityTimer.OnTimer =
 function (t1)
   t1.destroy()

   -- EDIT THIS
   writeInteger("[eldorado.exe+0067D020]", 7) -- pointer 1
   writeInteger("[eldorado.exe+0067D0C8]", 7) -- pointer 2
   writeInteger("[eldorado.exe+0067D1DC]", 7) -- pointer 3
   writeInteger("[eldorado.exe+0067D798]", 7) -- pointer 4
   writeInteger("[eldorado.exe+0067DAC8]", 7) -- pointer 5
   writeInteger("[eldorado.exe+0067DC08]", 7) -- pointer 6
   writeInteger("[eldorado.exe+0067DDD4]", 7) -- pointer 7
   writeInteger("[eldorado.exe+0017ADD4]", 7) -- pointer 8
   writeInteger("[eldorado.exe+0067C624]", 7) -- pointer 9

   myLabel.Caption = 'Updated :)'
   createTimer().OnTimer = function (t2) t2.destroy(); closeCE() end
 end


function onOpenProcess(processid)
  myLabel.Caption = 'Waiting 1 seconds...'
  setSensitivityTimer.Enabled = true
end

-- EDIT THIS
getAutoAttachList().add("eldorado.exe")
and the funny thing is it DOES do something but not what I needed, it inverts my aim and it sets autolook centering to on. XD are the end brackets supposed to be the the offset? I did research on how the syntax goes and that's what I guessed. at least I definitely know I edited the autoattach right. My sensitivity does change any time I change any of the pointers I listed and nothing else. very odd...
*edit: just tested with no brackets and that insta-crashes the game.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sun Apr 30, 2017 7:54 pm    Post subject: Reply with quote

you are funny Very Happy try this one


Code:
   writeInteger("[eldorado.exe+0067D020]+10", 7) -- pointer 1
   writeInteger("[eldorado.exe+0067D0C8]+1c", 7) -- pointer 2
   writeInteger("[eldorado.exe+0067D1DC]+24", 7) -- pointer 3
   writeInteger("[eldorado.exe+0067D798]+24", 7) -- pointer 4
   writeInteger("[eldorado.exe+0067DAC8]+24", 7) -- pointer 5
   writeInteger("[eldorado.exe+0067DC08]+24", 7) -- pointer 6
   writeInteger("[eldorado.exe+0067DDD4]+24", 7) -- pointer 7
   writeInteger("[eldorado.exe+0017ADD4]+484", 7) -- pointer 8
   writeInteger("[eldorado.exe+0067C624]+4e4", 7) -- pointer 9

_________________
Back to top
View user's profile Send private message MSN Messenger
BFTaco
How do I cheat?
Reputation: 0

Joined: 28 Apr 2017
Posts: 5

PostPosted: Sun Apr 30, 2017 8:03 pm    Post subject: Reply with quote

YES! It works! how do I +rep you? you deserve it! Very Happy
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