autoitxp Posted June 28, 2009 Share Posted June 28, 2009 (edited) Hi i wanted to ask how we can make make backspace works properly for example i press "A" 4 times after this i hit backspace it removes properly from right side (ofcourse coz of StringTrimRight) but if i wanted to remove char let say i press "A" 4 times again and wanted to remove mid second "A" then how to achive this . #include <Misc.au3> $dll = DllOpen("user32.dll") Global $s_Text While 1 Sleep ( 250) If _IsPressed("41", $dll) Then _keys("a") If _IsPressed("08", $dll) Then _keys("_BackSpace") WEnd Func _keys($read) If $read <> "_BackSpace" Then Global $s_Text $s_Text &= $read TrayTip($s_Text, $s_Text, 5) Else If $read = "_BackSpace" Then $s_Text = StringTrimRight($s_Text, 1) EndIf EndIf EndFunc;==>_keylog DllClose($dll) Edited June 28, 2009 by autoitxp Link to comment Share on other sites More sharing options...
AwAke Posted June 28, 2009 Share Posted June 28, 2009 Uhm not sure entirely on what you mean but from what I think you mean is as follows: #include <Misc.au3> $dll = DllOpen("user32.dll") Global $s_Text While 1 Sleep ( 250) If _IsPressed("41", $dll) Then _keys("a") If _IsPressed("08", $dll) Then _keys("_BackSpace") WEnd Func _keys($read) If $read <> "_BackSpace" Then Global $s_Text $s_Text &= $read TrayTip($s_Text, $s_Text, 5) Else If $read = "_BackSpace" Then $s_Text = StringMid(Floor(StringLen($s_text)/2), 1) EndIf EndIf EndFunc;==>_keylog DllClose($dll) Not sure if that syntax is correct :/ Aint programmed for a while Link to comment Share on other sites More sharing options...
autoitxp Posted June 28, 2009 Author Share Posted June 28, 2009 lol nope its even worst then before ;d Link to comment Share on other sites More sharing options...
bogQ Posted June 28, 2009 Share Posted June 28, 2009 (edited) but if i wanted to remove char let say i press "A" 4 times again and wanted to remove mid second "A" then how to achive this .sometnihg simular to this? edit: remaked with array Global $output $removecount = 2 $abcd1 = "IlikeTOlearne" $abcd = StringSplit($abcd1, "") $data = StringLen($abcd1)/2 If StringInStr($data,".") Then $data =Floor($data)+1 Else $data =Floor($data) EndIf For $x = 1 To $abcd[0] If $x <> $data+$removecount Then $output = $output&$abcd[$x] EndIf Next MsgBox(0,$data+$removecount,$output) Edited June 28, 2009 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
autoitxp Posted June 28, 2009 Author Share Posted June 28, 2009 i think first we need to know backspace position. "$removecount " how to know weather which "A" waz pressed to remove Link to comment Share on other sites More sharing options...
martin Posted June 28, 2009 Share Posted June 28, 2009 Hi i wanted to ask how we can make make backspace works properly for example i press "A" 4 times after this i hit backspace it removes properly from right side (ofcourse coz of StringTrimRight) but if i wanted to remove char let say i press "A" 4 times again and wanted to remove mid second "A" then how to achive this . #include <Misc.au3> $dll = DllOpen("user32.dll") Global $s_Text While 1 Sleep ( 250) If _IsPressed("41", $dll) Then _keys("a") If _IsPressed("08", $dll) Then _keys("_BackSpace") WEnd Func _keys($read) If $read <> "_BackSpace" Then Global $s_Text $s_Text &= $read TrayTip($s_Text, $s_Text, 5) Else If $read = "_BackSpace" Then $s_Text = StringTrimRight($s_Text, 1) EndIf EndIf EndFunc;==>_keylog DllClose($dll) Is this what you mean? #include <Misc.au3> $dll = DllOpen("user32.dll") Global $s_Text HotKeySet("A", "Apress") HotKeySet("a", "Apress") HotKeySet("{BS}", "BSPress") While 1 Sleep(250) WEnd Func APress() HotKeySet("A") HotKeySet("a") Send(@HotKeyPressed) $s_Text &= "a" TrayTip($s_Text, $s_Text, 5) HotKeySet("A", "Apress") HotKeySet("a", "Apress") EndFunc ;==>APress Func BSPress() HotKeySet("{BS}") Send(@HotKeyPressed) $s_Text = StringTrimRight($s_Text, 1) TrayTip($s_Text, $s_Text, 5) HotKeySet("{BS}", "BSPress") EndFunc ;==>BSPress Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
bogQ Posted June 28, 2009 Share Posted June 28, 2009 i think first we need to know backspace position. "$removecount " how to know weather which "A" waz pressed to removeposition in what? in tooltip? r y trying to make keyloger? TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
autoitxp Posted June 28, 2009 Author Share Posted June 28, 2009 (edited) lol boq() u think _is pressed to use for keylogger where key press time is 0.10 msec delays not possible lol juggment not true ;d Edited June 28, 2009 by autoitxp Link to comment Share on other sites More sharing options...
bogQ Posted June 28, 2009 Share Posted June 28, 2009 juggment not true ;dis tracking keyes while input them and with it its detecting position of curent place of tuping cursor so that correct letter can b detected or delited, i called it keyloger becose it looks like its gooing to that direction. Maby it is maby it isnt but it looks like one in my mind.sry for debate im off from this topic TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
autoitxp Posted June 28, 2009 Author Share Posted June 28, 2009 (edited) ty . this code works much better how to save pressed key in 1 line by default _filewritelog repeating same chars n saving in each line how to fix this #include <Misc.au3> #include <file.au3> $dll = DllOpen("user32.dll") Global $s_Text HotKeySet("A", "Apress") HotKeySet("a", "Apress") HotKeySet("{BS}", "BSPress") While 1 Sleep(250) WEnd Func APress() HotKeySet("A") HotKeySet("a") Send(@HotKeyPressed) $s_Text &= "a" _FileWriteLog("my.log" , $s_Text ) HotKeySet("A", "Apress") HotKeySet("a", "Apress") EndFunc ;==>APress Func BSPress() HotKeySet("{BS}") Send(@HotKeyPressed) $s_Text = StringTrimRight($s_Text, 1) _FileWriteLog("my.log" , $s_Text ) HotKeySet("{BS}", "BSPress") EndFunc ;==>BSPress Edited June 28, 2009 by autoitxp Link to comment Share on other sites More sharing options...
Thornhunt Posted June 29, 2009 Share Posted June 29, 2009 this looks alot like a keylogger Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now