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 


RadioGruop not showing

 
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: 586

PostPosted: Thu Mar 03, 2016 4:04 pm    Post subject: RadioGruop not showing Reply with quote

Code:

trainer =    {
            Data =    {
                        Stats =   { -- Exp and level
                                    {{1,15};{2,46};{3,100};{4,185};{5,313};{6,495};{7,745};{8,1077};{9,1509};{10,2058};{11,2744};{12,3587};{13,4611};{14,5839};{15,7297};{16,9011};{17,11011};{18,13326};{19,15988};{20,19029};{21,22485};{22,26391};{23,30785};{24,35705};{25,41193};{26,47290};{27,54040};{28,61487};{29,69679};{30,78663};{31,88489};{32,99207};{33,110871};{34,123534};{35,137232};{36,152081};{37,168081};{38,185311};{39,203833};{40,223709};{41,244005};{42,267786};{43,292120};{44,318075};{45,344723};{46,375135};{47,406385};{48,439547};{49,474699};{50,511918};{51,551284};{52,592877};{53,636781};{54,683079};{55,731857};{56,783201};{57,837201};{58,893946};{59,953528};{60,1016039};{61,1081575};{62,1150231};{63,1222105};{64,1297295};{65,1375903};{66,1458030};{67,1543780};{68,1633257};{69,1726569};{70,1823823};{71,1925129};{72,2030597};{73,2140341};{74,2254474};{75,2373112};{76,2496371};{77,2624371};{78,2757231};{79,2895073};{79,2895073};{80,3038019};{81,3186195};{82,3339726};{83,3498740};{84,3663365};{85,3833733};{86,4009975};{87,4192225};{88,4380617};{89,4575289};{90,4776378};{91,4984024};{92,5198367};{93,5419551};{94,5647719};{95,5883017};{96,6125591};{97,6375591};{98,6633166};};
                                    {{1,15};{2,46};{3,100};{4,185};{5,313};{6,495};{7,745};{8,1077};{9,1509};{10,2058};{11,2744};{12,3587};{13,4611};{14,5839};{15,7297};{16,9011};{17,11011};{18,13326};{19,15988};{20,19029};{21,22485};{22,26391};{23,30785};{24,35705};{25,41193};{26,47290};{27,54040};{28,61487};{29,69679};{30,78663};{31,88489};{32,99207};{33,110871};{34,123534};{35,137232};{36,152081};{37,168081};{38,185311};{39,203833};{40,223709};{41,244005};{42,267786};{43,292120};{44,318075};{45,344723};{46,375135};{47,406385};{48,439547};{49,474699};{50,511918};{51,551284};{52,592877};{53,636781};{54,683079};{55,731857};{56,783201};{57,837201};{58,893946};{59,953528};{60,1016039};{61,1081575};{62,1150231};{63,1222105};{64,1297295};{65,1375903};{66,1458030};{67,1543780};{68,1633257};{69,1726569};{70,1823823};{71,1925129};{72,2030597};{73,2140341};{74,2254474};{75,2373112};{76,2496371};{77,2624371};{78,2757231};{79,2895073};{79,2895073};{80,3038019};{81,3186195};{82,3339726};{83,3498740};{84,3663365};{85,3833733};{86,4009975};{87,4192225};{88,4380617};{89,4575289};{90,4776378};{91,4984024};{92,5198367};{93,5419551};{94,5647719};{95,5883017};{96,6125591};{97,6375591};{98,6633166};};
                                    {{1,15};{2,46};{3,100};{4,185};{5,313};{6,495};{7,745};{8,1077};{9,1509};{10,2058};{11,2744};{12,3587};{13,4611};{14,5839};{15,7297};{16,9011};{17,11011};{18,13326};{19,15988};{20,19029};{21,22485};{22,26391};{23,30785};{24,35705};{25,41193};{26,47290};{27,54040};{28,61487};{29,69679};{30,78663};{31,88489};{32,99207};{33,110871};{34,123534};{35,137232};{36,152081};{37,168081};{38,185311};{39,203833};{40,223709};{41,244005};{42,267786};{43,292120};{44,318075};{45,344723};{46,375135};{47,406385};{48,439547};{49,474699};{50,511918};{51,551284};{52,592877};{53,636781};{54,683079};{55,731857};{56,783201};{57,837201};{58,893946};{59,953528};{60,1016039};{61,1081575};{62,1150231};{63,1222105};{64,1297295};{65,1375903};{66,1458030};{67,1543780};{68,1633257};{69,1726569};{70,1823823};{71,1925129};{72,2030597};{73,2140341};{74,2254474};{75,2373112};{76,2496371};{77,2624371};{78,2757231};{79,2895073};{79,2895073};{80,3038019};{81,3186195};{82,3339726};{83,3498740};{84,3663365};{85,3833733};{86,4009975};{87,4192225};{88,4380617};{89,4575289};{90,4776378};{91,4984024};{92,5198367};{93,5419551};{94,5647719};{95,5883017};{96,6125591};{97,6375591};{98,6633166};};
                                    {{1,15};{2,46};{3,100};{4,185};{5,313};{6,495};{7,745};{8,1077};{9,1509};{10,2058};{11,2744};{12,3587};{13,4611};{14,5839};{15,7297};{16,9011};{17,11011};{18,13326};{19,15988};{20,19029};{21,22485};{22,26391};{23,30785};{24,35705};{25,41193};{26,47290};{27,54040};{28,61487};{29,69679};{30,78663};{31,88489};{32,99207};{33,110871};{34,123534};{35,137232};{36,152081};{37,168081};{38,185311};{39,203833};{40,223709};{41,244005};{42,267786};{43,292120};{44,318075};{45,344723};{46,375135};{47,406385};{48,439547};{49,474699};{50,511918};{51,551284};{52,592877};{53,636781};{54,683079};{55,731857};{56,783201};{57,837201};{58,893946};{59,953528};{60,1016039};{61,1081575};{62,1150231};{63,1222105};{64,1297295};{65,1375903};{66,1458030};{67,1543780};{68,1633257};{69,1726569};{70,1823823};{71,1925129};{72,2030597};{73,2140341};{74,2254474};{75,2373112};{76,2496371};{77,2624371};{78,2757231};{79,2895073};{79,2895073};{80,3038019};{81,3186195};{82,3339726};{83,3498740};{84,3663365};{85,3833733};{86,4009975};{87,4192225};{88,4380617};{89,4575289};{90,4776378};{91,4984024};{92,5198367};{93,5419551};{94,5647719};{95,5883017};{96,6125591};{97,6375591};{98,6633166};};
                                    {{1,15};{2,46};{3,100};{4,185};{5,313};{6,495};{7,745};{8,1077};{9,1509};{10,2058};{11,2744};{12,3587};{13,4611};{14,5839};{15,7297};{16,9011};{17,11011};{18,13326};{19,15988};{20,19029};{21,22485};{22,26391};{23,30785};{24,35705};{25,41193};{26,47290};{27,54040};{28,61487};{29,69679};{30,78663};{31,88489};{32,99207};{33,110871};{34,123534};{35,137232};{36,152081};{37,168081};{38,185311};{39,203833};{40,223709};{41,244005};{42,267786};{43,292120};{44,318075};{45,344723};{46,375135};{47,406385};{48,439547};{49,474699};{50,511918};{51,551284};{52,592877};{53,636781};{54,683079};{55,731857};{56,783201};{57,837201};{58,893946};{59,953528};{60,1016039};{61,1081575};{62,1150231};{63,1222105};{64,1297295};{65,1375903};{66,1458030};{67,1543780};{68,1633257};{69,1726569};{70,1823823};{71,1925129};{72,2030597};{73,2140341};{74,2254474};{75,2373112};{76,2496371};{77,2624371};{78,2757231};{79,2895073};{79,2895073};{80,3038019};{81,3186195};{82,3339726};{83,3498740};{84,3663365};{85,3833733};{86,4009975};{87,4192225};{88,4380617};{89,4575289};{90,4776378};{91,4984024};{92,5198367};{93,5419551};{94,5647719};{95,5883017};{96,6125591};{97,6375591};{98,6633166};};
                                    {{1,15};{2,46};{3,100};{4,185};{5,313};{6,495};{7,745};{8,1077};{9,1509};{10,2058};{11,2744};{12,3587};{13,4611};{14,5839};{15,7297};{16,9011};{17,11011};{18,13326};{19,15988};{20,19029};{21,22485};{22,26391};{23,30785};{24,35705};{25,41193};{26,47290};{27,54040};{28,61487};{29,69679};{30,78663};{31,88489};{32,99207};{33,110871};{34,123534};{35,137232};{36,152081};{37,168081};{38,185311};{39,203833};{40,223709};{41,244005};{42,267786};{43,292120};{44,318075};{45,344723};{46,375135};{47,406385};{48,439547};{49,474699};{50,511918};{51,551284};{52,592877};{53,636781};{54,683079};{55,731857};{56,783201};{57,837201};{58,893946};{59,953528};{60,1016039};{61,1081575};{62,1150231};{63,1222105};{64,1297295};{65,1375903};{66,1458030};{67,1543780};{68,1633257};{69,1726569};{70,1823823};{71,1925129};{72,2030597};{73,2140341};{74,2254474};{75,2373112};{76,2496371};{77,2624371};{78,2757231};{79,2895073};{79,2895073};{80,3038019};{81,3186195};{82,3339726};{83,3498740};{84,3663365};{85,3833733};{86,4009975};{87,4192225};{88,4380617};{89,4575289};{90,4776378};{91,4984024};{92,5198367};{93,5419551};{94,5647719};{95,5883017};{96,6125591};{97,6375591};{98,6633166};};
                                    {{1,15};{2,46};{3,100};{4,185};{5,313};{6,495};{7,745};{8,1077};{9,1509};{10,2058};{11,2744};{12,3587};{13,4611};{14,5839};{15,7297};{16,9011};{17,11011};{18,13326};{19,15988};{20,19029};{21,22485};{22,26391};{23,30785};{24,35705};{25,41193};{26,47290};{27,54040};{28,61487};{29,69679};{30,78663};{31,88489};{32,99207};{33,110871};{34,123534};{35,137232};{36,152081};{37,168081};{38,185311};{39,203833};{40,223709};{41,244005};{42,267786};{43,292120};{44,318075};{45,344723};{46,375135};{47,406385};{48,439547};{49,474699};{50,511918};{51,551284};{52,592877};{53,636781};{54,683079};{55,731857};{56,783201};{57,837201};{58,893946};{59,953528};{60,1016039};{61,1081575};{62,1150231};{63,1222105};{64,1297295};{65,1375903};{66,1458030};{67,1543780};{68,1633257};{69,1726569};{70,1823823};{71,1925129};{72,2030597};{73,2140341};{74,2254474};{75,2373112};{76,2496371};{77,2624371};{78,2757231};{79,2895073};{79,2895073};{80,3038019};{81,3186195};{82,3339726};{83,3498740};{84,3663365};{85,3833733};{86,4009975};{87,4192225};{88,4380617};{89,4575289};{90,4776378};{91,4984024};{92,5198367};{93,5419551};{94,5647719};{95,5883017};{96,6125591};{97,6375591};{98,6633166};};
                                    {{1,15};{2,46};{3,100};{4,185};{5,313};{6,495};{7,745};{8,1077};{9,1509};{10,2058};{11,2744};{12,3587};{13,4611};{14,5839};{15,7297};{16,9011};{17,11011};{18,13326};{19,15988};{20,19029};{21,22485};{22,26391};{23,30785};{24,35705};{25,41193};{26,47290};{27,54040};{28,61487};{29,69679};{30,78663};{31,88489};{32,99207};{33,110871};{34,123534};{35,137232};{36,152081};{37,168081};{38,185311};{39,203833};{40,223709};{41,244005};{42,267786};{43,292120};{44,318075};{45,344723};{46,375135};{47,406385};{48,439547};{49,474699};{50,511918};{51,551284};{52,592877};{53,636781};{54,683079};{55,731857};{56,783201};{57,837201};{58,893946};{59,953528};{60,1016039};{61,1081575};{62,1150231};{63,1222105};{64,1297295};{65,1375903};{66,1458030};{67,1543780};{68,1633257};{69,1726569};{70,1823823};{71,1925129};{72,2030597};{73,2140341};{74,2254474};{75,2373112};{76,2496371};{77,2624371};{78,2757231};{79,2895073};{79,2895073};{80,3038019};{81,3186195};{82,3339726};{83,3498740};{84,3663365};{85,3833733};{86,4009975};{87,4192225};{88,4380617};{89,4575289};{90,4776378};{91,4984024};{92,5198367};{93,5419551};{94,5647719};{95,5883017};{96,6125591};{97,6375591};{98,6633166};};
                                    {};
                                 };

                     };
             };
