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 


[Lua Form]Disable all checkboxes [solved]

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Frouk
Expert Cheater
Reputation: 1

Joined: 22 Jun 2021
Posts: 237

PostPosted: Sat Oct 09, 2021 9:05 am    Post subject: [Lua Form]Disable all checkboxes [solved] Reply with quote

I want to disable all checkboxes and execute function while disabling
I tried this:
Code:
for i,v in pairs(checkbox) do
checkbox[i].Checked = false
end

Which is failing

_________________
void(*Haxing)(int Game)


Last edited by Frouk on Sat Oct 09, 2021 12:00 pm; edited 1 time in total
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 422

Joined: 09 May 2003
Posts: 24042
Location: The netherlands

PostPosted: Sat Oct 09, 2021 10:59 am    Post subject: Reply with quote

try v.Checked=false

and make sure the script can deactivate.

and set the code in the OnChange event, not OnClick

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Frouk
Expert Cheater
Reputation: 1

Joined: 22 Jun 2021
Posts: 237

PostPosted: Sat Oct 09, 2021 11:49 am    Post subject: Reply with quote

^
I've tried,but didn't helped(btw checkboxes are OnChange event)

EDIT:
I've puted script in disable section (means that while closing form, on close function jumps into disable section, but ignoring checkboxes)

_________________
void(*Haxing)(int Game)
Back to top
View user's profile Send private message
ByTransient
Expert Cheater
Reputation: 3

Joined: 05 Sep 2020
Posts: 234

PostPosted: Sat Oct 09, 2021 1:58 pm    Post subject: Reply with quote

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

btn1=createButton(f) btn1.width=120
btn1.left=120 btn1.top=40 btn1.caption="ReCheck"

btn2=createButton(f) btn2.width=120
btn2.left=120 btn2.top=80 btn2.caption="CheckFalse"

btn3=createButton(f) btn3.width=120
btn3.left=120 btn3.top=120 btn3.caption="FullCheckFalse"

local fLocale = {}
local cnt=0
for x = 0, 6 do
a=1 + tonumber(x)
fLocale['checkbox'..a]=createCheckBox(f)
fLocale['checkbox'..a].name='checkbox'..a
--fLocale['checkbox'..a].caption=fLocale['checkbox'..a].name
cnt=a
end

fLocale.checkbox1.caption="Hack 1"
fLocale.checkbox2.caption="Hack 2"

fLocale.checkbox1.top=10
fLocale.checkbox2.top=30
fLocale.checkbox3.top=50
fLocale.checkbox4.top=70
fLocale.checkbox5.top=90
fLocale.checkbox6.top=130
fLocale.checkbox7.top=150

btn1.OnClick=function()
for x = 1, tonumber(cnt) do
  res=fLocale['checkbox'..x]

  if res.Checked == false then
   res.Checked = true
   else
   res.Checked = false
  end
end
end

btn2.OnClick=function()
for x = 1, tonumber(cnt) do
  res=fLocale['checkbox'..x]
   res.Checked = false
end
end

local chck=1

btn3.OnClick=function()
local function test()
for x = 1, tonumber(cnt) do
  res=fLocale['checkbox'..x]

  if chck==2 then
   res.Checked = true
   btn3.caption="FullCheckFalse"
   else
   res.Checked = false
   btn3.caption="FullChecktrue"
  end
end
end
if chck==1 then
chck=2 test()
else
chck=1 test()
end
end
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