Hi public,
I'm going to share a click bot today with the entire MMOwned community, as well as showing you the code, in VB.NET on how to do it. Yes, it can also be done in C++, as well as C#, or whatever you're into, heck, even LUA works.
Reason I picked VB.NET is for the sole reason that it's easy to learn, so people might be able to fiddle around with code on AoC, and produce something nice for the entire scene to enjoy. After all, the public scene is quite dead, AoC wise
What does it do?
It clicks a button, or multiple buttons, if you add a couple of lines of code, and sends them to the game. We use SendKeys.Send() to do so.
First off, create a Windows Forms application, and double click the form as soon as it pops up. Now add the following code to the sub "Form1_Load":
Code:
'' Little security measure
Dim Random As New Random()
Dim Title As String = Random.Next(1, 999999999)
Me.Text = Title
As I'm not a 100% sure what security measures AoC uses, we'll just randomize the form name, just to be sure.
Now below that sub, add the following, which is .. kind of the engine:
Code:
Public Sub ProcessClick(ByVal Key As String)
If Key Is Nothing Then
Exit Sub
End If
If Key <> Nothing And Status = True Then
SendKeys.Send(Key)
End If
End Sub
Now go back to the designer, all the code we're going to need is there.
Go to View -> Toolbox, and add a timer. Double click the timer, and add the following code to the event:
ProcessClick("1"), for example. Where 1 would be key to press. Change the interval setting of the timer to adjust how long it would take between every keypress. Interval is in milliseconds, so Interval=X*1000, where X is in seconds.
Now make a button on your form, and double click it as well. Assuming you left your timer with it's default name, Timer1, add the following code to the sub of the button:
Code:
Timer1.Enabled = True
Which will enable the timer as soon as the button is pressed. If your timer's name is not Timer1, then change this to the according value.
What if I use a DLL?
If you use a DLL instead of a forms project, you will need to replicate two things, the Microsoft namespace, and the keypress on root level.
Replicating the Microsoft namespace is easy:
Code:
Public Microsoft as Object
Calling the keypress from root level is a bit harder, but still only one line of code:
Code:
Microsoft.VisualBasic.Devices.Keyboard.SendKeys(Key)
As you can see, we call the function directly from the keyboard, not through the SendKeys namespace. So, in theory, this would be faster. Hence I'm releasing the binary of this topic in *.DLL format as well.
Can I use the VB.NET DLL you attached in AoC?
No. Unless you create your own application, forms application that is. That's what this topic is aimed at anyway.
So, if you want to use the binary attached, here's the information you need:
Root Namespace: Clickboy
Class: Main
Root function: ProcessClick(Key As String)
So, imports Clickboy.Main, m'kay.
Can we have the full source of the binary dll?
Sure, as long as you use it for educational purposes.
Code:
Namespace Clickboy
Class Main
Public Status As Boolean
Public Microsoft As Object
Public Function ProcessClick(ByVal Key As String)
Dim BlowFish As String = "378rqew"
If Key Is Nothing Then
Return BlowFish
Exit Function
End If
If Key <> Nothing And Status = True Then
Microsoft.VisualBasic.Devices.Keyboard.SendKeys(Key)
End If
Return BlowFish
End Function
End Class
End Namespace
Oh, and if you want to call a mouseclick:
Code:
Public Event MouseLeftButtonDown(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs)
Member of System.Windows.ContentElement
Public Event MouseLeftButtonUp(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs)
Member of System.Windows.ContentElement
Public Event MouseRightButtonDown(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs)
Member of System.Windows.ContentElement
Public Event MouseRightButtonUp(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs)
Member of System.Windows.ContentElement
Call System.Windows.ContentElement, and you should be able to replicate mouseclicks as well
Not too sure, but you might have to define Windows as an Object.
I hope this got some people on the road, as you can see, creating a clickbot is extremely easy, and will only take around 15 minutes of your time once you get familiar with VB.NET!
And yes, I know, my code's not perfect.
Binary DLL and full source+dir
RapidShare: Easy Filehosting - Full Source
RapidShare: Easy Filehosting - Binary
Bot + source (*.exe)
RapidShare: Easy Filehosting
Sincerely,
Seifer