goldvalue = nil;

function trainer:start()
   self.form = createForm(false); -- self = trainer since it's a function inside of a table...
   setProperty(self.form , "BiDiMode", "bdLeftToRight");
   self.form.Caption = 'Cheat Panel';
   self.form.Width = 450;
   self.form.Height = 360;
   self.form.Left = 835;
   self.form.Top =7;
   --
   self.value_panel2 = createPanel(self.form);
   self.value_panel2.Caption = '';
   self.value_panel2.left = 5;
   self.value_panel2.top = 7;
   self.value_panel2.Height = 40;
   self.value_panel2.Width = 93;
--
   self.value_panel1 = createPanel(self.form);
   self.value_panel1.Caption = '';
   self.value_panel1.left = 5;
   self.value_panel1.top = 50;
   self.value_panel1.Height = 40;
   self.value_panel1.Width = 93;
   --
   self.gold_value = createEdit(self.value_panel2);
   self.gold_value.top = 6;
   self.gold_value.left = 6;
   self.gold_value.Width = 80;
   self.gold_value.Height = 23;
   -- The line below this, allows only numbers or the - number to be entered.
   setMethodProperty(self.gold_value, "OnKeyPress", function (sender, key) local keynr = string.byte(key); if (keynr~=8) and (keynr~=45) and (keynr~=13) and ((keynr<48) or (keynr>57)) then key=nil; end if (keynr==13 and not(sender.Caption == nil or sender.Caption == '')) then key = nil; self.set_gold.onClick(); end return key; end)
