работает в играх
не работает там, где явно запрещено
Add(InlineCode,3935702,287,140)
{
@Hint=#22:Запрос NamePC Name Bit|
@Color=16777130
WorkPoints=#12:doMouseClick|11:doMouseDown|9:doMouseUp|15:doKeyBoardPress|14:doKeyBoardDown|12:doKeyBoardUp|11:doMouseMove|0:|
DataPoints=#3:Key|1:X|1:Y|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|29:uses Windows,kol,Share,Debug;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|0:|9: public|24: Key,X,Y: THI_Event;|57: procedure doMouseClick(var _Data:TData; Index:word);|60: procedure doKeyBoardPress(var _Data:TData; Index:word);|56: procedure doMouseDown(var _Data:TData; Index:word);|54: procedure doMouseUp(var _Data:TData; Index:word);|56: procedure doMouseMove(var _Data:TData; Index:word);|59: procedure doKeyBoardDown(var _Data:TData; Index:word);|57: procedure doKeyBoardUp(var _Data:TData; Index:word);|5: end;|0:|0:|14:implementation|0:|5:const|102: _mdown:array[1..3]of cardinal = (MOUSEEVENTF_LEFTDOWN,MOUSEEVENTF_RIGHTDOWN,MOUSEEVENTF_MIDDLEDOWN);|94: _mup:array[1..3]of cardinal = (MOUSEEVENTF_LEFTUP,MOUSEEVENTF_RIGHTUP,MOUSEEVENTF_MIDDLEUP);|21: INPUT_KEYBOARD = 1;|0:|28:procedure MouseDown(b:byte);|3:var|16: inp: TInput;|20: mi: TMouseInput;|5:begin|31: ZeroMemory(@mi, sizeof(mi));|33: ZeroMemory(@inp, sizeof(inp));|26: mi.dwFlags:= _mdown[b];|16: inp.mi := mi;|32: SendInput(b,inp,sizeof(inp));|4:end;|0:|26:procedure MouseUp(b:byte);|3:var|16: inp: TInput;|20: mi: TMouseInput;|5:begin|31: ZeroMemory(@mi, sizeof(mi));|33: ZeroMemory(@inp, sizeof(inp));|24: mi.dwFlags:= _mup[b];|16: inp.mi := mi;|32: SendInput(b,inp,sizeof(inp));|4:end;|0:|0:|31:procedure KeyBoardDown(b:byte);|0:|3:var|37: inp: packed array [0..1] of TInput;|2: |5:begin|33: inp[0].Itype := INPUT_KEYBOARD;|21: inp[0].ki.wVk := b;|25: inp[0].ki.dwFlags := 0;|39: SendInput(2, inp[0], SizeOf(TInput));|4:end;|0:|29:procedure KeyBoardUp(b:byte);|0:|3:var|37: inp: packed array [0..1] of TInput;|2: |5:begin|33: inp[1].Itype := INPUT_KEYBOARD;|21: inp[1].ki.wVk := b;|40: inp[1].ki.dwFlags := KEYEVENTF_KEYUP; |39: SendInput(2, inp[0], SizeOf(TInput));|4:end;|0:|0:|39:procedure MouseMove(posx,posy:integer);|0:|3:var|37: inp: packed array [0..1] of TInput;|2: |5:begin|30: inp[0].Itype := INPUT_MOUSE;|40: inp[0].mi.dwFlags := MOUSEEVENTF_MOVE;|23: inp[0].mi.dx := posx;|23: inp[0].mi.dy := posy;|39: SendInput(1, inp[0], SizeOf(TInput));|4:end;|0:|0:|0:|34:procedure THiAsmClass.doMouseMove;|0:|0:|5:begin|55:MouseMove(ReadInteger(_Data, X),ReadInteger(_Data, Y));|4:end;|0:|0:|0:|0:|35:procedure THiAsmClass.doMouseClick;|0:|3:var|9:mbk:Byte;|0:|5:begin|29:mbk:=ReadInteger(_Data, Key);|15:MouseDown(mbk);|9:Sleep(1);|13:MouseUp(mbk);|4:end;|0:|38:procedure THiAsmClass.doKeyBoardPress;|0:|3:var|9:mbk:Byte;|0:|5:begin|29:mbk:=ReadInteger(_Data, Key);|18:KeyBoardDown(mbk);|9:Sleep(1);|16:KeyBoardUp(mbk);|4:end;|0:|0:|37:procedure THiAsmClass.doKeyBoardDown;|0:|3:var|9:mbk:Byte;|0:|5:begin|29:mbk:=ReadInteger(_Data, Key);|18:KeyBoardDown(mbk);|4:end;|0:|0:|35:procedure THiAsmClass.doKeyBoardUp;|0:|3:var|9:mbk:Byte;|0:|5:begin|29:mbk:=ReadInteger(_Data, Key);|16:KeyBoardUp(mbk);|4:end;|0:|0:|34:procedure THiAsmClass.doMouseDown;|0:|3:var|9:mbk:Byte;|0:|5:begin|29:mbk:=ReadInteger(_Data, Key);|15:MouseDown(mbk);|4:end;|0:|0:|32:procedure THiAsmClass.doMouseUp;|0:|3:var|9:mbk:Byte;|0:|5:begin|29:mbk:=ReadInteger(_Data, Key);|13:MouseUp(mbk);|4:end;|0:|4:end.|
}
Редактировалось 1 раз(а), последний 2022-11-07 21:25:42