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 


GroupBox question

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

Joined: 27 Sep 2018
Posts: 43

PostPosted: Sat Sep 12, 2020 8:50 am    Post subject: GroupBox question Reply with quote

Hi.
I have a GroupBox with 5 radioButton in it
Basic action is radioButton1 but some times i use 2 to 5 option
So before doing my action i manually click in the radioButton i want

But most of the time i forget to click it back to rB1 after the action and then... shithappen lol Very Happy

Is there a way in lua to "reset" the GroupBox to rB1 checked ?

And do you think i can use hotkey + and - to increase /decrease the selected rB ?

Thx.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Sat Sep 12, 2020 9:47 am    Post subject: Reply with quote

groupbox or radiogroup?

If groupbox, you can use formname.radiobuttonname1.Checked=true

if radiogroup you can do formname.radiogroup.ItemIndex=0

use a hotkey or keypress event for the increase/decrease code

_________________
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
Sanglante
Cheater
Reputation: 0

Joined: 27 Sep 2018
Posts: 43

PostPosted: Sat Sep 12, 2020 4:07 pm    Post subject: Reply with quote

thx DB i did a radiogroup but only thing working is

Code:
function resetradiobox()
  CETrainer.RadioButton1.Checked = true
end


tried this :
CETrainer.CERadioGroup1.ItemIndex = 0 but doesn't work
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1532

PostPosted: Sat Sep 12, 2020 5:28 pm    Post subject: Reply with quote

Code:
if f then f.Destroy() end

f = createForm()

rBox=createRadioGroup(f) --CETrainer.CERadioGroup1
rBox.setPosition(30,30)
rBox.AutoFill=true

lbl1=createLabel(f)
lbl1.setPosition(60,145)
lbl1.caption="Index?"

rBox.Items.Add("I index 0") --CETrainer.CERadioGroup1.Items.Add("I index 0")
rBox.Items.Add("I index 1")
rBox.Items.Add("I index 2")
rBox.Items.Add("I index 3")

local Index = rBox.ItemIndex --CETrainer.CERadioGroup1.ItemIndex
Index = -1

function Printer()
Index = rBox.ItemIndex
if Index==1 then
print("Index 1") end
if Index==3 then
print("Index 3") end
end

rBox.OnSelectionChanged=function() --function CETrainer_CERadioGroup1SelectionChanged(sender)
Index = rBox.ItemIndex
if Index==0 then
lbl1.caption="Index? 0" end
if Index==1 then
lbl1.caption="Index? 1" end
if Index==2 then
lbl1.caption="Index? 2" end
if Index==3 then
lbl1.caption="Index? 3" end
Printer()

end

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
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 Visit poster's website MSN Messenger
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