Jump to content
Sign in to follow this  
Hacker000

Func error plz help

Recommended Posts

I am getting a error when i run the program it says :

Line 48 (Folders/and/stuff/program.au3):

Func first()

Error:"Func statement has no matching "EndFunc". 

Here's the code:-

#include <ImageSearch.au3>
#include <MsgBoxConstants.au3>
;----------------------------------------------------------------
Global $gX = 0
Global $gY = 0
Global $aX = 0
Global $aY = 0
Global $Runner
Global $sChans
Global $sFrom
Global $pics = @ScriptDir & "\Pics"
;----------------------------------------------------------------
$img = "Confirm"
$buttonsDir = $pics & "\Buttons"
$imgExt = ".bmp"
$result = _ImageSearch($buttonsDir& "\" & $img & $imgExt,1,$gX,$gY,25)
;----------------------------------------------------------------
HotKeySet("q", "SP")
HotKeySet("{PAUSE}", "TogglePause")
;----------------------------------------------------------------
Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
 EndFunc   ;==>TogglePause
;----------------------------------------------------------------
Func Rounds()
   ToolTip("first,second,third,fourth,fifth")
   $sFrom = InputBox("Question", "Where do you want to start form", "first", "", _
   - 1, -1, 562, 341)
   $sChans = InputBox("Question", "How many relms do you want to do", "10", "", _
   - 1, -1, 562, 341)
    $Runner = $sChans
   For $x = 1 To $Runner Step 1
      $sFrom
   Next
EndFunc
;----------------------------------------------------------------
Func Time()
   ToolTip("Waiting for round to end", 0, 0)
   $result = _ImageSearch($buttonsDir& "\" & $img & $imgExt,1,$gX,$gY,25)
EndFunc
;----------------------------------------------------------------
Func Start()
   Func first()
      MouseClick("Left",438,566);1st
      Sleep(1000)
      MouseClick("Left",680,465);Chalenge
      sleep(4000)
      MouseClick("Left",1236,559);Fight
      Sleep(8000)
      MouseMove(664,489)
      Do
         Time()
      Until $result = 1
      If $result = 1 Then
         ToolTip("Round ended")
         MouseClick("Left",664,489);confirm
         Sleep(5000)
      Else
         ToolTip("Waiting")
      EndIf
   EndFunc
;------------------------------------------------------------
   Func second()
      MouseClick("Left",558,570);2nd
      Sleep(1000)
      MouseClick("Left",680,465);Chalenge
      sleep(4000)
      MouseClick("Left",1236,559);Fight
      Sleep(8000)
      MouseMove(664,489)
      Do
         Time()
      Until $result = 1
      If $result = 1 Then
         ToolTip("Round ended")
         MouseClick("Left",664,489);confirm
         Sleep(5000)
      Else
         ToolTip("Waiting")
      EndIf
   EndFunc
;------------------------------------------------------------
   Func third()
      MouseClick("Left",681,568);3rd
      Sleep(1000)
      MouseClick("Left",680,465);Chalenge
      sleep(4000)
      MouseClick("Left",1236,559);Fight
      Sleep(8000)
      MouseMove(664,489)
      Do
         Time()
      Until $result = 1
      If $result = 1 Then
         ToolTip("Round ended")
         MouseClick("Left",664,489);confirm
         Sleep(5000)
      Else
         ToolTip("Waiting")
      EndIf
   EndFunc
;------------------------------------------------------------
   Func fourth()
      MouseClick("Left",802,574);4th
      Sleep(1000)
      MouseClick("Left",680,465);Chalenge
      sleep(4000)
      MouseClick("Left",1236,559);Fight
      Sleep(8000)
      MouseMove(664,489)
      Do
         Time()
      Until $result = 1
      If $result = 1 Then
         ToolTip("Round ended")
         MouseClick("Left",664,489);confirm
         Sleep(5000)
      Else
         ToolTip("Waiting")
      EndIf
   EndFunc
;------------------------------------------------------------
   Func fifth()
      MouseClick("Left",923,572);5th
      Sleep(1000)
      MouseClick("Left",680,465);Chalenge
      sleep(4000)
      MouseClick("Left",1236,559);Fight
      Sleep(8000)
      MouseMove(664,489)
      Do
         Time()
      Until $result = 1
      If $result = 1 Then
         ToolTip("Round ended")
         MouseClick("Left",664,489);confirm
         Sleep(5000)
      Else
         ToolTip("Waiting")
      EndIf
   EndFunc
EndFunc
;-------------------------------------------------------------------
While 1
    ToolTip("Press 'q' to begin",0,0)
    Sleep(100)
WEnd
Edited by Hacker000

Share this post


Link to post
Share on other sites

For which func?

EDIT:

Never mind, you are declaring functions inside another function, it's not allowed in Autoit3.

Edited by JohnOne

Share this post


Link to post
Share on other sites

Hacker000,

Welcome to the AutoIt forum. :)

Looking at the text in that script, you appear to have missed the Forum rules on your way in. Please read them - particularly the bit about not discussing game automation - before you post again. ;)

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

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...