elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Introducción a Git (Primera Parte)


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  [Delphi] DH Auto Clicker 0.6
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Delphi] DH Auto Clicker 0.6  (Leído 2,780 veces)
BigBear


Desconectado Desconectado

Mensajes: 545



Ver Perfil
[Delphi] DH Auto Clicker 0.6
« en: 2 Octubre 2016, 20:02 pm »

Un programa en Delphi para usar un clicker automatico para juegos o lo que sea.

Opciones :

  • Capturar posicion del mouse para usar en el programa
  • Timeout para cada click
  • Teclas de acceso rapido para empezar y terminar el clicker
  • Clicks en posiciones aleatorias
  • Los Clicks que permite son izquierda,medio,derecha y doble click

Una imagen :



El codigo :

Código
  1. // DH Auto Clicker 0.6
  2. // (C) Doddy Hackman 2016
  3.  
  4. unit auto_clicker;
  5.  
  6. interface
  7.  
  8. uses
  9.  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  10.  System.Classes, Vcl.Graphics,
  11.  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.StdCtrls,
  12.  Vcl.ComCtrls, Math, Vcl.ImgList, Vcl.Imaging.pngimage;
  13.  
  14. type
  15.  TFormHome = class(TForm)
  16.    logo: TImage;
  17.    gbMousePosition: TGroupBox;
  18.    lblXPosition: TLabel;
  19.    txt_X_Now: TEdit;
  20.    lblYPosition: TLabel;
  21.    txt_Y_Now: TEdit;
  22.    gbOptions: TGroupBox;
  23.    lblType: TLabel;
  24.    cmbType: TComboBox;
  25.    lblSleep: TLabel;
  26.    txtSleep: TEdit;
  27.    lblXSelect: TLabel;
  28.    txt_X_Select: TEdit;
  29.    lblYSelect: TLabel;
  30.    txt_Y_Select: TEdit;
  31.    lblSeconds: TLabel;
  32.    btnGetPosition: TButton;
  33.    cbUseRandomClicks: TCheckBox;
  34.    btnStart: TButton;
  35.    btnStop: TButton;
  36.    status: TStatusBar;
  37.    tmGetMousePosition: TTimer;
  38.    tmClicker: TTimer;
  39.    notificar: TTrayIcon;
  40.    tmHookKeys: TTimer;
  41.    ilIconos: TImageList;
  42.    procedure tmGetMousePositionTimer(Sender: TObject);
  43.    procedure btnGetPositionClick(Sender: TObject);
  44.    procedure tmClickerTimer(Sender: TObject);
  45.    procedure notificarClick(Sender: TObject);
  46.    procedure tmHookKeysTimer(Sender: TObject);
  47.    procedure btnStartClick(Sender: TObject);
  48.    procedure btnStopClick(Sender: TObject);
  49.  private
  50.    { Private declarations }
  51.  public
  52.    procedure capturar_posicion_mouse();
  53.    procedure iniciar_clicker();
  54.    procedure desactivar_clicker();
  55.  end;
  56.  
  57. var
  58.  FormHome: TFormHome;
  59.  
  60. implementation
  61.  
  62. {$R *.dfm}
  63.  
  64. function message_box(title, message_text, type_message: string): string;
  65. begin
  66.  if not(title = '') and not(message_text = '') and not(type_message = '') then
  67.  begin
  68.    try
  69.      begin
  70.        if (type_message = 'Information') then
  71.        begin
  72.          MessageBox(FormHome.Handle, PChar(message_text), PChar(title),
  73.            MB_ICONINFORMATION);
  74.        end
  75.        else if (type_message = 'Warning') then
  76.        begin
  77.          MessageBox(FormHome.Handle, PChar(message_text), PChar(title),
  78.            MB_ICONWARNING);
  79.        end
  80.        else if (type_message = 'Question') then
  81.        begin
  82.          MessageBox(FormHome.Handle, PChar(message_text), PChar(title),
  83.            MB_ICONQUESTION);
  84.        end
  85.        else if (type_message = 'Error') then
  86.        begin
  87.          MessageBox(FormHome.Handle, PChar(message_text), PChar(title),
  88.            MB_ICONERROR);
  89.        end
  90.        else
  91.        begin
  92.          MessageBox(FormHome.Handle, PChar(message_text), PChar(title),
  93.            MB_ICONINFORMATION);
  94.        end;
  95.        Result := '[+] MessageBox : OK';
  96.      end;
  97.    except
  98.      begin
  99.        Result := '[-] Error';
  100.      end;
  101.    end;
  102.  end
  103.  else
  104.  begin
  105.    Result := '[-] Error';
  106.  end;
  107. end;
  108.  
  109. procedure mouse_click(option: string);
  110. // Function based in : http://www.swissdelphicenter.ch/torry/showcode.php?id=360
  111. // Thanks to Thomas Stutz
  112. begin
  113.  if (option = 'left') then
  114.  begin
  115.    mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
  116.    mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
  117.  end
  118.  else if (option = 'right') then
  119.  begin
  120.    mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0);
  121.    mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0);
  122.  end
  123.  else if (option = 'middle') then
  124.  begin
  125.    mouse_event(MOUSEEVENTF_MIDDLEDOWN, 0, 0, 0, 0);
  126.    mouse_event(MOUSEEVENTF_MIDDLEUP, 0, 0, 0, 0);
  127.  end
  128.  else if (option = 'double') then
  129.  begin
  130.    mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
  131.    mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
  132.    GetDoubleClickTime;
  133.    mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
  134.    mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
  135.  end
  136.  else
  137.  begin
  138.    mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
  139.    mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
  140.  end;
  141. end;
  142.  
  143. procedure TFormHome.iniciar_clicker();
  144. begin
  145.  if (cmbType.ItemIndex <> -1) and not(txt_X_Select.Text = '') and
  146.    not(txt_Y_Select.Text = '') and not(txtSleep.Text = '') then
  147.  begin
  148.    tmClicker.Interval := StrToInt(txtSleep.Text) * 1000;
  149.    tmClicker.Enabled := True;
  150.    status.Panels[0].Text := '[+] Working ...';
  151.    FormHome.Update;
  152.    notificar.BalloonTitle := 'DH Auto Clicker';
  153.    notificar.BalloonHint := 'Clicker Started';
  154.    notificar.ShowBalloonHint;
  155.  end
  156.  else
  157.  begin
  158.    message_box('DH Auto Clicker 0.6', 'Complete the options', 'Warning');
  159.  end;
  160. end;
  161.  
  162. procedure TFormHome.desactivar_clicker();
  163. begin
  164.  tmClicker.Enabled := False;
  165.  status.Panels[0].Text := '[+] Stopped';
  166.  FormHome.Update;
  167.  notificar.BalloonTitle := 'DH Auto Clicker';
  168.  notificar.BalloonHint := 'Clicker Stopped';
  169.  notificar.ShowBalloonHint;
  170. end;
  171.  
  172. procedure TFormHome.btnStartClick(Sender: TObject);
  173. begin
  174.  iniciar_clicker();
  175. end;
  176.  
  177. procedure TFormHome.btnStopClick(Sender: TObject);
  178. begin
  179.  desactivar_clicker();
  180. end;
  181.  
  182. procedure TFormHome.capturar_posicion_mouse();
  183. begin
  184.  txt_X_Select.Text := txt_X_Now.Text;
  185.  txt_Y_Select.Text := txt_Y_Now.Text;
  186.  status.Panels[0].Text := '[+] Position updated';
  187.  FormHome.Update;
  188.  notificar.BalloonTitle := 'DH Auto Clicker';
  189.  notificar.BalloonHint := 'Position updated';
  190.  notificar.ShowBalloonHint;
  191. end;
  192.  
  193. procedure TFormHome.notificarClick(Sender: TObject);
  194. begin
  195.  Show();
  196.  WindowState := wsNormal;
  197.  Application.BringToFront();
  198. end;
  199.  
  200. procedure TFormHome.btnGetPositionClick(Sender: TObject);
  201. begin
  202.  capturar_posicion_mouse();
  203. end;
  204.  
  205. procedure TFormHome.tmGetMousePositionTimer(Sender: TObject);
  206. var
  207.  ubicacion: tPoint;
  208. begin
  209.  ubicacion := Mouse.CursorPos;
  210.  txt_X_Now.Text := IntToStr(ubicacion.X);
  211.  txt_Y_Now.Text := IntToStr(ubicacion.Y);
  212. end;
  213.  
  214. procedure TFormHome.tmHookKeysTimer(Sender: TObject);
  215. var
  216.  i: integer;
  217.  re: Longint;
  218. begin
  219.  for i := 119 to 124 do
  220.  begin
  221.    re := GetAsyncKeyState(i);
  222.    If re = -32767 then
  223.    Begin
  224.      if (i = 120) then
  225.      begin
  226.        capturar_posicion_mouse();
  227.      end
  228.      else if (i = 122) then
  229.      begin
  230.        iniciar_clicker();
  231.      end
  232.      else if (i = 123) then
  233.      begin
  234.        desactivar_clicker();
  235.      end
  236.      else
  237.      begin
  238.        // ?
  239.      end;
  240.    End;
  241.  End;
  242. end;
  243.  
  244. procedure TFormHome.tmClickerTimer(Sender: TObject);
  245. var
  246.  tipo: integer;
  247.  nombre_tipo: string;
  248.  X: integer;
  249.  Y: integer;
  250.  time_sleep: integer;
  251. begin
  252.  
  253.  tipo := cmbType.ItemIndex;
  254.  nombre_tipo := '';
  255.  
  256.  if (tipo = 0) then
  257.  begin
  258.    nombre_tipo := 'left';
  259.  end
  260.  else if (tipo = 1) then
  261.  begin
  262.    nombre_tipo := 'middle';
  263.  end
  264.  else if (tipo = 2) then
  265.  begin
  266.    nombre_tipo := 'right';
  267.  end
  268.  else if (tipo = 3) then
  269.  begin
  270.    nombre_tipo := 'double';
  271.  end
  272.  else
  273.  begin
  274.    nombre_tipo := 'left';
  275.  end;
  276.  
  277.  X := 0;
  278.  Y := 0;
  279.  
  280.  if (cbUseRandomClicks.Checked) then
  281.  begin
  282.    X := RandomRange(1, 2000);
  283.    Y := RandomRange(1, 1000);
  284.  end
  285.  else
  286.  begin
  287.    X := StrToInt(txt_X_Select.Text);
  288.    Y := StrToInt(txt_Y_Select.Text);
  289.  end;
  290.  
  291.  time_sleep := StrToInt(txtSleep.Text) * 1000;
  292.  
  293.  SetCursorPos(X, Y);
  294.  
  295.  mouse_click(nombre_tipo);
  296.  
  297. end;
  298.  
  299. end.
  300.  
  301. // The End ?
  302.  

Si quieren bajar el programa y el proyecto con el codigo fuente lo pueden hacer desde aca :

SourceForge.

Eso seria todo.


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Auto Clicker (Programado en autoit)+ Pregunta
Scripting
tOxiC; 4 7,503 Último mensaje 17 Agosto 2009, 19:13 pm
por tOxiC;
Ghost Mouse Auto Clicker 3.4 (Monitoriza clicks, Y los reproduce)
Software
Eleкtro 0 1,888 Último mensaje 17 Febrero 2012, 22:32 pm
por Eleкtro
¿Como crear un auto-clicker en C#?
Programación C/C++
milenio204 0 1,612 Último mensaje 25 Enero 2014, 11:43 am
por milenio204
¿Como puedo crear un auto-clicker en C#? Con SetPoint (X,Y).
.NET (C#, VB.NET, ASP)
milenio204 5 5,332 Último mensaje 25 Enero 2014, 19:54 pm
por milenio204
Tool Super Beta, Adfly Clicker 2018
Software
Tengu Tecno 0 1,272 Último mensaje 20 Febrero 2018, 00:30 am
por Tengu Tecno
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines