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 


[request] tuts about making AC in C#

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sat Feb 16, 2008 11:27 am    Post subject: [request] tuts about making AC in C# Reply with quote

i searched for like a hour in CEF and all i could've found is only releasing of auto clickers withou source code or Tutorials how to make one
can any1 direct me to a good tut please ?

_________________
Stylo
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

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

PostPosted: Sat Feb 16, 2008 11:31 am    Post subject: Reply with quote

Ok, I'm not gonna give you the code, but I'll throw out a simple algorithm:

Code:

1) Wait for button press (start) or hotkey press (whatever hotkey for starting)

2) On start (whether hotkey or button), send a click to a pre-defined application (or the highest level application)

3) wait a pre-defined amount of time (usually about 10-100 ms)

4) Check for button press (stop) or hotkey press (whatever for stopping)

5) if not, go to 2

6) else, go to 1


For the hotkeys, you can check out my keyboard hook in the GP+ section.

For clicking, you should look at PostMessage

For waiting, use
Code:

System.Threading.Thread.Sleep(desiredtime);

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Michel
Expert Cheater
Reputation: 0

Joined: 16 May 2007
Posts: 214
Location: The Netherlands

PostPosted: Sat Feb 16, 2008 12:12 pm    Post subject: Reply with quote

http://forum.cheatengine.org/viewtopic.php?p=2048375&highlight=#2048375

EDIT: oops, I didn`t notice you said C#.. sorry, I don`t think you can use that alot..
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sat Feb 16, 2008 12:34 pm    Post subject: Reply with quote

look samurai thats what i have done(attachment below) (but it's without a hotkey cuz i dont really know how to use hotkey :\)
what i'm asking is how can i make it click super fast?!
edit: almost forgot the source code
2nd attachment



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


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


_________________
Stylo
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

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

PostPosted: Sat Feb 16, 2008 1:28 pm    Post subject: Reply with quote

Your code wrote:

Code:

    public static void LClick()
    {
        mouse_event((uint)MouseEventFlags.LEFTDOWN, 0, 0, 0, 0);
        Pause(150); //Give it time to understand it
        mouse_event((uint)MouseEventFlags.LEFTUP, 0, 0, 0, 0);
        Pause(100);
    }



The way to make it click faster is change the values of pause.

Btw, I'm just curious--that's the exact method name, and maybe exact code (I'm not sure, I'd have to check) of a method for a Macro class that I wrote a while back. Did you write this yourself?

Edit:

Micheltjuh wrote:
http://forum.cheatengine.org/viewtopic.php?p=2048375&highlight=#2048375

EDIT: oops, I didn`t notice you said C#.. sorry, I don`t think you can use that alot..


C# is able to do anything that any other language can do--except, in some cases, easier, and can also develop things on the web.

Don't put C# down if you don't know anything about it.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sat Feb 16, 2008 1:35 pm    Post subject: Reply with quote

that method you wrote for me few weeks ago Very Happy
i remember i asked for this and you sent me that code
btw thank u for your helping :>

_________________
Stylo


Last edited by Stylo on Sat Feb 16, 2008 1:56 pm; edited 2 times in total
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

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

PostPosted: Sat Feb 16, 2008 1:36 pm    Post subject: Reply with quote

Ah.

Np. =)

~~

Anything else you need, just post.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sat Feb 16, 2008 1:56 pm    Post subject: Reply with quote

samuri25404 wrote:
Your code wrote:



Micheltjuh wrote:
http://forum.cheatengine.org/viewtopic.php?p=2048375&highlight=#2048375

EDIT: oops, I didn`t notice you said C#.. sorry, I don`t think you can use that alot..


C# is able to do anything that any other language can do--except, in some cases, easier, and can also develop things on the web.

Don't put C# down if you don't know anything about it.


Dont you mean slower and with bulkier code? >.<
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sat Feb 16, 2008 1:57 pm    Post subject: Reply with quote

i changed the value in the pause to 1 it did click a little faster but still on the other hand when i use other ac that some1 else made it's clicking alot more faster :\
_________________
Stylo
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

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

PostPosted: Sat Feb 16, 2008 2:06 pm    Post subject: Reply with quote

1qaz wrote:
i changed the value in the pause to 1 it did click a little faster but still on the other hand when i use other ac that some1 else made it's clicking alot more faster :\


Simply because .NET isn't as fast as everything else.

blankrider wrote:
samuri25404 wrote:
Your code wrote:

Micheltjuh wrote:
http://forum.cheatengine.org/viewtopic.php?p=2048375&highlight=#2048375

EDIT: oops, I didn`t notice you said C#.. sorry, I don`t think you can use that alot..


C# is able to do anything that any other language can do--except, in some cases, easier, and can also develop things on the web.

Don't put C# down if you don't know anything about it.


Dont you mean slower and with bulkier code? >.<


Sure, it has a 1-2% performance drop, but so what? The .NET Framework has a lot of managed wrappers that make it so much easier to do things.

For example, Wicc wrote a method in C++ to return an array of procs or something like that by proc name. In C#,

Code:

Process[] myprocs = Process.GetProcessesByName("notepad.exe");

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sat Feb 16, 2008 2:23 pm    Post subject: Reply with quote

ohh... Surprised ok thx Very Happy
_________________
Stylo
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Feb 16, 2008 2:50 pm    Post subject: Reply with quote

Use SendInput instead of mouse_event
Back to top
View user's profile Send private message
Stylo
Grandmaster Cheater Supreme
Reputation: 3

Joined: 16 May 2007
Posts: 1073
Location: Israel

PostPosted: Sat Feb 16, 2008 11:07 pm    Post subject: Reply with quote

what exactly is that SendInput thing ? Confused
_________________
Stylo
Back to top
View user's profile Send private message
Henley
Grandmaster Cheater
Reputation: 0

Joined: 03 Oct 2006
Posts: 671

PostPosted: Sun Feb 17, 2008 12:52 am    Post subject: Reply with quote

1qaz wrote:
what exactly is that SendInput thing ? Confused


http://msdn2.microsoft.com/en-us/library/ms646310.aspx
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
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