Jump to content

Small error please help... error at bottom


Mazdryk
 Share

Recommended Posts

#include <Misc.au3>

HotKeySet("{F9}", "_exit")

Hotkeyset ("{1}", "_fight" )

AutoItSetOption( "PixelCoordMode", 1)

$wgh = WinGetHandle("filegrabber")

$color1 = "ox400000"

While 1

Sleep (1000) ;Keeps script running

WEnd

Func _Fight()

$Black3 = PixelSearch(883, 920, 883, 920, $color1,100, 1, $wgh)

$Black4 = PixelSearch(883, 924, 883, 924, $color1,100, 1, $wgh)

If (IsArray($Black3) = 0 or IsArray($Black4) = 0) Then

Send ("{F4 DOWN}")

Sleep (100)

Send ("{F4 UP}")

Else

$Black = PixelSearch(828, 920, 828, 920, $color1,100, 1, $wgh)

$Black2 = PixelSearch(828, 924, 828, 924, $color1,100, 1, $wgh)

If (IsArray($Black) = 0 or IsArray($Black2) = 0) Then

Send ("{F3 DOWN}")

Sleep (100)

Send ("{F3 UP}")

else

Send ("{2 DOWN}")

Sleep (100)

Send ("{2 UP}")

endif

EndFunc

Func _exit()

Sleep(3000)

Exit 0

EndFunc

GIVES me ERROR

Line 39

EndFunc

Error: "if" statement has no matching "Endif" statement.

Link to comment
Share on other sites

here it is

#include <Misc.au3>
HotKeySet("{F9}", "_exit")
Hotkeyset ("{1}", "_fight" )
AutoItSetOption( "PixelCoordMode", 1)

$wgh = WinGetHandle("filegrabber")
$color1 = "ox400000"

While 1
Sleep (1000) ;Keeps script running
WEnd


Func _Fight()
$Black3 = PixelSearch(883, 920, 883, 920, $color1,100, 1, $wgh)
$Black4 = PixelSearch(883, 924, 883, 924, $color1,100, 1, $wgh)
If (IsArray($Black3) = 0 or IsArray($Black4) = 0) Then
    Send ("{F4 DOWN}")
    Sleep (100)
    Send ("{F4 UP}")
Else
    $Black = PixelSearch(828, 920, 828, 920, $color1,100, 1, $wgh)
    $Black2 = PixelSearch(828, 924, 828, 924, $color1,100, 1, $wgh)
    If (IsArray($Black) = 0 or IsArray($Black2) = 0) Then
        Send ("{F3 DOWN}")
        Sleep (100)
        Send ("{F3 UP}")
    else
        Send ("{2 DOWN}")
        Sleep (100)
        Send ("{2 UP}")
    endif
EndIf
EndFunc


Func _exit()
Sleep(3000)
Exit 0
EndFunc
Link to comment
Share on other sites

@ahmed9100 - We have policies here about Game Automation, so at the very least, when you see a function called 'Fight' and it's pixel related, you should ask questions, and await an appropriate response before giving help.

@Mazdryk - You obviously know enough of the rules here, to use the window name of FileGrabber, but seemingly neglected to rename your function so it didn't look like game related. Of course, this could all just be a coincidence with the word Fight, but I doubt it.

I'll leave it up to a MOD to decide if you transgressed. I recall welcoming you in another post, which I should perhaps check.

EDIT

Yep, as I suspected, a >locked topic and warning.

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

  • Moderators

Mazdryk,

This is the last time you get asked to read the Forum rules - next time you get a holiday to force the issue. :naughty:

ahmed9100,

Sensible advice there - please note it for the future. ;)

M23

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