--
   self.exp_value = createEdit(self.value_panel1);
   self.exp_value.top = 6;
   self.exp_value.left = 6;
   self.exp_value.Width = 80;
   self.exp_value.Height = 23;
   -- The line below this, allows only numbers or the - number to be entered.
   setMethodProperty(self.exp_value, "OnKeyPress", function (sender, key) local keynr = string.byte(key); if (keynr~=8) and (keynr~=45) and (keynr~=13) and ((keynr<48) or (keynr>57)) then key=nil; end if (keynr==13 and not(sender.Caption == nil or sender.Caption == '')) then key = nil; self.set_exp.onClick(); end return key; end)
--
   self.set_gold = createButton(self.form);
   self.set_gold.Caption = 'Enter Gold';
   self.set_gold.height = 35;
   self.set_gold.left = 144;
   self.set_gold.top = 7;
   self.set_gold.width = 150;
   self.set_gold.onClick =    function (sender)
                              local value = tonumber(self.gold_value.Caption);
                              if value then
                                 goldvalue = value;
                                 print("The gold value entered " .. goldvalue);
                                 --if expvalue and goldvalue and heroname then
                                 --   RecalculateAddresses()
                                 --end
                              end--if value then
                              self.gold_value.Caption = nil
                              end--function (sender)
--
   self.set_exp = createButton(self.form);
   self.set_exp.Caption = 'Enter Exp';
   self.set_exp.height = 35;
   self.set_exp.left = 144;
   self.set_exp.top = 52;
   self.set_exp.width = 150;
   self.set_exp.onClick =    function (sender)
                              local value = tonumber(self.exp_value.Caption);
                              if value then
                                 expvalue = value;
                                 print("The exp value entered " .. goldvalue);
                                 --if expvalue and goldvalue and heroname then
                                  --  RecalculateAddresses()
                                 --end
                              end--if value then
                              self.exp_value.Caption = nil
                              end--function (sender)
