[Delphi]Making an Auto-Clicker for MapleStory
Posted: Tue Oct 20, 2009 8:38 pm
Hello peeps, here's a guide on how to make an auto-clicker for maplestory
Handwritten by me!
1)Download the file i attached below and extract it to the folder whereby you want to save the delphi project at.
2)Open your delphi.
3)Add 2 timers and 1 label to your project.
Your current code should be like this
4)Add this to your code.
your code should be like this now
5)Now name 1 timer "AutoClickerTimer" while another timer "AutoClickHotkey".
6)Set "AutoClickTimer" enabled to false and interval to 1.
7)Set "AutoClickHotkey" enabled to true and interval to 10.
8)Set your "label1" caption to Disabled and set the font color to red.
9)Code this to your "AutoClickTimer"
This is to postmessage and spam your left click.
10)Code this to your "AutoClickHotkey"
Your final coding should be like this

Handwritten by me!
1)Download the file i attached below and extract it to the folder whereby you want to save the delphi project at.
2)Open your delphi.
3)Add 2 timers and 1 label to your project.
Your current code should be like this
Code: Select all
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
end;
end.
Code: Select all
function PostMessageX(
hWnd:HWND;
MSG:UINT;
WPARAM:wParam;
LPARAM:lParam):BOOL;stdcall;
external 'PMX.dll' name 'PostMessageX';
Code: Select all
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function PostMessageX(
hWnd:HWND;
MSG:UINT;
WPARAM:wParam;
LPARAM:lParam):BOOL;stdcall;
external 'PMX.dll' name 'PostMessageX';
procedure TForm1.FormCreate(Sender: TObject);
begin
end;
end.
6)Set "AutoClickTimer" enabled to false and interval to 1.
7)Set "AutoClickHotkey" enabled to true and interval to 10.
8)Set your "label1" caption to Disabled and set the font color to red.
9)Code this to your "AutoClickTimer"
Code: Select all
procedure TForm1.AutoClickTimerTimer(Sender: TObject);
var
h:hwnd;
Point:TPoint;
x,y:integer;
begin
GetCursorPos(Point);
x:=Point.X;
y:=Point.Y;
h:=FindWindowA('MapleStoryClass',nil);
if h<>0 then
begin
PostMessageX(h,WM_LBUTTONDBLCLK,0,MakeLong(X,Y));
PostMessageX(h,WM_LBUTTONUP,0,MakeLong(X,Y));
Application.ProcessMessages;
end;
10)Code this to your "AutoClickHotkey"
Code: Select all
procedure TForm1.AutoClickHotkeyTimer(Sender: TObject);
begin
if odd(GetAsyncKeyState(VK_F1))
then
begin
if(AutoClickTimer.Enabled=false) then
begin
autoclicktimer.Enabled:=true;
label1.caption:='Enable';
Label1.Font.Color:=clLime;
end
else if(autoclicktimer.Enabled=true) then
begin
autoclicktimer.Enabled:=false;
Label1.caption:='Disable';
Label1.Font.Color:=clRed;
end;
end;
end;
Code: Select all
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
AutoClickTimer: TTimer;
AutoClickHotkey: TTimer;
Label1: TLabel;
procedure AutoClickTimerTimer(Sender: TObject);
procedure AutoClickHotkeyTimer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function PostMessageX(
hWnd:HWND;
MSG:UINT;
WPARAM:wParam;
LPARAM:lParam):BOOL;stdcall;
external 'PMX.dll' name 'PostMessageX';
procedure TForm1.AutoClickTimerTimer(Sender: TObject);
var
h:hwnd;
Point:TPoint;
x,y:integer;
begin
GetCursorPos(Point);
x:=Point.X;
y:=Point.Y;
h:=FindWindowA('MapleStoryClass',nil);
if h<>0 then
begin
PostMessageX(h,WM_LBUTTONDBLCLK,0,MakeLong(X,Y));
PostMessageX(h,WM_LBUTTONUP,0,MakeLong(X,Y));
Application.ProcessMessages;
end;
end;
procedure TForm1.AutoClickHotkeyTimer(Sender: TObject);
begin
if odd(GetAsyncKeyState(VK_F1))
then
begin
if(AutoClickTimer.Enabled=false) then
begin
autoclicktimer.Enabled:=true;
label1.caption:='Enable';
Label1.Font.Color:=clLime;
end
else if(autoclicktimer.Enabled=true) then
begin
autoclicktimer.Enabled:=false;
Label1.caption:='Disable';
Label1.Font.Color:=clRed;
end;
end;
end;
end.