layer Posted December 30, 2004 Share Posted December 30, 2004 hey guys... i have this expression and i was wanting to know if it is right the way it is, or if it has to be modified :"> If _IsPressed ('01') and $pos= "55, 210" then FileWrite (@DesktopDir & "\clicks.txt\", "LeftMouseClicked!") EndIfthe expression should be like this is english: if mouse1 is pressed at the corrdinates 55(x), 200(y) then amke a file named clicks.txt on the desktop and write LeftMouseClicked!this must be possible, could someone help me? because im not sure if it's working... thanks! FootbaG Link to comment Share on other sites More sharing options...
Wolvereness Posted December 30, 2004 Share Posted December 30, 2004 (edited) You need to declare $pos One line $pos Dim and a one line 'If' statement$pos = MouseGetPos() If _IsPressed ('01') = 1 And $pos[0] = 55 And $pos[1] = 210 Then FileWrite (@DesktopDir & '\clicks.txt', 'LeftMouseClicked!') I would also like to ask you don't make this a keylogger, to me it looks like the framework to me. Edited December 30, 2004 by Wolvereness Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote] Link to comment Share on other sites More sharing options...
killaz219 Posted December 30, 2004 Share Posted December 30, 2004 (edited) Maybe you could do a quick MouseGetPos right when it clicks?Edit: Damn you wolv and your fast response (well not fast since it is a little while after he posted) Edited December 30, 2004 by killaz219 Link to comment Share on other sites More sharing options...
layer Posted December 30, 2004 Author Share Posted December 30, 2004 nahh... ive already made a keylogger, but i dont use it for bad purposes... it's because when ezzetabi made the _IsPressed Func someone said "thanks, i fianally made a keylogger!" i said "how the heck could you make a keylogger?" and he just said well u just gotta do this for every letter lalalala and so on... but i have never used it.. but actually it's for a game and im going to have to store it in an ini file for reawding later on FootbaG Link to comment Share on other sites More sharing options...
layer Posted December 30, 2004 Author Share Posted December 30, 2004 (edited) still don't work (i think) just so you guys can see... this is what im trying to do... i tried putting a message box so if u click 55, 210 it would show up!expandcollapse popup#include <GUIConstants.au3> GUICreate ("Shoot it!", 300, 300) GUISetState () GUISetCursor (3, 1) $target= GUICtrlCreatePic (@DesktopDir & "\target.bmp", 50, 200, 60, 50) $hitme= GUICtrlCreateLabel ("Hit the target!", 150, 100) Func _IsPressed($hexKey) ; $hexKey must be the value of one of the keys. ; _IsPressed will return 0 if the key is not pressed, 1 if it is. ; $hexKey should entered as a string, don't forget the quotes! ; (yeah, layer. This is for you) Local $aR, $bO $hexKey = '0x' & $hexKey $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then $bO = 1 Else $bO = 0 EndIf Return $bO EndFunc;==>_IsPressed $loc = 60 Do GUICtrlSetColor ($hitme, 0xff0000) $get = GUIGetMsg() $pos = MouseGetPos() If _IsPressed ('01') = 1 Then SoundPlay(@DesktopDir & "\sg552-1.wav") GUICtrlSetColor ($hitme, 0x00ff00) $pos = MouseGetPos() Sleep("275") EndIf If _IsPressed ('01') and $pos= "55, 210" then FileWrite (@DesktopDir & "\clicks.ini\", "LeftMouseClicked!") MsgBox (0, "u clicked it!", "u clicked teh left mouse at 55, 210...") sleep ("250") EndIf Until $get = -3just download those files (the sound and picture) if you'd like, you don't have to... and make sure u put it on ur desktop dir because if u don't the GUI won't be able to get it... also there may be some old syntax.. im at my cusins house and they have the older version... so if i click at 55, 210 NO messagebox comes up!!! someone please help? i will explain further if asked EDIT: that gun sound is from valve or from counter-strike or some creator of something, heres the link.. im pretty sure it was this... http://cs.gamegate2k.com/counterstrike/cssounds Edited December 30, 2004 by layer FootbaG Link to comment Share on other sites More sharing options...
layer Posted December 30, 2004 Author Share Posted December 30, 2004 please FootbaG Link to comment Share on other sites More sharing options...
Developers Jos Posted December 30, 2004 Developers Share Posted December 30, 2004 (edited) please <{POST_SNAPBACK}>did you try turnning the 2 If's around like:If _IsPressed('01') And $pos = "55, 210" Then FileWrite(@DesktopDir & "\clicks.ini\", "LeftMouseClicked!") MsgBox(0, "u clicked it!", "u clicked teh left mouse at 55, 210...") Sleep("250") ElseIf _IsPressed('01') = 1 Then SoundPlay(@DesktopDir & "\sg552-1.wav") GUICtrlSetColor($hitme, 0x00ff00) $pos = MouseGetPos() Sleep("275") EndIf Edited December 30, 2004 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
layer Posted December 30, 2004 Author Share Posted December 30, 2004 that doesn't even play the sound anymore but when you do If _IsPressed('01') And $pos = "55, 210" Thenis that for the whole desktop size or for the gui window? do you understand? how would i find out where the control is for the whole desktop size? i saw a post about this just a few weeks ago, but i can't seem to find it :/ ive also tried seaerching but i dont think they have exactly what i want... i need to have a loop where it plays the noise when mouse1 is pressed and then if mouse1 is pressed in the middle of the target, msgbox (lalla) and play the sound... it seems it can't be done im sure it can but i have to find out where the control is on the WHOLE desktop... any suggestions? (this is what i get for trying to make a game...) FootbaG Link to comment Share on other sites More sharing options...
Developers Jos Posted December 30, 2004 Developers Share Posted December 30, 2004 (edited) that doesn't even play the sound anymore but when you do If _IsPressed('01') And $pos = "55, 210" Thenis that for the whole desktop size or for the gui window? do you understand? how would i find out where the control is for the whole desktop size? i saw a post about this just a few weeks ago, but i can't seem to find it :/ ive also tried seaerching but i dont think they have exactly what i want... i need to have a loop where it plays the noise when mouse1 is pressed and then if mouse1 is pressed in the middle of the target, msgbox (lalla) and play the sound... it seems it can't be done im sure it can but i have to find out where the control is on the WHOLE desktop... any suggestions? (this is what i get for trying to make a game...)<{POST_SNAPBACK}>Didn't really check out everything you are doing ... Just had another look.You retirve the Mouse pos here:$pos = MouseGetPos()And test it here... If _IsPressed('01') And $pos = "55, 210" ThenBUT MoluseGetPos() Returns:Return ValueReturns a two-element array that containing the mouse coordinates:$array[0] = X coord (horizontal)$array[1] = Y coord (vertical) Edited December 30, 2004 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Wolvereness Posted December 30, 2004 Share Posted December 30, 2004 (edited) Well, if your using mine i would recomend doing an > and < box. To find the place of a control you do WinGetPos() + ControlGetPos(), But i'm not sure if the titlebar of the window wont mess this up. And to my understanding soundplay() isn't working right now.. Edited December 30, 2004 by Wolvereness Offering any help to anyone (to my capabilities of course)Want to say thanks? Click here! [quote name='Albert Einstein']Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.[/quote][quote name='Wolvereness' date='7:35PM Central, Jan 11, 2005']I'm NEVER wrong, I call it something else[/quote] 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