dbzfanatic Posted November 26, 2008 Share Posted November 26, 2008 No I mean you have to redraw the window every 1/60th of a second or however fast the game refreshes its own screen. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
FireFox Posted November 26, 2008 Author Share Posted November 26, 2008 No I mean you have to redraw the window every 1/60th of a second or however fast the game refreshes its own screen.Redraw the window...huh ok but I use. GUICreate so every 1/60th I do GuiDelete() and remake GUI ?Not the same thing as winapi window Link to comment Share on other sites More sharing options...
dbzfanatic Posted November 26, 2008 Share Posted November 26, 2008 You can simply send a $WM_PAINT message to the window to redraw it if you wish to do it that way. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
FireFox Posted November 27, 2008 Author Share Posted November 27, 2008 It works !!! but it refresh all window so i want to have more information than helpfile about _WinAPI_RedrawWindow , more precise i want to know how configure this constant : Global Const $tagRECT = "int Left;int Top;int Right;int Bottom" I want to configure this "int Left;int Top;int Right;int Bottom" , just strange with quotes... Link to comment Share on other sites More sharing options...
dbzfanatic Posted November 27, 2008 Share Posted November 27, 2008 It's just asking for the top,top left,bottom,and bottom right of your window. You can use WinGetPos() to do that , at least I think that's what it's asking for. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
FireFox Posted November 27, 2008 Author Share Posted November 27, 2008 It's just asking for the top,top left,bottom,and bottom right of your window. You can use WinGetPos() to do that , at least I think that's what it's asking for. Thats what I was thinking for but how I do the global constant ? $pos=WinGetPos("crosshair") Global Const $Rect =$pos[0]&$pos[1]&$pos[3]&$pos[4] Thats strange because you have 4 positions in one constant I don't know how to do it ! Thanks for anyhelp! Link to comment Share on other sites More sharing options...
dbzfanatic Posted November 27, 2008 Share Posted November 27, 2008 (edited) This is a bit outta my domain. Is the crosshair going to move or simply be in the center of the screen? If it moves I don't think you can use a constant unless you're constantly redeclaring it (hehehe,pun). I could be wrong since I haven't used the API functions before and most of this is from my short time working with C++ but if it is done as you put then from the looks of what you posted above I'd think it would have to be something like:$pos = WinGetPos("crosshair") Global Const $Rect = $pos[0] & ";" & $pos[1] & ";" & $pos[2] & ";" & $pos[3]Like I said I could be wrong because I haven't used the API functions but it's worth a shot right?Edit: Looking over the helpfile you could just do_WinAPI_RedrawWindow($GUI,0,0,$RDW_UPDATENOW)I think. Edited November 27, 2008 by dbzfanatic Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
monoceres Posted November 27, 2008 Share Posted November 27, 2008 (edited) It works !!! but it refresh all window so i want to have more information than helpfile about _WinAPI_RedrawWindow , more precise i want to know how configure this constant : Global Const $tagRECT = "int Left;int Top;int Right;int Bottom" I want to configure this "int Left;int Top;int Right;int Bottom" , just strange with quotes... It's a declaration for a rect struct. Sample usage: $rect=DllStructCreate($tagRECT) DllStructSetData("Left",0) DllStructSetData("Top",0) DllStructSetData("Right",800) DllStructSetData("Bottom",600) Edited November 27, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
FireFox Posted November 27, 2008 Author Share Posted November 27, 2008 (edited) $rect=DllStructCreate($tagRECT) DllStructSetData("Left",0) DllStructSetData("Top",0) DllStructSetData("Right",800) DllStructSetData("Bottom",600) Thanks for your reply but it has some error and i don't know how to use it with _WinAPI_RedrawWindow ERROR: DllStructSetData() [built-in] called with wrong number of args. DllStructSetData("Bottom",600) $HDL=WinGetHandle($win,"") _WinAPI_RedrawWindow($HDL,$TagRECT,1,$WM_PAINT) Edited November 27, 2008 by FireFox Link to comment Share on other sites More sharing options...
monoceres Posted November 27, 2008 Share Posted November 27, 2008 $rect=DllStructCreate($tagRECT) DllStructSetData("Left",0) DllStructSetData("Top",0) DllStructSetData("Right",800) DllStructSetData("Bottom",600) Thanks for your reply but it has some error and i don't know how to use it with _WinAPI_RedrawWindow ERROR: DllStructSetData() [built-in] called with wrong number of args. DllStructSetData("Bottom",600) $HDL=WinGetHandle($win,"") _WinAPI_RedrawWindow($HDL,$TagRECT,1,$WM_PAINT) That's embarrassing Here's the correct one: $rect=DllStructCreate($tagRECT) DllStructSetData($rect,"Left",0) DllStructSetData($rect,"Top",0) DllStructSetData($rect,"Right",800) DllStructSetData($rect,"Bottom",600) Pass $rect to redraw window. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
FireFox Posted November 29, 2008 Author Share Posted November 29, 2008 Thanks crosshair is now visible on game But I have another problem : when I shoot in game (so I click on crosshair) I return to desktop... Anysuggestions ? thanks for answers ! Link to comment Share on other sites More sharing options...
dbzfanatic Posted November 29, 2008 Share Posted November 29, 2008 That's a tricky problem. My guess would be the crosshair app is taking the focus instead of leaving it on the game. Maybe try adding GUISetState(@SW_DISABLE) after you show it? Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
FireFox Posted November 29, 2008 Author Share Posted November 29, 2008 (edited) That's a tricky problem. My guess would be the crosshair app is taking the focus instead of leaving it on the game. Maybe try adding GUISetState(@SW_DISABLE) after you show it?Thanks, work fine for that Again another problem : In the game left mouse click don't work so it can't shoot because I click on crosshair... Edited November 29, 2008 by FireFox Link to comment Share on other sites More sharing options...
FireFox Posted November 29, 2008 Author Share Posted November 29, 2008 (edited) I've tried _MouseSetOnEvent UDF but now i can't click anywhere in the game because i don't know how i can send to game to shoot... An example here : #include <MouseSetOnEvent_UDF.au3> While 1 Sleep(10) _MouseSetOnEvent($MOUSE_PRIMARYDOWN_EVENT, "_Mouse") WEnd Func _Mouse() ;Here i want script to send Left mouse click to game EndFunc Edited November 29, 2008 by FireFox Link to comment Share on other sites More sharing options...
dbzfanatic Posted November 29, 2008 Share Posted November 29, 2008 (edited) Try this in your While 1 loop: If _IsPressed("01") Then $pos = MouseGetPos() ControlClick(*window name*,"","","primary",1,$pos[0],$pos[y] EndIf Try sticking that above your message loop in the while. Edit: also you've been here long enough to know most of us consider it rude to bump within 24 hours of your previous post, much less 10 minutes. Please edit next time. Edited November 29, 2008 by dbzfanatic Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
FireFox Posted November 29, 2008 Author Share Posted November 29, 2008 (edited) Try this in your While 1 loop: If _IsPressed("01") Then $pos = MouseGetPos() ControlClick(*window name*,"","","primary",1,$pos[0],$pos[y] EndIf Try sticking that above your message loop in the while. Edit: also you've been here long enough to know most of us consider it rude to bump within 24 hours of your previous post, much less 10 minutes. Please edit next time. Thanks for your reply but i have one error : ControlClick() called with illegal argument 4: "primary" ControlClick("Counter-Strike Source","","","primary",1,510,382) And I have the lastest beta version... Edited November 29, 2008 by FireFox Link to comment Share on other sites More sharing options...
dbzfanatic Posted November 29, 2008 Share Posted November 29, 2008 I get that sometimes too which makes no sense.Button Normal Swapped "" Left Left "left" Left Left "middle" Middle Middle "right" Right Right "primary" Left Right "main" Left Right "secondary" Right Left "menu" Right LeftJust replace primary with left. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
FireFox Posted November 29, 2008 Author Share Posted November 29, 2008 @dbzfanatic Thanks it works now another problem : When I press "left mouse" it shoot in game, but when I want to plant bomb (left mouse down) It always send one click so I can't plant bomb... If _IsPressed("01") Then $POS=MouseGetPos() ControlClick("Counter-Strike Source","","","Left",1,$POS[0]-2,$POS[1]-2) EndIf Perhaps script like _Ispresseddown ? Link to comment Share on other sites More sharing options...
dbzfanatic Posted November 29, 2008 Share Posted November 29, 2008 Holding the left button down or double clicking? You have to make some sacrifices to do this, you have to realize that. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
dbzfanatic Posted November 29, 2008 Share Posted November 29, 2008 You still didn't really answer my question. Do you mean holding the button down or double clicking it? Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/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