--
  characters_rg = createRadioGroup(self.form)
  characters_rg.Caption = 'Characters:'
  characters_rg.AutoSize = true
  characters_rg.Columns = 1 -- two columns (default is 1)
  characters_rg.Items.Text = 'Zidane\nVivi\nGarnet\nSteine\nFreya\nQuina\nEiko\nAmarant\nNo One' -- delimited with \n
  characters_rg.ItemIndex=8 -- select first option by default
  characters_rg.Top = 90
  characters_rg.Left = 5
--
  self.listview = createListView(self.form)
  setProperty(self.listview, 'ViewStyle', 'vsReport')
  setProperty(self.listview, 'RowSelect', 'True')
  setProperty(self.listview, 'ReadOnly', 'True')
  setProperty(self.listview, 'HideSelection', 'False')
  self.listview.top = 95;
  self.listview.width = 140;
  self.listview.left = 95;
  self.listview.height = 250;
  self.listview.onClick = function (sender)
                              local char
                              if (self.characters_rg.ItemIndex >= 0 ) then
                                 char = strings_getString(self.characters_rg.getItems(), self.characters_rg.ItemIndex);
                              end
                              local row_1 = sender.getItems().getItem(sender.getItemIndex()); -- Level
                              local row_2 = strings_getString(row_1.getSubItems(),0) + 0; -- Exp
                              if (char and row_1 and row_2) then
                                 local address_1 = addresslist_getMemoryRecordByDescription(getAddressList(), char .. ' Exp');
                                 local address_2 = addresslist_getMemoryRecordByDescription(getAddressList(), char .. ' Exp 16^6');
                                 if (address_1 and address_2) then
                                    memoryrecord_setValue(address_1, row_2 - math.floor(row_2/65536) * 65536)
                                    memoryrecord_setValue(address_2, math.floor(row_2/65536))
                                 end
                              end
                              trainer.characters_rg.setItemIndex(8);
                           end

   for character,_ in pairs(self.Data.Characters) do  --There need CHaracter Data Table
      if tonumber(character) then
         self.characters_rg.getItems().add(_);

   self.characters_rg.onClick =    function (sender)--Need Character Data Table
  self.characters_rg.onClick = function (sender)
                                    local index = strings_getString(sender.getItems(), sender.ItemIndex); -- I'm bit lazy, so sender == trainer.characters_rg
                                    local i = nil;
                                    i = self.Data.Characters[index] + 1; -- If the character does not hold the value,, i remains nil.
                                     for k,v in pairs (self.Data.Characters) do
                                        if k==index then
                                           i = v+1 -- We placed a value from 0 to 7 into the Characters name in the table.. but our stats is placed from 1 to 8 (alternative we could force the index in the table);
                                        end--if k==index then
                                    end--for k,v in pairs (self.Data.Characters) do
                                  i = 1--Set Until ChARACTER Data Table
                                  if i then
                                       heroname = index;
                                       print("The index selected is", self.Data.Characters[index]);
                                       print("The hero selected from index is ", index);
--                                       self.listview.clear();
--                                       for _,__table in pairs(self.Data.Stats[i]) do
--                                          local entry = self.listview.getItems().add();
--                                          entry.Caption = __table[1];
--                                          local subentry = entry.getSubItems().add(__table[2]);
--                                       end--for _,__table in pairs(self.Data.Stats[i]) do
--                                    end--if i then
--                                    if expvalue and goldvalue and heroname then
--                                       RecalculateAddresses()
--                                    end--if expvalue and goldvalue and heroname then
--                                   end--function (sender)
--
--
   self.form.show();
end--function trainer:start()
trainer:start();

mgr.inz.Player
Ok, that worked, here is the attempt to populate the listview (and) radio group. The list view shos, but doesn't populate with the data.


Last edited by bknight2602 on Fri Mar 04, 2016 1:42 pm; edited 3 times in total
Back to top
View user's profile Send private message Yahoo Messenger
mgr.inz.Player
I post too much
Reputation: 222

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

PostPosted: Thu Mar 03, 2016 4:26 pm    Post subject: Reply with quote

Code:
characters_rg = createRadioGroup(self.form)
characters_rg.Caption = 'Characters:'
characters_rg.AutoSize = true
characters_rg.Columns = 2 -- two columns (default is 1)
characters_rg.Items.Text = 'option1\noption2\noption3\noption4\noption5' -- delimited with \n
characters_rg.ItemIndex=0 -- select first option by default
characters_rg.Top = 80
characters_rg.Left = 5

_________________
Back to top
View user's profile Send private message MSN Messenger
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 586

PostPosted: Fri Mar 04, 2016 1:49 pm    Post subject: Reply with quote

Edited the first post instead of adding a post
Current with code plus create list view and attempting to populate it and radio group with level and experience data
The radio group and list view shows, but the listview doesn't populate with the data.
Code:

