NoHAX Posted October 25, 2009 Share Posted October 25, 2009 (edited) This is strange problem, because this is so simply and it doesnt work expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("GUIonEventMode", 1) Opt("MouseCoordMode", 0) Opt("SendKeyDelay", 40) #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("AutoBonner by NoHax", 491, 451, 192, 124) GUISetBkColor(0x000000) $Button1 = GUICtrlCreateButton("Run", 304, 344, 161, 25, $WS_GROUP) $Button2 = GUICtrlCreateButton("Exit", 304, 408, 161, 25, $WS_GROUP) $Button3 = GUICtrlCreateButton("Options", 304, 376, 161, 25, $WS_GROUP) GUISetState(@SW_SHOW, $Form1) $Form2 = GUICreate("Options", 380, 300, 702, 279) GUISetBkColor(0x000000) $Input1 = GUICtrlCreateInput("", 12, 23, 169, 21) $Input2 = GUICtrlCreateInput("", 12, 71, 169, 21) $Label1 = GUICtrlCreateLabel("Time between bw (more then 24s)", 12, 55, 164, 17) GUICtrlSetColor(-1, 0xFFFFFF) $Button1a = GUICtrlCreateButton("OK", 133, 256, 120, 33, $WS_GROUP) $Label2 = GUICtrlCreateLabel("Text added after bw (optionally)", 12, 200, 152, 17) GUICtrlSetColor(-1, 0xFFFFFF) $Label3 = GUICtrlCreateLabel("Number of bws", 12, 8, 75, 17) GUICtrlSetColor(-1, 0xFFFFFF) $Input3 = GUICtrlCreateInput("", 12, 216, 169, 21) $Label4 = GUICtrlCreateLabel("Diablo II window name", 12, 104, 111, 17) GUICtrlSetColor(-1, 0xFFFFFF) $Input4 = GUICtrlCreateInput("", 12, 120, 169, 21) $Label5 = GUICtrlCreateLabel("Bonewall hotkey", 12, 152, 82, 17) GUICtrlSetColor(-1, 0xFFFFFF) $Input5 = GUICtrlCreateInput("", 12, 168, 169, 21) $Label6 = GUICtrlCreateLabel("Script wrote in AutoIT" & @CRLF & "Author: NoHax" & @CRLF & "Redgrds to all my friends :)", 208, 20, 391, 90) GUICtrlSetColor(-1, 0xFFFFFF) GUISetState(@SW_HIDE, $Form2) GUICtrlSetOnEvent($Button1, "_run") GUICtrlSetOnEvent($Button2, "_exit") GUICtrlSetOnEvent($Button3, "_options") GUICtrlSetOnEvent($Button1a, "_OK") #EndRegion ### END Koda GUI section ### $title = GUICtrlRead($Input4, 1) $time = GUICtrlRead($Input2, 1) $bwkey = GUICtrlRead($Input5, 1) $text = GUICtrlRead($Input3, 1) $bw = GUICtrlRead($Input1, 1) $hwnd = WinGetHandle($title, 1) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _options() GUISetState(@SW_SHOW, $Form2) EndFunc Func _OK() GUISetState(@SW_HIDE, $Form2) Sleep(100) GUISetState(@SW_SHOW, $Form1) EndFunc Func _exit() MsgBox(0, "Cu", "If you found any bugs, pls send me on CRC_3rror@yahoo.com :)") Exit EndFunc Func _run() For $s=1 To $bw Step 1 Sleep(300) ControlSend($hwnd, "", "",$bwkey) Sleep(100) _MouseClickPlus($hwnd, "right", 536, 233, 1) ControlSend($Title, "", "",$s + 1 & "{Enter}" & $text & "{Enter}") Sleep($Time * 1000) Next EndFunc ;=============================================================================== ; ; Function Name: _MouseClickPlus() ; Version added: 0.1 ; Description: Sends a click to window, not entirely accurate, but works ; minimized. ; Parameter(s): $Window = Title of the window to send click to ; $Button = "left" or "right" mouse button ; $X = X coordinate ; $Y = Y coordinate ; $Clicks = Number of clicks to send ; Remarks: You MUST be in "MouseCoordMode" 0 to use this without bugs. ; Author(s): Insolence <insolence_9@yahoo.com> ; ;=============================================================================== Func _MouseClickPlus($Window, $Button = "left", $X = "", $Y = "", $Clicks = 1) Local $MK_LBUTTON = 0x0001 Local $WM_LBUTTONDOWN = 0x0201 Local $WM_LBUTTONUP = 0x0202 Local $MK_RBUTTON = 0x0002 Local $WM_RBUTTONDOWN = 0x0204 Local $WM_RBUTTONUP = 0x0205 Local $WM_MOUSEMOVE = 0x0200 Local $i = 0 Select Case $Button = "left" $Button = $MK_LBUTTON $ButtonDown = $WM_LBUTTONDOWN $ButtonUp = $WM_LBUTTONUP Case $Button = "right" $Button = $MK_RBUTTON $ButtonDown = $WM_RBUTTONDOWN $ButtonUp = $WM_RBUTTONUP EndSelect If $X = "" OR $Y = "" Then $MouseCoord = MouseGetPos() $X = $MouseCoord[0] $Y = $MouseCoord[1] EndIf For $i = 1 to $Clicks DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $WM_MOUSEMOVE, _ "int", 0, _ "long", _MakeLong($X, $Y)) DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $ButtonDown, _ "int", $Button, _ "long", _MakeLong($X, $Y)) DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $ButtonUp, _ "int", $Button, _ "long", _MakeLong($X, $Y)) Next EndFunc Func _MakeLong($LoWord,$HiWord) Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF)) EndFunci think there is something wrong$title = GUICtrlRead($Input4, 1) $time = GUICtrlRead($Input2, 1) $bwkey = GUICtrlRead($Input5, 1) $text = GUICtrlRead($Input3, 1) $bw = GUICtrlRead($Input1, 1) $hwnd = WinGetHandle($title, 1)orFunc _run() For $s=1 To $bw Step 1 Sleep(300) ControlSend($hwnd, "", "",$bwkey) Sleep(100) _MouseClickPlus($hwnd, "right", 536, 233, 1) ControlSend($Title, "", "",$s + 1 & "{Enter}" & $text & "{Enter}") Sleep($Time * 1000) Next EndFuncI still try create some programs who get "title" or other informations from inputs, not from .ini :\Ahhh one more thing...I have there short lineControlSend($Title, "", "",$s + 1 & "{Enter}" & $text & "{Enter}")and I want to write "actual value of 'For' loop". I used "$s + 1" but i think this always give me "2" :\Btw if you are bored:http://www.youtube.com/watch?v=rQjd4137JVM&feature=related Thx 4 all Edited October 25, 2009 by NoHAX Link to comment Share on other sites More sharing options...
epicfail Posted October 25, 2009 Share Posted October 25, 2009 GUICtrlRead($Input1) should work Link to comment Share on other sites More sharing options...
martin Posted October 25, 2009 Share Posted October 25, 2009 ... Ahhh one more thing... I have there short line ControlSend($Title, "", "",$s + 1 & "{Enter}" & $text & "{Enter}") and I want to write "actual value of 'For' loop". I used "$s + 1" but i think this always give me "2" :\ I don't think there is anything wrong with that. But your loop variable, $s, starts at 1 and ends if $s >= $bw so $bw must be 1. Step 1 is not wrong but not needed since the default is 1. This is the same problem as the others though because $bw is not beingf set, see below. The advanced parameter for GuiCtrlRead is not used for inputs, but it won't stop GuiCtrlRead from working if it's included. You have put all the GuiCtrlRead lines in the wrong place I think. Shouldn't they all be in the _OK function? Func _OK() $title = GUICtrlRead($Input4) $time = GUICtrlRead($Input2) $bwkey = GUICtrlRead($Input5) $text = GUICtrlRead($Input3) $bw = GUICtrlRead($Input1) $hwnd = WinGetHandle($title) GUISetState(@SW_HIDE, $Form2) Sleep(100) GUISetState(@SW_SHOW, $Form1) EndFunc ;==>_OK 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...
NoHAX Posted October 25, 2009 Author Share Posted October 25, 2009 work :-) 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