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 


Table usage
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 577

PostPosted: Sat Mar 16, 2013 6:43 pm    Post subject: Reply with quote

The OnClick had the code, nothing else. I tried the onChange no difference, but using your theme I changed to onSelect and it works great.
I got used to selecting the onClick event
Thanks

Update:

What I'm trying to accomplish with combobox(es) is to
1. Read an item address
2. If the address value is not 255 then have the item high lited the in the combobox from the value in the address
3. Be able to change the value at the address to another item in the combobox
4. If the value is 255 then write an integer of the item selected from the combobox into the address
This is code from 1 of 8 combobox(code will almost be identical)
Code:
function CEComboBox8Select(sender)
local addresslist = getAddressList()
local itembyteindex
if heroname == "Hero" then
  item8address = addresslist_getMemoryRecordByDescription(addresslist, "Hero Item 8")
elseif heroname == "Cristo" then
  item8address = addresslist_getMemoryRecordByDescription(addresslist, "Cristo Item 8")
elseif heroname == "Nara" then
  item8address = addresslist_getMemoryRecordByDescription(addresslist, "Nara Item 8")
elseif heroname == "Mara" then
  item8address = addresslist_getMemoryRecordByDescription(addresslist, "Mara Item 8")
elseif heroname == "Brey" then
  item8address = addresslist_getMemoryRecordByDescription(addresslist, "Brey Item 8")
elseif heroname == "Taloon" then
  item8address = addresslist_getMemoryRecordByDescription(addresslist, "Taloon Item 8")
elseif heroname == "Ragnar" then
  item8address = addresslist_getMemoryRecordByDescription(addresslist, "Ragnar Item 8")
elseif heroname == "Alena" then
  item8address = addresslist_getMemoryRecordByDescription(addresslist, "Alena Item 8")
else
end
item8 = tonumber(memoryrecord_getValue(item8address))
if item8 ~=255 then
   itembyteindex = combobox_getItems(item8, CheatPanel_CEComboBox8)
else itembyteindex = combobox_getItemIndex(CheatPanel_CEComboBox8)
     writeInteger(item8address, itembyteindex)
end

end

The code reads the value at the byte correctly.
The combobox isn't high lited (selected).
When an item is selected the proper index can be printed, but the value isn't written into the address.
Back to top
View user's profile Send private message Yahoo Messenger
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 577

PostPosted: Sun Mar 17, 2013 4:41 pm    Post subject: Reply with quote

Aside from the questions asked in my update I have another one which came up today.
I have another table with 14 listviews all hidden. When a radiogroup button is selected the proper listview should open. Here is the code for ths one:
Code:

function CERadioGroup1Click(sender)--this needs to be completed
indexname = radiogroup_getItemIndex(CheatPanel_CERadioGroup1)
h = radiogroup_getItems(CheatPanel_CERadioGroup1)
heroname = strings_getString(h, indexname)
local addresslist = getAddressList()
  if heroname == "1st" then
  profession1address = addresslist_getMemoryRecordByDescription(addresslist, "1st Profession")
  profession1 = memoryrecord_getValue(profession1address)
  profession1 = tonumber(profession1) + 1
  whichlist = "CheatPanel_CEListView" .. profession1
  goldtableaddress = addresslist_getMemoryRecordByDescription(addresslist, "1st Gold")
  goldtableaddress =memoryrecord_getAddressgoldtableaddress);           
print(whichlist)
   form_show(whichlist)--this doesn't work

...
end

I'm trying to make the code as generic as possible and not knowing which hero may be in the first slot. Anyway I get an access error. Whichlist is in this case CheatPanel_CEListView11 and appears that should work in the form_show but it doesn't.
Back to top
View user's profile Send private message Yahoo 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
Goto page Previous  1, 2
Page 2 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