Emmhor1 Posted May 24, 2014 Posted May 24, 2014 Hello. Here is my script expandcollapse popup;________________________________________________ #include <WinAPIEx.au3> If WinExists(@ScriptName) Then Exit AutoItWinSetTitle(@ScriptName) ;________________________________________________ ;________________________________________________ ;________________________________________________ Global $Paused, $counter = 0 HotKeySet("{F3}", "TogglePause") HotKeySet("{F2}", "Terminate") Shoot() ;________________________________________________ ;________________________________________________ ;________________________________________________ Func Shoot() While 1 Local $coord = PixelSearch(948,540,978,570,12330018,40) If Not @error Then MouseClick("Left") EndIf WEnd EndFunc ;________________________________________________ ;________________________________________________ ;________________________________________________ While 1 $counter +=1 WEnd ;________________________________________________ ;________________________________________________ ;________________________________________________ Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ;ToolTip('Script is "Paused"',0,0, $counter, 1) WEnd ToolTip("") EndFunc ;________________________________________________ ;________________________________________________ ;________________________________________________ Func Terminate() Exit 0 EndFunc ;________________________________________________ ;________________________________________________ ;________________________________________________ I Installed theWinAPIEx Libary But when I execute this script I get a Error Message Cannot Redeclare constant. >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\manuelhorvat\Desktop\HACK!.au3" "C:\Program Files (x86)\AutoIt3\Include\WinAPIEx.au3" (969) : ==> Can not redeclare a constant.: Global Const $tagBITMAPINFOHEADER = 'dword biSize;long biWidth;long biHeight;ushort biPlanes;ushort biBitCount;dword biCompression;dword biSizeImage;long biXPelsPerMeter;long biYPelsPerMeter;dword biClrUsed;dword biClrImportant;' Global Const ^ ERROR But when I remove the #include I dont get the Error... __________________________________________________________________________________________________________________________________________________________________ Another thing that could help aswell. The same script! expandcollapse popup;________________________________________________ If WinExists(@ScriptName) Then Exit AutoItWinSetTitle(@ScriptName) ;________________________________________________ ;________________________________________________ ;________________________________________________ Global $Paused, $counter = 0 HotKeySet("{F3}", "TogglePause") HotKeySet("{F2}", "Terminate") Shoot() ;________________________________________________ ;________________________________________________ ;________________________________________________ Func Shoot() While 1 Local $coord = PixelSearch(948,540,978,570,12330018,40) If Not @error Then MouseClick("Left") EndIf WEnd EndFunc ;________________________________________________ ;________________________________________________ ;________________________________________________ While 1 $counter +=1 WEnd ;________________________________________________ ;________________________________________________ ;________________________________________________ Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ;ToolTip('Script is "Paused"',0,0, $counter, 1) WEnd ToolTip("") EndFunc ;________________________________________________ ;________________________________________________ ;________________________________________________ Func Terminate() Exit 0 EndFunc ;________________________________________________ ;________________________________________________ ;________________________________________________ Whenever my XHair turns Red(The color I assigned it shoots) what code in my script do I need so It shoots when Im pressing RMB? This is the script i have in my mind. #include <WinAPIEx.au3> If WinExists(@ScriptName) Then Exit AutoItWinSetTitle(@ScriptName) Global $Paused, $counter = 0 HotKeySet("{F3}", "TogglePause") HotKeySet("{F2}", "Terminate") Shoot() Func Shoot() While 1 If _WinAPI_GetAsyncKeyState(0x02) = True Then Local $coord = PixelSearch(629, 512, 649, 490,12191508,20) If Not @error Then MouseClick("Left") Sleep(150) EndIf EndIf WEnd EndFunc While 1 $counter +=1 WEnd Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ;ToolTip('Script is "Paused"',0,0, $counter, 1) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc But I get the same cannot redeclare constant ERROR
Moderators Melba23 Posted May 24, 2014 Moderators Posted May 24, 2014 (edited) Emmhor1,Welcome to the AutoIt forums. Whenever my XHair turns Red(The color I assigned it shoots) what code in my script do I need so It shoots when Im pressing RMB?Unfortunately you appear to have missed the Forum rules on your way in. Please read them now (there is also a link at bottom right of each page) - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. See you soon with a legitimate question I hope. M23Edit: And I have deleted the Emmhor account - as you can see from those rules, multiple accounts are not permitted here. Edited May 25, 2014 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Recommended Posts