trainer =    {
            Data =    {
                   Characters = {
                                          [0] = "Zidane"; -- We will append the characters to the groupbox using value index.
                                          [1] = "Vivi";
                                          [2] = "Garnet";
                                          [3] = "Steiner";
                                          [4] = "Freya";
                                          [5] = "Quina";
                                          [6] = "Eiko";
                                          [7] = "Amarant";
                                          [8] = "No One";

                                          ["Zidane"] = 0;
                                          ["Vivi"] = 1;
                                          ["Garnet"] = 2;
                                          ["Steiner"] = 3;
                                          ["Freya"] = 4;
                                          ["Quina"] = 5;
                                          ["Eiko"] = 6;
                                          ["Amarant"] = 7;
                                          ["No One"] = 8;
                        Stats =   { -- Exp and level
                                    {{1,15};{2,46};{3,100};{4,185};{5,313};{6,495};{7,745};{8,1077};{9,1509};{10,2058};{11,2744};{12,3587};{13,4611};{14,5839};{15,7297};{16,9011};{17,11011};{18,13326};{19,15988};{20,19029};{21,22485};{22,26391};{23,30785};{24,35705};{25,41193};{26,47290};{27,54040};{28,61487};{29,69679};{30,78663};{31,88489};{32,99207};{33,110871};{34,123534};{35,137232};{36,152081};{37,168081};{38,185311};{39,203833};{40,223709};{41,244005};{42,267786};{43,292120};{44,318075};{45,344723};{46,375135};{47,406385};{48,439547};{49,474699};{50,511918};{51,551284};{52,592877};{53,636781};{54,683079};{55,731857};{56,783201};{57,837201};{58,893946};{59,953528};{60,1016039};{61,1081575};{62,1150231};{63,1222105};{64,1297295};{65,1375903};{66,1458030};{67,1543780};{68,1633257};{69,1726569};{70,1823823};{71,1925129};{72,2030597};{73,2140341};{74,2254474};{75,2373112};{76,2496371};{77,2624371};{78,2757231};{79,2895073};{79,2895073};{80,3038019};{81,3186195};{82,3339726};{83,3498740};{84,3663365};{85,3833733};{86,4009975};{87,4192225};{88,4380617};{89,4575289};{90,4776378};{91,4984024};{92,5198367};{93,5419551};{94,5647719};{95,5883017};{96,6125591};{97,6375591};{98,6633166};};
                                    {{1,15};{2,46};{3,100};{4,185};{5,313};{6,495};{7,745};{8,1077};{9,1509};{10,2058};{11,2744};{12,3587};{13,4611};{14,5839};{15,7297};{16,9011};{17,11011};{18,13326};{19,15988};{20,19029};{21,22485};{22,26391};{23,30785};{24,35705};{25,41193};{26,47290};{27,54040};{28,61487};{29,69679};{30,78663};{31,88489};{32,99207};{33,110871};{34,123534};{35,137232};{36,152081};{37,168081};{38,185311};{39,203833};{40,223709};{41,244005};{42,267786};{43,292120};{44,318075};{45,344723};{46,375135};{47,406385};{48,439547};{49,474699};{50,511918};{51,551284};{52,592877};{53,636781};{54,683079};{55,731857};{56,783201};{57,837201};{58,893946};{59,953528};{60,1016039};{61,1081575};{62,1150231};{63,1222105};{64,1297295};{65,1375903};{66,1458030};{67,1543780};{68,1633257};{69,1726569};{70,1823823};{71,1925129};{72,2030597};{73,2140341};{74,2254474};{75,2373112};{76,2496371};{77,2624371};{78,2757231};{79,2895073};{79,2895073};{80,3038019};{81,3186195};{82,3339726};{83,3498740};{84,3663365};{85,3833733};{86,4009975};{87,4192225};{88,4380617};{89,4575289};{90,4776378};{91,4984024};{92,5198367};{93,5419551};{94,5647719};{95,5883017};{96,6125591};{97,6375591};{98,6633166};};
                                    {{1,15};{2,46};{3,100};{4,185};{5,313};{6,495};{7,745};{8,1077};{9,1509};{10,2058};{11,2744};{12,3587};{13,4611};{14,5839};{15,7297};{16,9011};{17,11011};{18,13326};{19,15988};{20,19029};{21,22485};{22,26391};{23,30785};{24,35705};{25,41193};{26,47290};{27,54040};{28,61487};{29,69679};{30,78663};{31,88489};{32,99207};{33,110871};{34,123534};{35,137232};{36,152081};{37,168081};{38,185311};{39,203833};{40,223709};{41,244005};{42,267786};{43,292120};{44,318075};{45,344723};{46,375135};{47,406385};{48,439547};{49,474699};{50,511918};{51,551284};{52,592877};{53,636781};{54,683079};{55,731857};{56,783201};{57,837201};{58,893946};{59,953528};{60,1016039};{61,1081575};{62,1150231};{63,1222105};{64,1297295};{65,1375903};{66,1458030};{67,1543780};{68,1633257};{69,1726569};{70,1823823};{71,1925129};{72,2030597};{73,2140341};{74,2254474};{75,2373112};{76,2496371};{77,2624371};{78,2757231};{79,2895073};{79,2895073};{80,3038019};{81,3186195};{82,3339726};{83,3498740};{84,3663365};{85,3833733};{86,4009975};{87,4192225};{88,4380617};{89,4575289};{90,4776378};{91,4984024};{92,5198367};{93,5419551};{94,5647719};{95,5883017};{96,6125591};{97,6375591};{98,6633166};};
                                    {{1,15};{2,46};{3,100};{4,185};{5,313};{6,495};{7,745};{8,1077};{9,1509};{10,2058};{11,2744};{12,3587};{13,4611};{14,5839};{15,7297};{16,9011};{17,11011};{18,13326};{19,15988};{20,19029};{21,22485};{22,26391};{23,30785};{24,35705};{25,41193};{26,47290};{27,54040};{28,61487};{29,69679};{30,78663};{31,88489};{32,99207};{33,110871};{34,123534};{35,137232};{36,152081};{37,168081};{38,185311};{39,203833};{40,223709};{41,244005};{42,267786};{43,292120};{44,318075};{45,344723};{46,375135};{47,406385};{48,439547};{49,474699};{50,511918};{51,551284};{52,592877};{53,636781};{54,683079};{55,731857};{56,783201};{57,837201};{58,893946};{59,953528};{60,1016039};{61,1081575};{62,1150231};{63,1222105};{64,1297295};{65,1375903};{66,1458030};{67,1543780};{68,1633257};{69,1726569};{70,1823823};{71,1925129};{72,2030597};{73,2140341};{74,2254474};{75,2373112};{76,2496371};{77,2624371};{78,2757231};{79,2895073};{79,2895073};{80,3038019};{81,3186195};{82,3339726};{83,3498740};{84,3663365};{85,3833733};{86,4009975};{87,4192225};{88,4380617};{89,4575289};{90,4776378};{91,4984024};{92,5198367};{93,5419551};{94,5647719};{95,5883017};{96,6125591};{97,6375591};{98,6633166};};
                                    {{1,15};{2,46};{3,100};{4,185};{5,313};{6,495};{7,745};{8,1077};{9,1509};{10,2058};{11,2744};{12,3587};{13,4611};{14,5839};{15,7297};{16,9011};{17,11011};{18,13326};{19,15988};{20,19029};{21,22485};{22,26391};{23,30785};{24,35705};{25,41193};{26,47290};{27,54040};{28,61487};{29,69679};{30,78663};{31,88489};{32,99207};{33,110871};{34,123534};{35,137232};{36,152081};{37,168081};{38,185311};{39,203833};{40,223709};{41,244005};{42,267786};{43,292120};{44,318075};{45,344723};{46,375135};{47,406385};{48,439547};{49,474699};{50,511918};{51,551284};{52,592877};{53,636781};{54,683079};{55,731857};{56,783201};{57,837201};{58,893946};{59,953528};{60,1016039};{61,1081575};{62,1150231};{63,1222105};{64,1297295};{65,1375903};{66,1458030};{67,1543780};{68,1633257};{69,1726569};{70,1823823};{71,1925129};{72,2030597};{73,2140341};{74,2254474};{75,2373112};{76,2496371};{77,2624371};{78,2757231};{79,2895073};{79,2895073};{80,3038019};{81,3186195};{82,3339726};{83,3498740};{84,3663365};{85,3833733};{86,4009975};{87,4192225};{88,4380617};{89,4575289};{90,4776378};{91,4984024};{92,5198367};{93,5419551};{94,5647719};{95,5883017};{96,6125591};{97,6375591};{98,6633166};};
                                    {{1,15};{2,46};{3,100};{4,185};{5,313};{6,495};{7,745};{8,1077};{9,1509};{10,2058};{11,2744};{12,3587};{13,4611};{14,5839};{15,7297};{16,9011};{17,11011};{18,13326};{19,15988};{20,19029};{21,22485};{22,26391};{23,30785};{24,35705};{25,41193};{26,47290};{27,54040};{28,61487};{29,69679};{30,78663};{31,88489};{32,99207};{33,110871};{34,123534};{35,137232};{36,152081};{37,168081};{38,185311};{39,203833};{40,223709};{41,244005};{42,267786};{43,292120};{44,318075};{45,344723};{46,375135};{47,406385};{48,439547};{49,474699};{50,511918};{51,551284};{52,592877};{53,636781};{54,683079};{55,731857};{56,783201};{57,837201};{58,893946};{59,953528};{60,1016039};{61,1081575};{62,1150231};{63,1222105};{64,1297295};{65,1375903};{66,1458030};{67,1543780};{68,1633257};{69,1726569};{70,1823823};{71,1925129};{72,2030597};{73,2140341};{74,2254474};{75,2373112};{76,2496371};{77,2624371};{78,2757231};{79,2895073};{79,2895073};{80,3038019};{81,3186195};{82,3339726};{83,3498740};{84,3663365};{85,3833733};{86,4009975};{87,4192225};{88,4380617};{89,4575289};{90,4776378};{91,4984024};{92,5198367};{93,5419551};{94,5647719};{95,5883017};{96,6125591};{97,6375591};{98,6633166};};
                                    {{1,15};{2,46};{3,100};{4,185};{5,313};{6,495};{7,745};{8,1077};{9,1509};{10,2058};{11,2744};{12,3587};{13,4611};{14,5839};{15,7297};{16,9011};{17,11011};{18,13326};{19,15988};{20,19029};{21,22485};{22,26391};{23,30785};{24,35705};{25,41193};{26,47290};{27,54040};{28,61487};{29,69679};{30,78663};{31,88489};{32,99207};{33,110871};{34,123534};{35,137232};{36,152081};{37,168081};{38,185311};{39,203833};{40,223709};{41,244005};{42,267786};{43,292120};{44,318075};{45,344723};{46,375135};{47,406385};{48,439547};{49,474699};{50,511918};{51,551284};{52,592877};{53,636781};{54,683079};{55,731857};{56,783201};{57,837201};{58,893946};{59,953528};{60,1016039};{61,1081575};{62,1150231};{63,1222105};{64,1297295};{65,1375903};{66,1458030};{67,1543780};{68,1633257};{69,1726569};{70,1823823};{71,1925129};{72,2030597};{73,2140341};{74,2254474};{75,2373112};{76,2496371};{77,2624371};{78,2757231};{79,2895073};{79,2895073};{80,3038019};{81,3186195};{82,3339726};{83,3498740};{84,3663365};{85,3833733};{86,4009975};{87,4192225};{88,4380617};{89,4575289};{90,4776378};{91,4984024};{92,5198367};{93,5419551};{94,5647719};{95,5883017};{96,6125591};{97,6375591};{98,6633166};};
                                    {{1,15};{2,46};{3,100};{4,185};{5,313};{6,495};{7,745};{8,1077};{9,1509};{10,2058};{11,2744};{12,3587};{13,4611};{14,5839};{15,7297};{16,9011};{17,11011};{18,13326};{19,15988};{20,19029};{21,22485};{22,26391};{23,30785};{24,35705};{25,41193};{26,47290};{27,54040};{28,61487};{29,69679};{30,78663};{31,88489};{32,99207};{33,110871};{34,123534};{35,137232};{36,152081};{37,168081};{38,185311};{39,203833};{40,223709};{41,244005};{42,267786};{43,292120};{44,318075};{45,344723};{46,375135};{47,406385};{48,439547};{49,474699};{50,511918};{51,551284};{52,592877};{53,636781};{54,683079};{55,731857};{56,783201};{57,837201};{58,893946};{59,953528};{60,1016039};{61,1081575};{62,1150231};{63,1222105};{64,1297295};{65,1375903};{66,1458030};{67,1543780};{68,1633257};{69,1726569};{70,1823823};{71,1925129};{72,2030597};{73,2140341};{74,2254474};{75,2373112};{76,2496371};{77,2624371};{78,2757231};{79,2895073};{79,2895073};{80,3038019};{81,3186195};{82,3339726};{83,3498740};{84,3663365};{85,3833733};{86,4009975};{87,4192225};{88,4380617};{89,4575289};{90,4776378};{91,4984024};{92,5198367};{93,5419551};{94,5647719};{95,5883017};{96,6125591};{97,6375591};{98,6633166};};
                                    {};
                                   };
                                };
                      };
             };
