如何模拟连续点击鼠标左键 ( 积分: 20 )

  • 主题发起人 主题发起人 jjqqw
  • 开始时间 开始时间
J

jjqqw

Unregistered / Unconfirmed
GUEST, unregistred user!
如题 <br>我的代码问题出在什么地方?<br>procedure TForm1.Timer1Timer(Sender: TObject);<br>var<br> &nbsp;s:integer;<br> &nbsp;po:TPoint;<br> // Recta:TRect;<br>begin<br> &nbsp; // showmessage('hi');<br> &nbsp; &nbsp;Timer1.Interval:=TrackBar1.Position;<br> &nbsp; &nbsp;GetCursorPos(po);<br> &nbsp; &nbsp;for s:= 0 to strtoint(edit1.Text) -1 do<br> &nbsp; &nbsp;mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);<br> &nbsp; &nbsp;mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);<br> &nbsp; &nbsp;edit1.Text:=inttostr(strtoint(edit1.Text)-1);<br> &nbsp;// &nbsp;SetCursorPos(po.X,po.Y);<br>end;
 
如题 <br>我的代码问题出在什么地方?<br>procedure TForm1.Timer1Timer(Sender: TObject);<br>var<br> &nbsp;s:integer;<br> &nbsp;po:TPoint;<br> // Recta:TRect;<br>begin<br> &nbsp; // showmessage('hi');<br> &nbsp; &nbsp;Timer1.Interval:=TrackBar1.Position;<br> &nbsp; &nbsp;GetCursorPos(po);<br> &nbsp; &nbsp;for s:= 0 to strtoint(edit1.Text) -1 do<br> &nbsp; &nbsp;mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);<br> &nbsp; &nbsp;mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);<br> &nbsp; &nbsp;edit1.Text:=inttostr(strtoint(edit1.Text)-1);<br> &nbsp;// &nbsp;SetCursorPos(po.X,po.Y);<br>end;
 
似乎没啥问题<br><br>你有什么问题?
 
for s:= 0 to strtoint(edit1.Text) -1 do<br>[red]begin[/red]<br> &nbsp; &nbsp;mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);<br> &nbsp; &nbsp;mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);<br>[red]end;[/red]<br>而且点击的速度也太快了吧,估计要加个sleep。
 
加了 还是不行其他部分代码如下<br>procedure TForm1.WMhotkeyhandle(var msg: Tmessage);<br>begin<br> &nbsp;if (msg.LParamHi=$4D) and<br> &nbsp; &nbsp; (msg.lparamLo=MOD_CONTROL or mod_Alt) then<br> &nbsp;begin<br> &nbsp; &nbsp;msg.Result:=1;<br> &nbsp; &nbsp;if length(edit1.Text) &lt;&gt;0 then<br> &nbsp; &nbsp;Timer1.Enabled :=true<br> &nbsp; &nbsp;else<br> &nbsp; &nbsp;messagedlg('请输入一个点数!',mtInformation,[mbok],0);<br> &nbsp; &nbsp;timer1.Enabled:=false;<br> &nbsp;end;<br>end;<br>procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);<br>begin<br> &nbsp; unregisterhotkey(handle,hotkeyid);<br> &nbsp; DeleteAtom(HotKeyID);<br>end;<br>最近玩奇迹私服,我就是想做个自动加点器,原理就是这个吧,怎么老出不来效果
 
帮忙看看
 
procedure TForm1.Timer1Timer(Sender: TObject);<br>var<br> &nbsp;s:integer;<br> &nbsp;po:TPoint;<br> // Recta:TRect;<br>begin<br> &nbsp; // showmessage('hi');<br> &nbsp; &nbsp;Timer1.Interval:=TrackBar1.Position;<br> &nbsp; &nbsp;GetCursorPos(po);<br> &nbsp; &nbsp;for s:= 0 to strtoint(edit1.Text) -1 do<br> &nbsp; &nbsp;begin<br> &nbsp; &nbsp;mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);<br> &nbsp; &nbsp;mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);<br> &nbsp; &nbsp;edit1.Text:=inttostr(strtoint(edit1.Text)-1);<br> &nbsp; &nbsp;end; <br>// &nbsp;SetCursorPos(po.X,po.Y);<br>end; <br><br>你的for循环是不是少了一对begin end?
 
点击一次有效果吗? 还是都没效果?
 
我做了一个测试程序,checkbox1.checked:=true;时触发memo1.color变色这个测试程序<br>工作正常,只是点击速度比较慢,可以鼠标一切换到游戏窗口上的加点按钮就没反映了,只能通过手工加点,难道那个按妞不是标准windows组件?没有句柄?
 
什么游戏?具体游戏具体分析。每个游戏可能采用不同的防外挂方法。
 
奇迹Mu,就是第九城市代理的那款网络游戏
 
自己反汇编分析程序吧<br>一般来说程序会采用 GetAsyncKeyState,DeviceIoControl。。。等函数来防外挂的。最好的办法就是分析程序。
 
多人接受答案了。
 
后退
顶部