Jump to content

Its2l82die

Members
  • Posts

    19
  • Joined

  • Last visited

Everything posted by Its2l82die

  1. This one looks useful too, as it turns out HotKeySet("{1 Down}","Single") doesn't yield any result although it doesn't give any error either. I guess it's just the way that autoit is built, no using Hotkeyset with key down. I'll give your method a try, Thanks.
  2. Hi guys, My problem is a script which I don't really know how to write. I want to have a HotKeySet type of function that will run the function only when the key is pressed and when I let it go it will stop(using some kind of loop inside of course), rather than press key X and the function is running until X is pressed again, like so: HotKeySet("{1}","Single") Func Single () $1 = Not $1 EndFunc While 1 While $1 ControlSend($hwnd,"","","{F2}") Sleep(200) ControlSend($hwnd,"","","{F4}") WEnd WEnd And make the function be in a certain sleep mode if its possible(not the old "while 1 sleep(x) wend" type of thing), cause I cant be wasting valuable RAM resources. Thanks in advance, Its2l82die EDIT: Found my answer using {X Down} please close of delete this thread there is no more use in it, and sorry for opening it.
  3. I'm sorry for bumping this up but its been sometime since I started this thread and no one have helped me with my issue. What I'm asking is does anyone know what is the MakelParam function in VB(I believe it is), and what does it do to the X and Y values of the mouse's coordinates? @cameronsdad Sorry if you didn't understand me, but what I meant is that ControlClick() won't do for me cause the window doesn't have a Control ID and MouseClick() is not an option as I need the window do be minimized. Thanks in advance, Its2l82die.
  4. I understand that, thats why I'm asking if you could show me the function that MakelParam does in Autoit script language and not give me an alternative command. Hope you understand what I mean and sorry I'm not explaining myself right.
  5. Hi, I'm trying to write a script that will post a message of a single mouse click so correct me if I'm wrong but the lines should look like this: DllCall("user32.dll","int","PostMessage","hwnd",$hwnd,"Int",0x00000201,"Int",0x00000001,"long",$cords) DllCall("user32.dll","int","PostMessage","hwnd",$hwnd,"Int",0x00000202,"Int",0x00000001,"long",$cords) My problem is in the $cords part. As I know there is a Macro in C++ which is called MakelParam that combines the X coordinates of the mouse and the Y coordinates into a single value that goes into $cords which is our lparam. Could someone help me understand what happens inside MakelParam in Autoit script language, or show it in a snippet. Thanks in Advance, Its2l82die
  6. Thanks to the whole team that developed this UDF. Using its _WinAPI_EnumProcessWindows function saved me a lot of time. Keep up the good work hope to see more useful functions.
  7. Thanks for nothing! Found my error and fixed it myself. If anyone is interested as to where I was wrong it was the synchronization problem of the PID and the handles take a look at the script carefully and you'll see it. Anyway again thanks for nothing
  8. Hi, I'm having some problems with my script now if any of you know how to use PostMessage in a dll you'll probably understand my problem. What I'm trying to do is send a certain key when the value of one pointer is smaller than the value of another so here is the script: #include <NomadMemory.au3> HotKeySet("+x","Terminate") Func Terminate () Exit 0 EndFunc Global $WMKEYDOWN = 0x100 Global $WMKEYUP = 0x101 Global $key = 0x33;the value of the key to send for info http://api.farmanager.com/en/winapi/virtualkeycodes.html Global $key1 = 0x67; Heal key Global $nottouse = InputBox("Handle","Input the Handle of your application that you don't want to be used (in this format 0x00000000)") Global $hwnd = WinList("Battles for Glory") Global $pids = ProcessList("l2.exe") Global $baseaddr = "0x10969D60" Global $offset [10] $offset [0] = 0 $offset [1] = Dec ("114") $offset [2] = Dec ("0") $offset [3] = Dec ("C") $offset [4] = Dec ("0") $offset [5] = Dec ("4C") $offset [6] = Dec ("684") $offset [7] = Dec ("3C4") $offset [8] = Dec ("5FC") $offset [9] = Dec ("524") Global $offset1 [10] $offset1 [0] = 0 $offset1 [1] = Dec ("114") $offset1 [2] = Dec ("0") $offset1 [3] = Dec ("C") $offset1 [4] = Dec ("0") $offset1 [5] = Dec ("4C") $offset1 [6] = Dec ("684") $offset1 [7] = Dec ("3C4") $offset1 [8] = Dec ("5FC") $offset1 [9] = Dec ("51C") While 1 For $i=1 To $hwnd [0][0] $prohwnd = _MemoryOpen($pids [$i][1]) $hp = _MemoryPointerRead ($baseaddr,$prohwnd,$offset) $hpmax = _MemoryPointerRead ($baseaddr,$prohwnd,$offset1) If $hp [1] < $hpmax [1] Then MsgBox(0,"",""&$hp [1]&","&$hpmax [1]&"") DllCall("BypassedPostmessage.dll","int","myPostMessageA","hwnd",$hwnd [$i][1],"long",$WMKEYDOWN,"long",$key1,"long",0) Sleep(10) EndIf Next WEnd As you can see I have this line in my script: MsgBox(0,"",""&$hp [1]&","&$hpmax [1]&"") I use it just to see if my pointers work and they do work fine (I see the message only when the value of $hpmax [1] is bigger than $hp [1]) now the problem is that the DllCall doesn't send the key at all. If anyone sees my problem please show it to me. Thanks in advance.
  9. Hi, Ive got problem, I try to read the value of a pointer in a few processes that are the same. But I can't do it for some reason here is the script: #include <NomadMemory.au3> HotKeySet("+x","Terminate") Func Terminate () Exit 0 EndFunc Global $WMKEYDOWN = 0x100 Global $key = 0x33 Global $nottouse = InputBox("Handle","Input the Handle of your application that you don't want to be used (in this format 0x00000000)") Global $hwnd = WinList("Battles for Glory") Global $pids = ProcessList("Battles for Glory") Global $offset [6] Global $baseaddr $offset [0] = 0 $offset [1] = 0x328 $offset [2] = 0x14C $offset [3] = 0x54 $offset [4] = 0x34 $offset [5] = 0x224 For $i=1 To $pids [0][0] $prohwnd = _MemoryOpen($pids [$i][1]) $baseaddr [$i] = _MemoryGetBaseAddress($prohwnd,0) Next While 1 For $i=1 To $hwnd [0][0] If $hwnd [$i][1] <> $nottouse Then DllCall("BypassedPostmessage.dll","int","myPostMessageA","hwnd",$hwnd [$i][1],"long",$WMKEYDOWN,"long",$key,"long",0) $hp = _MemoryPointerRead ($baseaddr [$i],$hwnd,$offset) MsgBox(0,"message",""&$hp [1]&"") Sleep(10) EndIf Next WEnd And here is the error that I get: (32) : ==> Subscript used with non-Array variable.: $hp = _MemoryPointerRead ($baseaddr [$i],$hwnd,$offset) $hp = _MemoryPointerRead ($baseaddr ^ ERROR >Exit code: 1 Time: 1.346
  10. Ok, well its not that the app is too slow I gave it a Sleep(200) still it sends only one character. Do you know by any change what is what is the exit code -1073741819 EDIT: Never mind I found my problem. the Iparam was unnecessary for some reason.
  11. Thanks for the reply well now it did work but it sends just one character and thats it, while its in a endless loop strange. maybe I should set the $lparam to something else? And for some reason I get this >Exit code: -1073741819
  12. ok so this is how it looks after the revision but still it won't even send to the Notepad I don't know whats wrong with it =\ Thats how the new script looks like: HotKeySet("+x","Terminate") Func Terminate () Exit 0 EndFunc Const $WMKEYDOWN = 0x100 Const $WMKEYUP = 0x101 Const $key = 0x33 Const $lparam = 0 $hwnd=WinList("New Text Document - Notepad") While 1 For $i=1 To $hwnd [0][0] $ggbp = DllOpen("ggbp.dll") DllCall($ggbp,"int","ggPMA","hwnd",$hwnd [$i][1],"long",$WMKEYDOWN,"long",$key,"long",$lparam,"long") DllCall($ggbp,"int","ggPMA","hwnd",$hwnd [$i][1],"long",$WMKEYUP,"long",$key,"long",$lparam,"long") $ggbp = DllClose("ggbp.dll") Next WEnd Hope you can help. EDIT: No result even with user32.dll its not different in Windows 7 X64 right?
  13. Ok, got that now i started reading the the MSDN in microsofts website and now a lot is clear to me. Do I have to add an lparam at the end of my first DllCall()or is it unnecessary? And if I won't add a WM_KEYUP message it will act as if the key is still being pressed? Thanks for you replies EDIT:for some reason it doesn't work even with a Notepad. Where should I put my Dll, at the same location where the script is or where the autoit3.exe is?
  14. Hi, I'm trying to write a small script that will send "3" to a few applications that their titles are the same lets say "app". By using their handles I made the script to send "3" to each of them in turn. Now my problem is I don't exactly understand how DllCall() works so I'll show you what I wrote and maybe you guys could guide me and correct me if I have something wrong with the script. So here it is: HotKeySet("+x","Terminate") Func Terminate () Exit 0 EndFunc Const $WMKEYDOWN = 0x100 Const $key = 0x33 $hwnd=WinList("app") While 1 For $i=1 To $hwnd [0][0] DllCall("ggbp.dll","int","PostMessageA","HWnd",$hwnd [$i][1],"long",$WMKEYDOWN,"long",$key,"long") Next WEnd ggbp.dll is a dll that by what I was told bypasses a block that a certain program has on PostMessage, which disables the use of Send() and ControlSend() to the app. Using ggbp.dll and DllCall() is supposed to send the key "3" using the bypassed from of PostMessage which is PostMessageA. I don't really know how does PostMessage works if someone would be kind enough to show me the correct way to write it or at least explain what I'm doing wrong. Thanks.
  15. Thanks again for the reply now what I have discovered is that this "app" won't receive Send functions whatsoever even using Winactivate and then Send won't work. I think the app has some kind of protection, so is there anyway around this maybe mask the Send functions somehow so that the app won't know its receiving a Send function?
  16. Ok, the ControlClick does work but now comes another problem, sometimes I resize the application and certain buttons change cords in there so the ControlClick is not a permanent. if anyone have some more solutions,ideas or maybe even a way to get a Control ID aside from the Window info tool please reply here.
  17. @martin It would work but the whole point is not using Send() because it needs the windows to be active and it disables everything else. @mistersquirrle if it really does work this way well then I guess this is my solution,I don't necessary have to ControlSend "3" I can press on a cord with a button in there instead. I'll try it now. Thanks to both of you.
  18. Thanks for the reply but the whole idea of the script is working in the background and not disturbing other program so ControlClick won't help me here and about the Control ID I guess your right but I have read in another thread someone saying its not necessary to send strings. Hope to here some more thoughts or ideas.
  19. Hi I'm trying to write a script that will send "3" to a few handles that their windows have the same titles, the windows have no control and I don't know if its needed. So my script looks like this: HotKeySet("+x","Terminate") $appslist=WinList("app") While 1 For $i = 1 To $appslist [0] [0] ControlSend($appslist [$i] [1],"","","3") Next WEnd Func Terminate () Exit 0 EndFunc I tried to msgbox the handles to see if maybe the problem is with the handles, and the results are good. I do get the handles of the windows, I compared them with the AutoIt Windows Info tool. If anyone have any idea about what is the problem please reply, Thanks.
×
×
  • Create New...