goldvalue = nil;
expvalue = nil;
heroname = nil;

function trainer:start()
   self.form = createForm(false); -- self = trainer since it's a function inside of a table...
   setProperty(self.form , "BiDiMode", "bdLeftToRight");
   self.form.Caption = 'Cheat Panel';
   self.form.Width = 450;
   self.form.Height = 360;
   self.form.Left = 340;
   self.form.Top =7;
   --
   self.value_panel2 = createPanel(self.form);
   self.value_panel2.Caption = '';
   self.value_panel2.left = 5;
   self.value_panel2.top = 7;
   self.value_panel2.Height = 40;
   self.value_panel2.Width = 93;
--
   self.value_panel1 = createPanel(self.form);
   self.value_panel1.Caption = '';
   self.value_panel1.left = 5;
   self.value_panel1.top = 50;
   self.value_panel1.Height = 40;
   self.value_panel1.Width = 93;
   --
   self.gold_value = createEdit(self.value_panel2);
   self.gold_value.top = 6;
   self.gold_value.left = 6;
   self.gold_value.Width = 80;
   self.gold_value.Height = 23;
   -- The line below this, allows only numbers or the - number to be entered.
   setMethodProperty(self.gold_value, "OnKeyPress", function (sender, key) local keynr = string.byte(key); if (keynr~=8) and (keynr~=45) and (keynr~=13) and ((keynr<48) or (keynr>57)) then key=nil; end if (keynr==13 and not(sender.Caption == nil or sender.Caption == '')) then key = nil; self.set_gold.onClick(); end return key; end)
