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 


Disabling threading (From CE Source...) ?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Kevin
Grandmaster Cheater Supreme
Reputation: 0

Joined: 07 Mar 2007
Posts: 1139
Location: Spiderman-World

PostPosted: Mon Jul 30, 2007 10:16 am    Post subject: Disabling threading (From CE Source...) ? Reply with quote

How do I disable it?

Code:

type TFlash = class (TThread)
  public
    procedure Execute; override;
    procedure col;
end;

...

var ncol: TColor;
procedure TFlash.Col;
begin
  mainform.panel1.Color:=ncol;
end;

procedure TFlash.Execute;
var red,green: byte;
    decreasered: boolean;
begin
{$ifndef ceasinjecteddll}
  decreasered:=true;
  red:=254;
  green:=0;
  while not terminated do
  begin
    if decreasered then
    begin
      dec(red,3);
      inc(green,3);
      if green>=250 then decreasered:=false;
    end
    else
    begin
      inc(red,3);
      dec(green,3);
      if red>=254 then
        decreasered:=true;
    end;
    ncol:=(green shl 8)+red;
    synchronize(col); //sigh (withouth it works too, but at least with this I know for sure it works.

    sleep(20);
  end;

{$endif}
  mainform.Panel1.Color:=clBtnFace;
end;

procedure TMainForm.FormCreate(Sender: TObject);
begin
tflash.create(false);
end;


but how do i disable it?

tflash.create(true) doesnt work.
Back to top
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Mon Jul 30, 2007 10:20 am    Post subject: Reply with quote

not creating it at all stops it. And that true should work as well since the param means createsuspended, so it's created but paused

But no idea what you mean with threading and WHY you want to disable it?
It could be you mean the timers that update the list and some other stuff. You can set those to disabled. (timers arn't really threading since it still runs in the context of the main app, it's just code that gets executed as a response to a event)

and remove synchronize(col); will also stop it from changing the color

_________________
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
Kevin
Grandmaster Cheater Supreme
Reputation: 0

Joined: 07 Mar 2007
Posts: 1139
Location: Spiderman-World

PostPosted: Mon Jul 30, 2007 10:35 am    Post subject: Reply with quote

Dark Byte wrote:

and remove synchronize(col); will also stop it from changing the color


yes but this is copied directly from your source so you wrote yourself it will work without, but it doesnt. (I'm not that good that i'll remember everything) I wanna do like in your CE, when you hit the attach to process button, it disables the threading.
Back to top
View user's profile Send private message MSN Messenger
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Mon Jul 30, 2007 12:45 pm    Post subject: Reply with quote

Why WOULD you want to remove the threading?

I'm working on a memory scanner that uses multiple threads to divide up the time for scanning a program's memory. I'm not sure if CE works the same way, but if it does, it would be DREADFULLY slow without the threads.
Back to top
View user's profile Send private message
Kevin
Grandmaster Cheater Supreme
Reputation: 0

Joined: 07 Mar 2007
Posts: 1139
Location: Spiderman-World

PostPosted: Mon Jul 30, 2007 3:11 pm    Post subject: Reply with quote

with threading i mean a glowing panel. I'm not sure were thinking of the same things.
Back to top
View user's profile Send private message MSN Messenger
UnLmtD
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 894
Location: Canada

PostPosted: Mon Jul 30, 2007 3:20 pm    Post subject: Reply with quote

Threading as in multi threading, when you have multiple threads running, doing something so you application doesn't lag as much.
_________________
Back to top
View user's profile Send private message
Kevin
Grandmaster Cheater Supreme
Reputation: 0

Joined: 07 Mar 2007
Posts: 1139
Location: Spiderman-World

PostPosted: Mon Jul 30, 2007 3:24 pm    Post subject: Reply with quote

I just want to disable the glowing panel (threading), and also understand a bit of the code.

If you either explain how to make a code, or give one to me so i can study it would be really nice, if it is possible.
Back to top
View user's profile Send private message MSN Messenger
DeltaFlyer
Grandmaster Cheater
Reputation: 0

