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 


Browser auto detect script
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Ludwig
Advanced Cheater
Reputation: 0

Joined: 10 Jan 2016
Posts: 68

PostPosted: Sun Jan 10, 2016 6:44 am    Post subject: Browser auto detect script Reply with quote

I want to create a trainer that...the moment u open the trainer...it must auto detect the browser(s) u r using from the cheat engine process list getProcesslist()...not a user input...then...i want the script to test the browsers found if any of the processes got flash running...after finding the flash processes...it must test each of the processes whether or not the game is running, by scanning for an aob aobs = AOBScan(search) ...after which...when it detects the correct browser<s> thats running the game that the trainer is for, it must auto attach to keep that browser and pid in memory<getAutoAttachList().add(foundbrowser>..., i want it to auto refresh b y using doKeyPress(VK_F5) for most browsers and mayb by using
Code:
 Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.AppActivate("Fire Fox")
WshShell.SendKeys "{F5}".
on a vbs script for fire fox or IE...as those use Flash Plugin
Up to here everything is automated...no user input...
once process has been attached and game refreshed i would like to use a checkbox menu for the user to be able to choose the hacks he want
Code:
function NAMEME ()

if (checkbox_getState(NameOfForm.CheckBoxName) == 1) then

print 'CheckBox UN-Checked'

  else

print 'CheckBox Checked'
  end

end


instead of the current setup in the basic script where u can either enable 1 hack or all hacks...id rather want a list of checkboxes for the user to choose from with 1 enable button...

here is 2 basic scripts i had a look at...not my own...but i would like to incorporate some functions of both of them to make the script i need...My knowledge on Lua scripting is very limited...but by using these 2 scripts i think its do-able...
proclist3.ct can be modified to do the browser detection...basicscript.CT got a basic ce script atm...but its dependent on user input to choose the browser...i would like it automated

any help is apreciated
[/code]



basicscript.CT
 Description:

Download
 Filename:  basicscript.CT
 Filesize:  39.61 KB
 Downloaded:  720 Time(s)


proclist3.ct
 Description:

Download
 Filename:  proclist3.ct
 Filesize:  6.26 KB
 Downloaded:  654 Time(s)

Back to top
View user's profile Send private message
Ludwig
Advanced Cheater
Reputation: 0

Joined: 10 Jan 2016
Posts: 68

PostPosted: Wed Jan 13, 2016 12:32 pm    Post subject: Reply with quote

something else im strugling with on this scripts...i want to find a way to paus//freeze the loading of the game while the hacks get executed...but...for speedhack(0)...its out dated...u need to downgrade your browser<chrome or ff> and run flash version 13 or less for it to work...so not effective...and i tried the pause() unpause fuynction which is supposed to pause current active process...but nothing happens...game continue to load...is ther anything else i can use in lua script to pause //freeze//slow downt the loading process and continue when all hacks are activated...?...even ASM thats used in lua is ok...
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Wed Jan 13, 2016 2:21 pm    Post subject: Reply with quote

If nothing happens after you call pause(), then you're not attached to the right process. It works perfectly fine for me.

You can call getProcesslist() to see which browser(s) are opened. Using that information, you can get the name and PID of the process that should have the flash player on it. Then, attach to each possible process via openProcess(processid) and test to see if it has flash. One way to do this might be to check for pepflashplayer.dll via enumModules, getNameFromAddress, or other functions. If it does have flash, great, stick with that. If it doesn't, then move on to the next possible process until you do find it. If you never find it, then flash hasn't been loaded yet.

Why do you want CE to refresh the page?

As for the checkbox, here's a basic example:
Code:
local myMainF = createForm(true)
myMainF.Height = 100
myMainF.Width = 700
myMainF.centerScreen()
myMainF.OnClose = function(sender) return caFree end

local myCB1 = createCheckBox(myMainF)
myCB1.Top = 40
myCB1.Left = 60
myCB1.Caption = "Activate my pneumonoultramicroscopicsilicovolcanopsychedelicniosis supreme maximum ultra cheat"
myCB1.OnChange = function(sender)
  if sender.Checked then
    showMessage("Anti-pigeon cheat activated.")
  else
    showMessage("Anti-pigeon cheat deactivated.")
  end
end

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Ludwig
Advanced Cheater
Reputation: 0

Joined: 10 Jan 2016
Posts: 68

PostPosted: Thu Jan 14, 2016 12:19 pm    Post subject: Reply with quote

thnx...will give it a go...Smile
reason i need to refresh...ataching to rowser takes time...thus game completly loads up...after browser attached i want to give the user the checkbox options...some hacks need to be enabled tho just as game starts to load...they r not effective it swapped when game finished to load...

found an close example of a trainer...for same game im intending...
Code:
w*w*w*dropbox*com/s/0u6h27h1kj2qykd/test-Battle%20pirate-23761854-v201-20150728.rar?dl=0



peterscript.CT
 Description:

Download
 Filename:  peterscript.CT
 Filesize:  23.72 KB
 Downloaded:  652 Time(s)

Back to top
View user's profile Send private message
Ludwig
Advanced Cheater
Reputation: 0

Joined: 10 Jan 2016
Posts: 68

PostPosted: Fri Jan 22, 2016 3:25 pm    Post subject: Reply with quote

ok had a look atb the ripped script...cant get it compiled tho...but its not that neat a script...so...
looking at this for browser attach:

Code:
errorOnLookupFailure(false);
ChromeAttach =   {
                  AllProcesses = {};
                  RightProccess = function () return (getAddress("pepflashplayer.dll")~=0 or getAddress("AdobeCPGetAPI")~=0) end;
                  FindProcess = function () if (ChromeAttach.Started) then return end; if (#ChromeAttach.AllProcesses == 0) then ChromeAttach.GetChromeProcesses(); end; createNativeThread(function ()   ChromeAttach.Started = true; for k,v in pairs(ChromeAttach.AllProcesses) do openProcess(k); reinitializeSymbolhandler(); if (ChromeAttach.RightProccess()) then ChromeAttach.Function(); ChromeAttach.Started = false; break; end; end; ChromeAttach.AllProcesses = {}; ChromeAttach.Started = false; end); end;
                  GetChromeProcesses = function () local SL=createStringlist(); getProcesslist(SL); for i=0,strings_getCount(SL)-1 do local entry = strings_getString(SL,i); local processname = entry:sub(10,255); local PID = tonumber('0x'..entry:sub(1,8)); if processname:lower() == 'chrome.exe' then ChromeAttach.AllProcesses[PID] = true; end; end; end;
                  Started = false;
                  Start = function (Function) ChromeAttach.Function = Function; ChromeAttach.FindProcess();end;
                  Function = nil;
               };

ChromeAttach.Start(function () showMessage('Successfully attached!'); end)


Fluffer helped me with it...much neater...
with the code ...will it go thru each available process thats open and check if it can be attached..eg check for flash?...no user input needed...
and...can i add another check on the process and pid that i opens...i would like to do an aob check aswell to be 100% sure its the right process...

after its attached once i guess i need to use getAutoAttachList().add("the found process") to attach it...

auto refrsh i got it sorted...but not tested yet
provess pause unpause...sorted
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Fri Jan 22, 2016 5:36 pm    Post subject: Reply with quote

If you don't understand what the code you're using does, you probably shouldn't be using it. But that's just my thought.
Test it yourself to find out if it works or not. If you really want an AoB, go find one somewhere preferably outside of pepflashplayer.dll and scan for it.

Here's that code in a much more readable format:
Code:
errorOnLookupFailure(false);
ChromeAttach =   {
                  AllProcesses = {};
                 
                  RightProccess = function ()
                     return (getAddress("pepflashplayer.dll")~=0 or getAddress("AdobeCPGetAPI")~=0)
                  end;

                  FindProcess = function ()
                     if (ChromeAttach.Started) then return end
                    if (#ChromeAttach.AllProcesses == 0) then
                      ChromeAttach.GetChromeProcesses()
                    end
                    createNativeThread(function () ChromeAttach.Started = true
                      for k,v in pairs(ChromeAttach.AllProcesses) do
                        openProcess(k)
                        reinitializeSymbolhandler()
                        if (ChromeAttach.RightProccess()) then
                          ChromeAttach.Function()
                          ChromeAttach.Started = false
                          break
                        end
                      end
                      ChromeAttach.AllProcesses = {}
                      ChromeAttach.Started = false
                    end)
                  end;

                  GetChromeProcesses = function ()
                    local SL=createStringlist()
                    getProcesslist(SL)
                    for i=0,strings_getCount(SL)-1 do
                      local entry = strings_getString(SL,i)
                      local processname = entry:sub(10,255)
                      local PID = tonumber('0x'..entry:sub(1,8))
                      if processname:lower() == 'chrome.exe' then
                        ChromeAttach.AllProcesses[PID] = true
                      end
                    end
                  end;

                  Started = false;

                  Start = function (Function)
                    ChromeAttach.Function = Function
                    ChromeAttach.FindProcess()
                  end;

                  Function = nil;
               };

ChromeAttach.Start(function () showMessage('Successfully attached!'); end)

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Ludwig
Advanced Cheater
Reputation: 0

Joined: 10 Jan 2016
Posts: 68

PostPosted: Mon Jan 25, 2016 2:20 pm    Post subject: Reply with quote

Quote:
If you don't understand what the code you're using does, you probably shouldn't be using it. But that's just my thought.
Test it yourself to find out if it works or not. If you really want an AoB, go find one somewhere preferably outside of pepflashplayer.dll and scan for it.

Here's that code in a much more readable format:


thanks a lot...got it working...and understood most of what its doing aswel
the PID part got me little...but got that its basically calculating the process id...which i can call anywhere by asigning local PID=getOpenedProcessID()
how do i get the process name...eg.firefox or IE or chrome?...s i want to user the process name on a later stage for a test...<on on Firefox or IE i think they come from the same plugin process...but i need to get the browser specific name...>


ParkourPenguin wrote:


As for the checkbox, here's a basic example:
Code:
local myMainF = createForm(true)
myMainF.Height = 100
myMainF.Width = 700
myMainF.centerScreen()
myMainF.OnClose = function(sender) return caFree end

local myCB1 = createCheckBox(myMainF)
myCB1.Top = 40
myCB1.Left = 60
myCB1.Caption = "Activate my pneumonoultramicroscopicsilicovolcanopsychedelicniosis supreme maximum ultra cheat"
myCB1.OnChange = function(sender)
  if sender.Checked then
    showMessage("Anti-pigeon cheat activated.")
  else
    showMessage("Anti-pigeon cheat deactivated.")
  end
end

right understand that it creates a checkbox on a form...but i would like multiple checkboxes...onefor each hack in a list
the current hack table consist of 1 hack only...but i got plenty more
{'0_gold',[[luacall(AobswapC("d0 30 d1 5e bd 43 2b 61 bd 43 47","d0 46 84 b0 01 00 02 02 02 02 47"))]],[[o_gold]],[[-ENABLED-]], 'false', 'false'},
the first false on the end is for enabled or not...the 2nd i added to check if checkbox is checked or not

Code:

self.hacktable =    {




{'0_gold',[[luacall(AobswapC("d0 30 d1 5e bd 43 2b 61 bd 43 47","d0 46 84 b0 01 00 02 02 02 02 47"))]],[[o_gold]],[[-ENABLED-]], 'false', 'false'},



};

   for i=1,#self.hacktable do
      strings_add(self.listitems, self.hacktable[i][1]);
      self.hackstatus[i] = false;self.checkb[i] = false;
   end
end




function HackData:Info()
   self.activateall = false; -- State.
   self.hackstatus = {};
   self.checkb = {};
   self.trainer = {};
   self.trainer.form = createForm(false);
   self.trainer.form.onClose = function() showMessage("") closeCE() end;
   self.trainer.form.width = 400;
   self.trainer.form.height = 300;
    self.trainer.form.color = 0x00FF00;
    setProperty(self.trainer.form, "ShowInTaskBar", "stAlways")
   setProperty(self.trainer.form, 'Position', 'poScreenCenter');
   setProperty(self.trainer.form, 'BorderIcons', '[biSystemMenu]');
   setProperty(self.trainer.form, 'BiDiMode', 'bdLeftToRight');
   self.trainer.credits = createLabel(self.trainer.form);
   self.trainer.title = createLabel(self.trainer.form);
   local FontHeight = getProperty(self.trainer.title, 'Font');
   setProperty(FontHeight , 'Color', 0x000000FE);
   setProperty(FontHeight , 'Style', '[fsBold]');
   setProperty(FontHeight , 'Height', '20');
   self.trainer.group = createGroupBox(self.trainer.form);
   self.trainer.subtitle = createLabel(self.trainer.group);
   local FontHeight = getProperty(self.trainer.subtitle, 'Font');
   setProperty(FontHeight , 'Color', 0x00007F00);
   setProperty(FontHeight , 'Style', '[fsBold]');
   setProperty(FontHeight , 'Height', '16');
   self.trainer.desctitle = createLabel(self.trainer.group);
   local FontHeight = getProperty(self.trainer.desctitle, 'Font');
   setProperty(FontHeight , 'Color', 0x000000FE);
   setProperty(FontHeight , 'Style', '[fsBold]');


   self.trainer.desc = createLabel(self.trainer.group);


   self.trainer.list = createListBox(self.trainer.group);


   self.trainer.enable = createButton(self.trainer.group);
   self.trainer.speedenable = createButton(self.trainer.group);
   self.trainer.speeddisable = createButton(self.trainer.group);
   self.trainer.supportopen = createButton(self.trainer.group);
   self.trainer.donatebutton = createButton(self.trainer.group);
   self.trainer.enableall = createButton(self.trainer.group);
   local x,y = control_getSize(self.trainer.form);
   self.trainer.credits.left = 5;
   self.trainer.credits.top = y - 17;
   self.trainer.title.left = 10;
   self.trainer.title.top = 2.5;
   self.trainer.group.width = math.floor(x * 0.965);
   self.trainer.group.height = math.floor(y * 0.85);
   self.trainer.group.left = 5;
   self.trainer.group.top = math.floor((y * 1.095) - y);
   self.trainer.group.caption = 'Hacks';
   self.trainer.subtitle.left = 5;
   self.trainer.subtitle.top = 0;
   self.trainer.subtitle.caption = 'Select hacks from the list, then press enable!';
   local x,y = control_getSize(self.trainer.group);
   self.trainer.list.width = math.floor((x * 0.75) - 6);
   self.trainer.list.height = 64;
   self.trainer.list.left = 5;
   self.trainer.list.top = 20;

   local x,y = control_getSize(self.trainer.list);


   self.trainer.enable.width = math.floor((x * 0.34)-6);
   self.trainer.enable.height = 32;
   self.trainer.enable.left = x + 6;
   self.trainer.enable.top = 19;

   self.trainer.enable.caption = 'Enable';
   self.trainer.enable.onClick = function (sender) self:ActivateAllHacks(sender) end;

   self.trainer.enableall.width = math.floor((x * 0.34)-6);
   self.trainer.enableall.height = 32;
   self.trainer.enableall.left = x + 6;
   self.trainer.enableall.top = 53;

   self.trainer.enableall.caption = 'Enable all';
   self.trainer.enableall.onClick = function (sender) self:ActivateAllHacks(sender) end;

   self.trainer.speedenable.width = math.floor((x * 0.34)-6);
   self.trainer.speedenable.height = 32;
   self.trainer.speedenable.left = x +6;
   self.trainer.speedenable.top = 121;


   self.trainer.speedenable.caption = 'Freeze Load';
   self.trainer.speedenable.onClick = function () pause();
   showMessage("Enabled")
    control_setEnabled(self.trainer.speeddisable, true)
   end;
    control_setEnabled(self.trainer.speeddisable, false)


   self.trainer.speeddisable.width = math.floor((x * 0.34)-6);
   self.trainer.speeddisable.height = 32;
   self.trainer.speeddisable.left = x + 6;
   self.trainer.speeddisable.top = 157;


   self.trainer.speeddisable.caption = 'Resume Load';
   self.trainer.speeddisable.onClick = function ()
    unpause();
   showMessage("-RESUMED-")
    control_setEnabled(self.trainer.speeddisable, false)
   end;


   self.trainer.supportopen.width = math.floor((x * 0.34)-6);
   self.trainer.supportopen.height = 32;
   self.trainer.supportopen.left = x + 6;
   self.trainer.supportopen.top = 201;
   self.trainer.supportopen.caption = 'Help + Support';
   self.trainer.supportopen.onClick = function ()
   showMessage(" Please wait.. opening the below URL.. \n ")
   shellExecute("")
   end;
   self.trainer.donatebutton.width = math.floor((x * 0.34)-6);
   self.trainer.donatebutton.height = 32;
   self.trainer.donatebutton.left = x - 100;
   self.trainer.donatebutton.top = 201;
   self.trainer.donatebutton.caption = 'Donate';
   self.trainer.donatebutton.onClick = function ()

   end;
   self.trainer.desctitle.left = 5;
   self.trainer.desctitle.top = y + 20;
   self.trainer.desctitle.caption = 'Selected hack description :';
   self.trainer.desc.left = 5;
   self.trainer.desc.top = y + 35;
   self.trainer.desc.caption = 'No hack was selected...';

   self.listitems = self.trainer.list.getItems();
   

HackData:HacksData();
   setMethodProperty(self.trainer.list, 'OnSelectionChange', function () HackData:ChangeDesc() end)
   self.trainer.form.show();
end

function HackData:ActivateAllHacks(sender)
   self.activateall = true;
   for i = 0, #self.hacktable do
      i = i-1
      self.trainer.list.ItemIndex = i
   
      HackData:ActivateHack()
   
   end
   self.activateall = false;
end
function HackData:ActivateHack(sender)
   self.listitems = self.trainer.list.getItems();
   local index = self.trainer.list.ItemIndex + 1;
   if (index == 0 or self.hacktable[index] == nil) then
      return;
   end
if (self.checkb[index]== true then
   if (self.hackstatus[index] == false) then
      if (type(self.hacktable[index][2])=='string') then
         local asm = autoAssemble(self.hacktable[index][2]);
         if (asm == true) then
            if (AobSwapCheck~=true and AobSwapCheck~=nil) then
               AobSwapCheck=nil;
               if self.activateall == false then
                  return showMessage('Hack failed to enable!');
               else
                  return
               end
            end
            AobSwapCheck=nil;
            if self.activateall == false then
               if (self.hacktable[index][4]~='' and self.hacktable[index][4]~= nil) then
                  showMessage(self.hacktable[index][4]);
               else
                  showMessage('Hack was enabled successfully!');
               end
            end
            local str = strings_getString(self.listitems, index - 1);
            strings_setString( self.listitems, index - 1, str .. ' - Enabled!' );
            self.hackstatus[index] = true;
            HackData:ChangeDesc()
         else
            if self.activateall == false then
               return showMessage('Hack failed to enable!');
            else
               return
            end
         end
      end
   elseif (self.hackstatus[index] == true and (self.hacktable[index][5] == true or self.hacktable[index][5] == 'true') and self.activateall == false) then
      if (type(self.hacktable[index][6])=='string') then
         local asm = autoAssemble(self.hacktable[index][6]);
         if (asm == true) then
            if (AobSwapCheck~=true and AobSwapCheck~=nil) then
               AobSwapCheck=nil;
               return showMessage('Hack failed to enable!');
            end
            AobSwapCheck=nil;
            if (self.hacktable[index][7]~='' and self.hacktable[index][7]~= nil) then
               showMessage(self.hacktable[index][7]);
            else
               showMessage('Hack was disabled successfully!');
            end
            strings_setString( self.listitems, index - 1, self.hacktable[index][1] );
            self.hackstatus[index] = false;
         else
            return showMessage('Hack failed to disable!');
         end
      end
   end
   end
   HackData:ChangeDesc();
end

function HackData:ChangeDesc(sender)
   local index = self.trainer.list.ItemIndex + 1
   if (index == 0 or self.hacktable[index] == nil) then
      return
   end
   if (self.hacktable[index][3] ~= '' and self.hacktable[index][3] ~= nil) then
      self.trainer.desc.caption = self.hacktable[index][3];
   else
      self.trainer.desc.caption = "There's no descriptions available about this hack";
   end
   if (self.hackstatus[index] == true and (self.hacktable[index][5] == false or self.hacktable[index][5] == 'false')) then
      self.trainer.enableall.Enabled = false;
      self.trainer.enable.Enabled = false;
   elseif (self.hackstatus[index] == true and (self.hacktable[index][5] == true or self.hacktable[index][5] == 'true')) then
      self.trainer.enableall.Enabled = false;
      self.trainer.enable.Enabled = true;
      self.trainer.enable.Caption = 'Disable';
   else
      self.trainer.enableall.Enabled = true;
      self.trainer.enable.Enabled = true;
      self.trainer.enable.Caption = 'Enable';
   end
end
HackData:Info()
end




above code uses a listbox format which i would like to modify in basic the same list output...but a checkbox for each hack...that after selecting each hack the user wants...he can enable all selected with one button

i tried viewtopic.php?t=579440 on this forum
but on those forms i only manage to create seperate checkboxes...and im unsure of how to get the complete form code over to my trainer...
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Mon Jan 25, 2016 3:13 pm    Post subject: Reply with quote

Ludwig wrote:
how do i get the process name...eg.firefox or IE or chrome?...s i want to user the process name on a later stage for a test...
Look at the GetChromeProcesses function a bit more closely to learn how to get the name of processes (hint: the variable is called "processname"):
Code:
GetChromeProcesses = function ()
  local SL=createStringlist()
  getProcesslist(SL)
  for i=0,strings_getCount(SL)-1 do
    local entry = strings_getString(SL,i)
    local processname = entry:sub(10,255)
    local PID = tonumber('0x'..entry:sub(1,8))
    if processname:lower() == 'chrome.exe' then
      ChromeAttach.AllProcesses[PID] = true
    end
  end
end

Ludwig wrote:
right understand that it creates a checkbox on a form...but i would like multiple checkboxes...onefor each hack in a list
If you want more checkboxes, make more of them by copying and pasting the code that makes one (leave out the part that creates the forum). Set the X and Y properties to different values, and set the OnChange property to do whatever you want using my previous code as a basic template.
Ludwig wrote:
above code uses a listbox format which i would like to modify in basic the same list output...but a checkbox for each hack...that after selecting each hack the user wants...he can enable all selected with one button
So... you want a bunch of checkboxes that do absolutely nothing on their own, but when some button is pressed, it'll activate/deactivate your cheats depending on whether the checkboxes are checked or not?
If so then ignore the OnChange property of the checkboxes and set the OnClick property of the button to do that. You might need a separate boolean to decide if the cheats were already activated or deactivated when you pressed the button so you don't try to activate/deactivate it again.
Ludwig wrote:
i tried viewtopic.php?t=579440 on this forum
but on those forms i only manage to create seperate checkboxes...and im unsure of how to get the complete form code over to my trainer...
Ok, now that you've made the checkboxes, create a button and make its OnClick function activate/deactivate your cheats. Compare the boolean of the checkboxes against your own boolean that tells you if a cheat is currently active, and activate/deactivate your cheats if they're different.
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Ludwig
Advanced Cheater
Reputation: 0

Joined: 10 Jan 2016
Posts: 68

PostPosted: Mon Jan 25, 2016 4:00 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Look at the GetChromeProcesses function a bit more closely to learn how to get the name of processes (hint: the variable is called "processname")

i tried calling processname yesterday...gave me an error as unknown identifier or something...because i was calling it outside the function...if i set it up as local processname = entry:sub(10,255) anywhere else where i want to call the process name...will it return the processname...?<ill give it a try 2morrow>...also in firefox and Internet Explorer...as they use the same flash plugin?need to diferentaite between the 2 to be able to call aplication specific vbs script file...

ParkourPenguin wrote:
So... you want a bunch of checkboxes that do absolutely nothing on their own, but when some button is pressed, it'll activate/deactivate your cheats depending on whether the checkboxes are checked or not?

If so then ignore the OnChange property of the checkboxes and set the OnClick property of the button to do that. You might need a separate boolean to decide if the cheats were already activated or deactivated when you pressed the button so you don't try to activate/deactivate it again.



correct...
on my hactable im going to have about 20 inputs like :
{'0_gold',[[luacall(AobswapC("d0 30 d1 5e bd 43 2b 61 bd 43 47","d0 46 84 b0 01 00 02 02 02 02 47"))]],[[o_gold]],[[-ENABLED-]], 'false', 'false'},

the 2 false at the end...the first is an check if hack is enabled or not...the 2nd im building on as a bolean check for the checkbox...thus checkbox checked will b
{'0_gold',[[luacall(AobswapC("d0 30 d1 5e bd 43 2b 61 bd 43 47","d0 46 84 b0 01 00 02 02 02 02 47"))]],[[o_gold]],[[-ENABLED-]], 'false', 'true'},
in which case the hack will be executed...
self.hacktable[index][6] == true....i think...?

anyway...thanks a lot for your input...

hmm..came across this...viewtopic.php?t=547287&sid=83863704a2ffc7d13adc831164aa0237
will try playing with it aswell tomorrow...Smile
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Mon Jan 25, 2016 4:10 pm    Post subject: Reply with quote

If you're already attached to a process, then main.lua tells you how to get the name of it in the first few lines.
main.lua wrote:
process : A variable that contains the main modulename of the currently opened process

If you're not already attached to it, then do what the GetChromeProcesses function does. To spell it out for you:
  1. Make a stringlist
  2. Use getProcesslist
  3. Loop through the stringlist
  4. Get the process name from the current string in the stringlist


That other stuff is a table of strings. It does nothing on its own.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Ludwig
Advanced Cheater
Reputation: 0

Joined: 10 Jan 2016
Posts: 68

PostPosted: Thu Jan 28, 2016 3:09 pm    Post subject: Reply with quote

ParkourPenguin wrote:
If you're already attached to a process, then main.lua tells you how to get the name of it in the first few lines.
main.lua wrote:
process : A variable that contains the main modulename of the currently opened process

If you're not already attached to it, then do what the GetChromeProcesses function does. To spell it out for you:
  1. Make a stringlist
  2. Use getProcesslist
  3. Loop through the stringlist
  4. Get the process name from the current string in the stringlist


That other stuff is a table of strings. It does nothing on its own.


easier...i just created a global var that i gave same value as the process when i do the attaching...

auto refresh

Code:
function refresh()
   
   if Proc_name == 'Firefox' then
   os.execute("wscript c:/Firefox.vbs")
    else
   if Proc_name == 'Internet Explorer' then
   os.execute("wscript c:/IE.vbs")
   else
    if Proc_name == 'Torch then
   os.execute("wscript c:/torch.vbs")
   else
   if Proc_name == 'Google Chrome' then
   
   os.execute("wscript c:/Chrome.vbs")
   else
   end
   end
end
end

sleep(5000)

repeat
aobs = AOBScan("62 07 66 ?? ?? 73 63 0b")
sleep(1000)
until (aobs ~= nil)


sleep(3000)
pause()
ExecuteAllHacks()
unpause()

end


works...might still work a little on it

checkbox list...

still stuck

Code:
MainGUI[15] = createListBox(MainGUI[11])
......'
.....
....
TeL = listbox_getItems(MainGUI[15])
TempSave = {}
strings_clear(TeL)
check = 0
i = 0
repeat
if t[i+1]==nil then
   check = 1
else
   i = i+1
   strings_add(TeL, t[i][1])
   createCheckBox(createForm()).Caption = t[i][1];
   TempSave[i] = {}
   TempSave[i][1] = t[i][1]
   TempSave[i][2] = t[i][2]
   TempSave[i][3] = t[i][3]
   TempSave[i][4] = 2
   TempSave[i][5] = 0
   check = 0
end
until check == 1

handles the list box with the list of hacks...i would le to change it to a list of checkboxes

tried createCheckBox(createForm()).Caption = t[i][1]
...creates seperate checkboxes in seperate windows...
tried
Code:
else
   local myCB1 = createCheckBox(MainGUI[15])
   i = i+1
   strings_add(TeL, t[i][1])
   myCB1.Caption = t[i][1]
   TempSave[i] = {}

...creates all the checkboxes in ones spot...and still creates the normal list...this seems a bit closer...so just a little hlp...pls Smile
think it got to do with this..
.myCB1.Top = 40
myCB1.Left = 60
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Thu Jan 28, 2016 4:46 pm    Post subject: Reply with quote

For your auto refresh code snippet, there is an elseif statement in Lua.

For converting the listbox to a bunch of checkboxes, do as I stated before and just make a bunch of them.

Of course creating a checkbox that way would create a bunch of separate windows since you're calling createForm() in all of them. Just pass it the main form it should be part of instead.

For your last code snippet, again, the owner passed to the argument of the function createCheckBox(owner) should be the main form. And yes, they would be in the same spot if you don't set their X and Y coordinates to different places via the Top and Left properties of the checkbox.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Ludwig
Advanced Cheater
Reputation: 0

Joined: 10 Jan 2016
Posts: 68

PostPosted: Thu Jan 28, 2016 10:17 pm    Post subject: Reply with quote

ParkourPenguin wrote:
For your auto refresh code snippet, there is an elseif statement in Lua.

For converting the listbox to a bunch of checkboxes, do as I stated before and just make a bunch of them.

Of course creating a checkbox that way would create a bunch of separate windows since you're calling createForm() in all of them. Just pass it the main form it should be part of instead.

For your last code snippet, again, the owner passed to the argument of the function createCheckBox(owner) should be the main form. And yes, they would be in the same spot if you don't set their X and Y coordinates to different places via the Top and Left properties of the checkbox.


thnx...got most sorted

new bug popped up tho...
Code:
TeL = listbox_getItems(MainGUI[15])
TempSave = {}
strings_clear(TeL)
check = 0
i = 0
local cx=0
local cy=10
repeat
if t[i+1]==nil then
   check = 1
else
   local myCB1 = createCheckBox(MainGUI[15])
   myCB1.Top = cx
   myCB1.Left = cy
   i = i+1
   cx=cx+20
   --strings_add(TeL, t[i][1])
   myCB1.Caption = t[i][1]
        myCB1.OnChange = function(sender)
  if sender.Checked then
    showMessage("cheat activated."..t[i][1]))
  else
    showMessage("cheat deactivated.")
  end
end
   TempSave[i] = {}
   TempSave[i][1] = t[i][1]
   TempSave[i][2] = t[i][2]
   TempSave[i][3] = t[i][3]
   TempSave[i][4] = 2
   TempSave[i][5] = 0
   check = 0
end
until check == 1

all the checkboxes r printed...but, the list cant scroll anymore...with "strings_add(TeL, t[i][1])" in place it can scroll. but prints the old list over the new boxes...
also...the onchange function only goes to the last hacks caption...
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Fri Jan 29, 2016 12:10 am    Post subject: Reply with quote

If you're talking about the old listbox, then who cares if it can't scroll? Aren't you trying to replace it with a bunch of checkboxes?

If the OnChange function doesn't do what you want it to do, then make it do what you want it to do. Also, please properly indent your code, as that makes it easier to read and understand for everyone (including you).

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Wed Feb 03, 2016 3:38 am    Post subject: Reply with quote

ParkourPenguin wrote:
If you don't understand what the code you're using does, you probably shouldn't be using it. But that's just my thought.
Test it yourself to find out if it works or not. If you really want an AoB, go find one somewhere preferably outside of pepflashplayer.dll and scan for it.

Here's that code in a much more readable format:
Code:
errorOnLookupFailure(false);
ChromeAttach =   {
                  AllProcesses = {};
                 
                  RightProccess = function ()
                     return (getAddress("pepflashplayer.dll")~=0 or getAddress("AdobeCPGetAPI")~=0)
                  end;

                  FindProcess = function ()
                     if (ChromeAttach.Started) then return end
                    if (#ChromeAttach.AllProcesses == 0) then
                      ChromeAttach.GetChromeProcesses()
                    end
                    createNativeThread(function () ChromeAttach.Started = true
                      for k,v in pairs(ChromeAttach.AllProcesses) do
                        openProcess(k)
                        reinitializeSymbolhandler()
                        if (ChromeAttach.RightProccess()) then
                          ChromeAttach.Function()
                          ChromeAttach.Started = false
                          break
                        end
                      end
                      ChromeAttach.AllProcesses = {}
                      ChromeAttach.Started = false
                    end)
                  end;

                  GetChromeProcesses = function ()
                    local SL=createStringlist()
                    getProcesslist(SL)
                    for i=0,strings_getCount(SL)-1 do
                      local entry = strings_getString(SL,i)
                      local processname = entry:sub(10,255)
                      local PID = tonumber('0x'..entry:sub(1,8))
                      if processname:lower() == 'chrome.exe' then
                        ChromeAttach.AllProcesses[PID] = true
                      end
                    end
                  end;

                  Started = false;

                  Start = function (Function)
                    ChromeAttach.Function = Function
                    ChromeAttach.FindProcess()
                  end;

                  Function = nil;
               };

ChromeAttach.Start(function () showMessage('Successfully attached!'); end)

If I remember right this method causes memory leak.

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
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
Goto page 1, 2  Next
Page 1 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