Hi.
Ist es möglich bei einem Controlclick die Taste zu halten?
In meinem fall die rechte maustaste.
Danke.
Ist es möglich bei einem Controlclick die Taste zu halten?
In meinem fall die rechte maustaste.
Danke.
Genau, denn das Bild im Spiel besitzt auch Pixel, wenn es minimiert ist :facepalm:Quote:
Ehm gibt es so etwas wie ControlImagesearch oder so was? also dass das z.b. Spiel minimiert werden kann aber dass der Bot immer noch in diesem Fenster ImageSearchen kann?..
Wenn ja pls kanns mir jmnd erklären...
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
HotKeySet("{F1}", "LMSpamON")
HotKeySet("{F2}", "LMSpamOFF")
HotKeySet("{F3}", "RMHoldON")
HotKeySet("{F4}", "RMHoldOFF")
local $TastenSpam = false
local $LMSpam = false
local $RMHold = false
local $AHold = false
local $DHold = false
local $WHold = false
local $SHold = false
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Teewars Window Manager", 420, 374, 243, 196)
$Label1 = GUICtrlCreateLabel("FensterName:", 16, 16, 70, 17)
$Input1 = GUICtrlCreateInput("", 96, 14, 121, 21)
$Label2 = GUICtrlCreateLabel("TastenSpam:", 16, 48, 67, 17)
$Input2 = GUICtrlCreateInput("", 96, 46, 65, 21)
$Button = GUICtrlCreateButton("Ändern", 230, 12, 75, 25)
$Button1 = GUICtrlCreateButton("Start", 184, 45, 75, 25)
$Button2 = GUICtrlCreateButton("Stop", 272, 45, 75, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label3 = GUICtrlCreateLabel("OFF", 368, 50, 24, 17)
GUICtrlSetBkColor(-1, 0xFF0000)
$Label4 = GUICtrlCreateLabel("Linke Maus Spammen:", 16, 96, 112, 17)
$Button3 = GUICtrlCreateButton("Start", 128, 90, 75, 25)
$Button4 = GUICtrlCreateButton("Stop", 216, 90, 75, 25)
$Label5 = GUICtrlCreateLabel("Rechte Maus Halten:", 16, 136, 105, 17)
$Button5 = GUICtrlCreateButton("Start", 128, 132, 75, 25)
$Button6 = GUICtrlCreateButton("Stop", 216, 132, 75, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label6 = GUICtrlCreateLabel("OFF", 368, 94, 24, 17)
GUICtrlSetBkColor(-1, 0xFF0000)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label7 = GUICtrlCreateLabel("OFF", 368, 136, 24, 17)
GUICtrlSetBkColor(-1, 0xFF0000)
$Label8 = GUICtrlCreateLabel("A Halten:", 16, 184, 48, 17)
$Label9 = GUICtrlCreateLabel("D Halten:", 16, 216, 49, 17)
$Label10 = GUICtrlCreateLabel("W Halten:", 16, 248, 52, 17)
$Label11 = GUICtrlCreateLabel("S Halten:", 16, 280, 48, 17)
$Button7 = GUICtrlCreateButton("Start", 128, 180, 75, 25)
$Button8 = GUICtrlCreateButton("Start", 128, 212, 75, 25)
$Button9 = GUICtrlCreateButton("Start", 128, 244, 75, 25)
$Button10 = GUICtrlCreateButton("Start", 128, 276, 75, 25)
$Button11 = GUICtrlCreateButton("Stop", 215, 180, 75, 25)
$Button12 = GUICtrlCreateButton("Stop", 215, 212, 75, 25)
$Button13 = GUICtrlCreateButton("Stop", 215, 244, 75, 25)
$Button14 = GUICtrlCreateButton("Stop", 215, 276, 75, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button15 = GUICtrlCreateButton("About", 328, 336, 75, 25)
$Label12 = GUICtrlCreateLabel("By FreehuntX", 16, 344, 68, 17)
$Label13 = GUICtrlCreateLabel("OFF", 368, 184, 24, 17)
GUICtrlSetBkColor(-1, 0xFF0000)
$Label14 = GUICtrlCreateLabel("OFF", 368, 214, 24, 17)
GUICtrlSetBkColor(-1, 0xFF0000)
$Label15 = GUICtrlCreateLabel("OFF", 368, 246, 24, 17)
GUICtrlSetBkColor(-1, 0xFF0000)
$Label16 = GUICtrlCreateLabel("OFF", 368, 280, 24, 17)
GUICtrlSetBkColor(-1, 0xFF0000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button
_Fenstername()
Case $Button1
GUICtrlSetData($Label3, 'ON')
GUICtrlSetBkColor ( $Label3, 0x01DF01 )
$TastenSpam = true
Case $Button2
GUICtrlSetData($Label3, 'OFF')
GUICtrlSetBkColor( $Label3, 0xFF0000)
$TastenSpam = false
Case $Button3
GUICtrlSetData($Label6, 'ON')
GUICtrlSetBkColor ( $Label6, 0x01DF01 )
local $LMSpam = true
Case $Button4
GUICtrlSetData($Label6, 'OFF')
GUICtrlSetBkColor( $Label6, 0xFF0000)
local $LMSpam = false
Case $Button5
GUICtrlSetData($Label7, 'ON')
GUICtrlSetBkColor ( $Label7, 0x01DF01 )
local $RMHold = true
Case $Button6
GUICtrlSetData($Label7, 'OFF')
GUICtrlSetBkColor( $Label7, 0xFF0000)
local $RMHold = false
Case $Button7
GUICtrlSetData($Label13, 'ON')
GUICtrlSetBkColor ( $Label13, 0x01DF01 )
local $AHold = true
Case $Button11
GUICtrlSetData($Label13, 'OFF')
GUICtrlSetBkColor( $Label13, 0xFF0000)
local $AHold = false
Case $Button8
GUICtrlSetData($Label14, 'ON')
GUICtrlSetBkColor ( $Label14, 0x01DF01 )
local $DHold = true
Case $Button12
GUICtrlSetData($Label14, 'OFF')
GUICtrlSetBkColor( $Label14, 0xFF0000)
local $DHold = false
Case $Button9
GUICtrlSetData($Label15, 'ON')
GUICtrlSetBkColor ( $Label15, 0x01DF01 )
local $WHold = true
Case $Button13
GUICtrlSetData($Label15, 'OFF')
GUICtrlSetBkColor( $Label15, 0xFF0000)
local $WHold = false
Case $Button10
GUICtrlSetData($Label16, 'ON')
GUICtrlSetBkColor ( $Label16, 0x01DF01 )
local $SHold = true
Case $Button14
GUICtrlSetData($Label16, 'OFF')
GUICtrlSetBkColor( $Label16, 0xFF0000)
local $SHold = false
EndSwitch
If $TastenSpam = true then ControlSend(Guictrlread($Input1), "", "", Guictrlread($Input2))
If $LMSpam = true then ControlClick(Guictrlread($Input1), "", "","left")
If $RMHold = true then ControlClick(Guictrlread($Input1), "", "","right")
If $AHold = true then ControlSend(Guictrlread($Input1), "", "", "{a down}")
If $DHold = true then ControlSend(Guictrlread($Input1), "", "", "{d down}")
If $WHold = true then ControlSend(Guictrlread($Input1), "", "", "{w down}")
If $SHold = true then ControlSend(Guictrlread($Input1), "", "", "{s down}")
WEnd
Func _Fenstername()
WinSetTitle("Teeworlds","",Guictrlread($Input1))
GUICtrlSetState($Input1, $GUI_DISABLE)
EndFunc
Func LMSpamON()
$LMSpam = true
EndFunc
Func LMSpamOFF()
$LMSpam = false
EndFunc
Func RMHoldON()
$RMHold = true
EndFunc
Func RMHoldOFF()
$RMHold = false
EndFunc
Func MakeLong($LoWord, $HiWord)
Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))
EndFunc
; send mouse events to non active window
; button = left, right, none
; event = down, up, click, dclick, move
Func MouseSend($hwnd, $btn, $evt, $xpos, $ypos)
$user32 = DllOpen("user32.dll")
if $user32 = -1 Then
ConsoleWrite("MouseSend: cannot open user32.dll")
Exit
EndIf
;define missing constans
$MK_LBUTTON = 0x0001
$WM_LBUTTONDOWN = 0x0201
;$WM_LBUTTONUP = 0x0202 -> defined in WindowsConstants.au3
$WM_LBUTTONDBLCLK = 0x0203
$MK_RBUTTON = 0x0002
$WM_RBUTTONDOWN = 0x0204
$WM_RBUTTONUP = 0x0205
$WM_RBUTTONDBLCLK = 0x0206
;$WM_MOUSEMOVE = 0x0200 -> defined in WindowsConstants.au3
;map button to event
If $btn = "left" Then
$button = $MK_LBUTTON
$btdown = $WM_LBUTTONDOWN
$btup = $WM_LBUTTONUP
$btdbl = $WM_LBUTTONDBLCLK
ElseIf $btn = "right" Then
$button = $MK_RBUTTON
$btdown = $WM_RBUTTONDOWN
$btup = $WM_RBUTTONUP
$btdbl = $WM_RBUTTONDBLCLK
ElseIf $btn = "none" Then
If Not ($evt = "move") Then
ConsoleWrite(StringFormat("MouseSend: bad call: %s , %s",$btn, $evt))
Exit
EndIf
Else ;error
ConsoleWrite(StringFormat("MouseSend: bad button: %s",$btn))
Exit
EndIf
;send messages
$pos = MakeLong($xpos, $ypos)
Select
Case $evt = "move"
DllCall($user32, "int", "PostMessage", "hwnd", $hwnd, "int", $WM_MOUSEMOVE, "int", 0, "long", $pos)
Case $evt = "down"
DllCall($user32, "int", "PostMessage", "hwnd", $hwnd, "int", $btdown, "int", $button, "long", $pos)
Case $evt = "up"
DllCall($user32, "int", "PostMessage", "hwnd", $hwnd, "int", $btup, "int", 0, "long", $pos)
Case $evt = "click"
DllCall($user32, "int", "PostMessage", "hwnd", $hwnd, "int", $WM_MOUSEMOVE, "int", 0, "long", $pos)
DllCall($user32, "int", "PostMessage", "hwnd", $hwnd, "int", $btdown, "int", $button, "long", $pos)
DllCall($user32, "int", "PostMessage", "hwnd", $hwnd, "int", $btup, "int", 0, "long", $pos)
Case $evt = "dclick"
DllCall($user32, "int", "PostMessage", "hwnd", $hwnd, "int", $WM_MOUSEMOVE, "int", 0, "long", $pos)
DllCall($user32, "int", "PostMessage", "hwnd", $hwnd, "int", $btdown, "int", $button, "long", $pos)
DllCall($user32, "int", "PostMessage", "hwnd", $hwnd, "int", $btup, "int", 0, "long", $pos)
Sleep(10)
DllCall($user32, "int", "PostMessage", "hwnd", $hwnd, "int", $btdbl, "int", $button, "long", $pos)
DllCall($user32, "int", "PostMessage", "hwnd", $hwnd, "int", $btup, "int", 0, "long", $pos)
EndSelect
DllClose($user32)
EndFunc
DllCall('user32.dll', 'int', 'PostMessage', 'hwnd', $hwnd, 'int', 0x204, 'int', 2, 'long', 1)