Joined: 22 Jul 2006
Posts: 666

PostPosted: Mon Jul 30, 2007 3:49 pm    Post subject: Reply with quote

Kevinnn wrote:
I just want to disable the glowing panel (threading), and also understand a bit of the code.

If you either explain how to make a code, or give one to me so i can study it would be really nice, if it is possible.

That's not disabling threading... that's pausing or terminating A SINGLE thread.

Try calling the terminate or pause procedure.

_________________

Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for?
Back to top
View user's profile Send private message
Kevin
Grandmaster Cheater Supreme
Reputation: 0

Joined: 07 Mar 2007
Posts: 1139
Location: Spiderman-World

PostPosted: Mon Jul 30, 2007 3:55 pm    Post subject: Reply with quote

wont work, since its a class. It only allows create and some other wierd ones, but none pauses it.
Back to top
View user's profile Send private message MSN Messenger
DeltaFlyer
Grandmaster Cheater
Reputation: 0

Joined: 22 Jul 2006
Posts: 666

PostPosted: Mon Jul 30, 2007 3:59 pm    Post subject: Reply with quote

Ok, I just read the code you posted. There should be a boolean value named terminate. Set that to true, and the thread should stop changing the colours of whatever you were changing.
_________________

Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for?
Back to top
View user's profile Send private message
Kevin
Grandmaster Cheater Supreme
Reputation: 0

Joined: 07 Mar 2007
Posts: 1139
Location: Spiderman-World

PostPosted: Mon Jul 30, 2007 4:06 pm    Post subject: Reply with quote

so it should be something like

tflash.terminate(true);

but i can't. It says something that it can't do that function because its a class.
Back to top
View user's profile Send private message MSN Messenger
DeltaFlyer
Grandmaster Cheater
Reputation: 0

Joined: 22 Jul 2006
Posts: 666

PostPosted: Mon Jul 30, 2007 5:45 pm    Post subject: Reply with quote

Kevinnn wrote:
so it should be something like

tflash.terminate(true);

but i can't. It says something that it can't do that function because its a class.


You didn't even learn the basics of OOP...

Classes are blueprints; they contain the information on how the class will function, but the blueprint itself cannot function. To make it function, an instance of the class must be created through a constructor through the process called instantiation.

Of course you can't call terminate on TFlash, it's only a blueprint. The blueprint of an oven can't bake a cake for you.

To make it function, you must first declare a variable of the type TFlash. Then, to start the flashing, you would call the constructor of TFlash, which in this case is called Create and takes in a boolean. This constructor returns a working instance of the class. Assign this instance to the variable you have previously declared, and you will have a valid means of communicating with the thread.

Then, to terminate, suspend, or resume the thread, you could simply call the procedures Terminate, Suspend, or Resume, respectively, from the variable of type TFlash.

_________________

Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for?
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Mon Jul 30, 2007 6:02 pm    Post subject: Reply with quote

tflash.create(false); <---- Remove this or comment !!!

//tflash.create(false);

isnt that visible Shocked ???
Back to top
View user's profile Send private message
DeltaFlyer
Grandmaster Cheater
Reputation: 0

Joined: 22 Jul 2006
Posts: 666

PostPosted: Mon Jul 30, 2007 6:08 pm    Post subject: Reply with quote

Kaspersky wrote:
tflash.create(false); <---- Remove this or comment !!!

//tflash.create(false);

isnt that visible Shocked ???


Without that line the thread won't even be created....

Anyways, to demonstrate what I meant by my previous post, I have attached a sample. TT1 is the name of the class (equivalent of your TFlash). Thread is the variable used to hold the instance of TT1 created by its constructor. The buttons are self-explanatory.



The Extension 'zip' was deactivated by an board admin, therefore this Attachment is not displayed.


_________________

Wow.... still working at 827... what's INCA thinking?
zomg l33t hax at this place (IE only). Over 150 people have used it, what are YOU waiting for?
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Mon Jul 30, 2007 6:08 pm    Post subject: Reply with quote

He wanted to remove it, but i told him how to disable it, same thing.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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