Jump to content

Cannot Redeclare Constant.#include


Recommended Posts

Hello.

Here is my script
 

;________________________________________________
#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!

;________________________________________________
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

Link to comment
Share on other sites

  • Moderators

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. :naughty:

See you soon with a legitimate question I hope. :)

M23

Edit: And I have deleted the Emmhor account - as you can see from those rules, multiple accounts are not permitted here. :naughty:

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...