--
   self.exp_value = createEdit(self.value_panel1);
   self.exp_value.top = 6;
   self.exp_value.left = 6;
   self.exp_value.Width = 80;
   self.exp_value.Height = 23;
   -- The line below this, allows only numbers or the - number to be entered.
   setMethodProperty(self.exp_value, "OnKeyPress", function (sender, key) local keynr = string.byte(key); if (keynr~=8) and (keynr~=45) and (keynr~=13) and ((keynr<48) or (keynr>57)) then key=nil; end if (keynr==13 and not(sender.Caption == nil or sender.Caption == '')) then key = nil; self.set_exp.onClick(); end return key; end)
--
   self.set_gold = createButton(self.form);
   self.set_gold.Caption = 'Enter Gold';
   self.set_gold.height = 35;
   self.set_gold.left = 100;
   self.set_gold.top = 7;
   self.set_gold.width = 150;
   self.set_gold.onClick =    function (sender)
                              local value = tonumber(self.gold_value.Caption);
                              if value then
                                 goldvalue = value;
                                 print("The gold value entered " .. goldvalue);
                                 --if expvalue and goldvalue and heroname then
                                 --   RecalculateAddresses()
                                 --end
                              end--if value then
                                self.gold_value.Caption = nil
                              end--function (sender)
--
   self.set_exp = createButton(self.form);
   self.set_exp.Caption = 'Enter Exp';
   self.set_exp.height = 35;
   self.set_exp.left = 100;
   self.set_exp.top = 52;
   self.set_exp.width = 150;
   self.set_exp.onClick =    function (sender)
                              local value = tonumber(self.exp_value.Caption);
                              if value then
                                 expvalue = value;
                                 print("The exp value entered " .. goldvalue);
                                 --if expvalue and goldvalue and heroname then
                                  --  RecalculateAddresses()
                                 --end
                              end--if value then
                                self.exp_value.Caption = nil
                              end--function (sender)
