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 


Help Me

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

Joined: 12 Mar 2018
Posts: 6
Location: thailand

PostPosted: Sat Mar 17, 2018 10:36 pm    Post subject: Help Me Reply with quote

I want Script Function Button Select Process For Trainer Crying or Very sad Crying or Very sad

I do not want
AutoAttachList

Help me Confused Confused
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sun Mar 18, 2018 12:10 am    Post subject: Reply with quote

Try :

Code:
function GetTheProcessList()
 local T = {}
 local SL=createStringlist()
 getProcesslist(SL)
   for i=0,strings_getCount(SL)-1 do
      T[i] = strings_getString(SL,i)
   end
  return T
end

function GetPros(sender)
 local PL = GetTheProcessList()
 local S = {}
 local variable = drop.text
 list.Clear()
 for x = 0, #PL do
  if variable == "All" then
    list.Items.Add(PL[x])
  else
   if string.sub(PL[x],10) == variable then
    list.Items.Add(PL[x])
   end
  end
 end
end

function OpenPro()
 local a = list.ItemIndex
 if a ~= -1 then
  local b = string.sub(list.Items[a],0,8)
  b = tonumber(b,16)
  openProcess(b)
 else
  print("Nothing")
 end
end

fo = createForm()
fo.Height = 330
fo.Width = 200
fo.Position = poScreenCenter

list = createListBox(fo)
list.Left = 20
list.Top = 20
list.Width = fo.Width - (list.Left*2)
list.Height = 200

b = createButton(fo)
b.Top = 260
b.Caption = "Get Pro's"
b.Left = 20
b.OnClick = GetPros

b2 = createButton(fo)
b2.Top = 260
b2.Caption = "Attach"
b2.Left = 105
b2.OnClick = OpenPro

drop = createComboBox(fo)
drop.Width = list.Width
drop.Top = 230
drop.Left = 20
drop.Text = "All"
drop.Items.Add('All')
drop.Items.Add('firefox.exe')
drop.Items.Add('chrome.exe')
drop.Items.Add('opera.exe')
drop.Items.Add('notepad.exe')
drop.Items.Add('calc.exe')


Note : There are others simple way to do this, hope someone post it....

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

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Sun Mar 18, 2018 6:54 am    Post subject: This post has 1 review(s) Reply with quote

One liner: getMainForm().sbOpenProcess.doClick()

simple:
Code:
-- demo form creation, skip if using custom form
if fo then fo.destroy() end
fo = createForm() -- CETrainer
fo.Height = 50
fo.Width = 400
fo.Position = poScreenCenter

drop = createComboBox(fo) --  CETrainer.CEComboBox1
drop.Width = fo.Width
drop.Top = (fo.Height-drop.Height)/2
drop.Text = "All"
drop.Font = getLuaEngine().mScript.Font -- make monospace based on lua engine script's font
drop.ReadOnly = true
-- end of demo form creation

drop.Items.clear()
getProcesslist(drop.Items)

drop.OnChange = function(sender)
  local proc = sender.Items[sender.ItemIndex]
  local idString, name = proc:match('(%x+)%-(%w+)')
  local id = tonumber(idString,16)
  openProcess(id)
end


slightly more complicated: https://pastebin.com/QzDrPbDm

_________________
https://github.com/FreeER/ has a few CE related repos
Back to top
View user's profile Send private message
rikku007
How do I cheat?
Reputation: 0

Joined: 12 Mar 2018
Posts: 6
Location: thailand

PostPosted: Mon Mar 19, 2018 1:17 am    Post subject: Reply with quote

thank you everyone Very Happy 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