Mr_Was_geht_sie_das_an Posted March 23, 2017 Posted March 23, 2017 Found this script last day: HotKeySet("(F6)"),"_Exit") While 1 If Is_Pressed(10) Then $Specnaz = PixelSearch(100,100,100,100,0x100) If IsArray($Specnaz) = True Then MouseClick("Left") EndIf WEnd Func _Exit() Exit EndFunc Why do i get an Error if i try to start it ?
Developers Jos Posted March 23, 2017 Developers Posted March 23, 2017 Which error? What are you trying to do? Jos 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.
aa2zz6 Posted March 23, 2017 Posted March 23, 2017 You should probably read up on example forums for _IsPresses and PixelSearch to understand how they work. #include <Misc.au3> #include <MsgBoxConstants.au3> Local $hDLL = DllOpen("user32.dll") While 1 If _IsPressed("10", $hDLL) Then ConsoleWrite("_IsPressed - Shift Key was pressed." & @CRLF) $Specnaz = PixelSearch(1561, 181,1747, 280,0xC9B880,10) If IsArray($Specnaz) = True Then MouseClick("Left",0,0,1,10) EndIf ; Wait until key is released. While _IsPressed("10", $hDLL) Sleep(250) WEnd ConsoleWrite("_IsPressed - Shift Key was released." & @CRLF) ElseIf _IsPressed("1B", $hDLL) Then MsgBox($MB_SYSTEMMODAL, "_IsPressed", "The Esc Key was pressed, therefore we will close the application.") ExitLoop EndIf Sleep(250) WEnd DllClose($hDLL) Good Reads below -- Example - _IsPressed https://www.autoitscript.com/autoit3/docs/libfunctions/_IsPressed.htm Example - PixelSearch https://www.autoitscript.com/autoit3/docs/functions/PixelSearch.htm
Mr_Was_geht_sie_das_an Posted March 23, 2017 Author Posted March 23, 2017 The real Script looks like this: HotKeySet("(F6)"),"_Exit") While 1 $Specnaz = PixelSearch(100,100,100,100,0x100) If IsArray($Specnaz) = True Then MouseClick("Left") EndIf WEnd Func _Exit() Exit EndFunc I want "_IsPressed" in this script. Can someone help me with it ?
Developers Jos Posted March 23, 2017 Developers Posted March 23, 2017 Again, What is the error and what are you trying to do? Jos 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.
Mr_Was_geht_sie_das_an Posted March 23, 2017 Author Posted March 23, 2017 I wanna activate this Script with an Hotkey, but dont undertsand, the example of "_IsPressed".
Developers Jos Posted March 23, 2017 Developers Posted March 23, 2017 It seriously can't be that difficult to answer 2 questions I've now asked 2 times ...right? You claim to get an error.. so What is the error? As to HotKeySet() and IsPressed(), open the helpfile and look at the examples and explanation...then come back in case you have questions. .. and saying it isn't clear or you don't understand doesn't mean much as there is no proper answer for that. Jos 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.
Mr_Was_geht_sie_das_an Posted March 23, 2017 Author Posted March 23, 2017 The "real" Script works fine, but in this script isnt the function "_IsPressed", also how i creat it that it works. ~Cant tell you the error-code, cause im not in my own PC.
Developers Jos Posted March 23, 2017 Developers Posted March 23, 2017 3 minutes ago, Mr_Was_geht_sie_das_an said: Cant tell you the error-code, cause im not in my own PC. No rush here so post back when you have had time to look and do some debugging. Jos 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.
Mr_Was_geht_sie_das_an Posted March 23, 2017 Author Posted March 23, 2017 Ok, last question: Why do i need the ConsoleWrite and... #include <Misc.au3>#include <MsgBoxConstants.au3>Local $hDLL = DllOpen("user32.dll")While 1 If _IsPressed("10", $hDLL) Then ConsoleWrite("_IsPressed - Shift Key was pressed." & @CRLF) $Specnaz = PixelSearch(1561, 181,1747, 280,0xC9B880,10) If IsArray($Specnaz) = True Then MouseClick("Left",0,0,1,10) EndIf ; Wait until key is released. am I need this part, or can i delete it ?: While _IsPressed("10", $hDLL) Sleep(250) WEnd ConsoleWrite("_IsPressed - Shift Key was released." & @CRLF) ElseIf _IsPressed("1B", $hDLL) Then MsgBox($MB_SYSTEMMODAL, "_IsPressed", "The Esc Key was pressed, therefore we will close the application.") ExitLoop EndIf Sleep(250)WEndDllClose($hDLL)
Developers Jos Posted March 23, 2017 Developers Posted March 23, 2017 It sounds very much that you found this script somewhere and have no real idea what it does. I am pretty sure it is used for automation of a game .. also called triggerbot... so Please read our forum rules in relation to thread on game automation In case you want to continue questions here, then please do us and yourself a favor and open the helpfile first before simply asking questions. PM me in case I've have seen things wrongly, but only when you can make it clear I am really wrong. Jos 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.
Recommended Posts