--
  self.characters_rg = createRadioGroup(self.form)
  self.characters_rg.Caption = 'Characters:'
  self.characters_rg.AutoSize = true
  self.characters_rg.Columns = 1 -- two columns (default is 1)
--  characters_rg.Items.Text = 'Zidane\nVivi\nGarnet\nSteiner\nFreya\nQuina\nEiko\nAmarant\nNo One' -- delimited with \n
  self.characters_rg.setItemIndex(-1) -- select first option by default
  self.characters_rg.Top = 90
  self.characters_rg.Left = 5
  for character,_ in pairs(self.Data.Characters) do
    if tonumber(character) then
      self.characters_rg.getItems().add(_);
    end
  end--for character,_ in pairs(self.Data.Characters) do

--
  self.listview = createListView(self.form)
  setProperty(self.listview, 'ViewStyle', 'vsReport')
  setProperty(self.listview, 'RowSelect', 'True')
  setProperty(self.listview, 'ReadOnly', 'True')
  setProperty(self.listview, 'HideSelection', 'False')
  self.listview.top = 95;
  self.listview.width = 140;
  self.listview.left = 100;
  self.listview.height = 250;
  self.listview_colum1 = self.listview.getColumns().add()
  self.listview_colum1.Width = 40;
  self.listview_colum1.Caption = 'Lvl';
  self.listview_colum2 = self.listview.getColumns().add()
  self.listview_colum2.Width = 80;
  self.listview_colum2.Caption = 'Exp';

  self.listview.onClick = function (sender)
                              local char
                              if (self.characters_rg.ItemIndex >= 0 ) then
                                 char = strings_getString(self.characters_rg.getItems(), self.characters_rg.ItemIndex);
                              end
                              local row_1 = sender.getItems().getItem(sender.getItemIndex()); -- Level
                              local row_2 = strings_getString(row_1.getSubItems(),0) + 0; -- Exp
                              if (char and row_1 and row_2) then
                                 local address_1 = addresslist_getMemoryRecordByDescription(getAddressList(), char .. ' Exp');
                                 local address_2 = addresslist_getMemoryRecordByDescription(getAddressList(), char .. ' Exp 16^6');
                                 if (address_1 and address_2) then
                                    memoryrecord_setValue(address_1, row_2 - math.floor(row_2/65536) * 65536)
                                    memoryrecord_setValue(address_2, math.floor(row_2/65536))
                                 end
                              end
                              trainer.characters_rg.setItemIndex(8);
                           end--function (sender)

  self.characters_rg.onClick =    function (sender)--Need Character Data Table
                                    local index = strings_getString(sender.getItems(), sender.ItemIndex);
                                    local i = nil;
                                    i = self.Data.Characters[index] + 1; -- If the character does not hold the value,, i remains nil.
                                    if i then
                                       heroname = index;
                                       print("The index selected is", self.Data.Characters[index]);
                                       print("The hero name is ", heroname);
                                       if heroname == "No One" then  --for _,__table in pairs(self.Data.Stats[i]) do
                                         heroname = nil;
                                       else
                                       end;
                                    end;--if i then
                                    if expvalue and goldvalue and heroname then
                                       RecalculateAddresses();
                                    end;--if expvalue and goldvalue and heroname then
                                  end;--function (sender)
--
   self.form.show();
end;--function trainer:start()
--
function RecalculateAddresses(sender)

 local AL = getAddressList()
 local MS = createMemScan()
 local FL = createFoundList(MS)
   memscan_firstScan(MS,
   soExactValue, vtQword, rtRounded, goldvalue, "",
   0, 0xffffffffffffffff, "*X*C*W", fsmNotAligned, "",
   false, false, false, true)

 memscan_waitTillDone(MS)
 foundlist_initialize(FL)
 print("Num of Gold found ", foundlist_getCount(FL))

 for i = 0, foundlist_getCount(FL)-1  do
   local goldAddr_hex = foundlist_getAddress(FL, i) -- foundlist_getAddress always returns in hex without 0x
   --print("The address for Gold is ", goldAddr_hex)
   local goldAddr_dec = tonumber(goldAddr_hex, 16)   -- convert to decimal number
   --print("The num conversion for Gold address is ", goldAddr_dec)
   if string.sub(goldAddr_hex, -3) == "7EC" then
     correct_goldAddr_hex = goldAddr_hex
   end--if string.sub(memrec2, -3) == "7EC" then
 end--for i = 0, foundlist_getCount(FL)-1  do
   print("The correct address for Gold is ", correct_goldAddr_hex)
   local oldGoldAddr_hex = memoryrecord_getAddress(addresslist_getMemoryRecordByDescription(AL, "Gold x 16^4"))
   --print("The old table address for Gold is ".. oldGoldAddr_hex)
   local correction = tonumber(correct_goldAddr_hex, 16) - oldGoldAddr_hex
   print("The correction is " .. correction)
   for j=0, addresslist_getCount(AL)-1 do
     local mr = addresslist_getMemoryRecord(AL, j)
     local newAddress = memoryrecord_getAddress(mr) + correction
     memoryrecord_setAddress(mr, string.format("%x", newAddress))
   end -- loop 'for j' end

   sleep(100)
   object_destroy(FL)
   object_destroy(MS)
   print("The table has been recalculated")

 end--function RecalculateAddresses(sender)
--
trainer:start();

print("help")
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
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