Sign in to follow this  
Followers 0
Jeanpierre92

Func error

4 posts in this topic

I have made a scipt with Func() on it. First I had only one: func inloggen() With a ending EndFunc

Now I have made a second Func() but it gives a error on that :blink:

This is the script:

$wit = 0
$aantala = 0
$aantalp = 0
$accountnaam = InputBox("Account naam", "Typ je account naam")
$wachtwoord = InputBox("Account Wachtwoord", "Typ je account wachtwoord", "", "*")
$gestart = 0
$farm = 7
$remake = 0
$nummer = 1
$foutinlog = 0

Run("C:\Program Files\Warcraft III\Frozen Throne.exe -windowed", "C:\Program Files\Warcraft III")
Sleep(2000)
WinSetState("Warcraft III", "", @SW_MAXIMIZE)
Sleep(1000)
Run("C:\Users\Jeanpierre\Desktop\Hacks & Cracks\Warcraft 3\Pro RefreshBot\VisualCustomKick.exe", "C:\Users\Jeanpierre\Desktop\Hacks & Cracks\Warcraft 3\Pro RefreshBot")
WinWaitActive("VCK v4.0.2")
ControlClick("VCK v4.0.2", "", "[ID:8]")
WinWaitActive("Tools")
ControlClick("Tools", "", "[ID:3]")
WinWaitActive("Visual Healthbar Shower")
ControlClick("Visual Healthbar Shower", "", "[ID:1000]")
WinClose("Visual Healthbar Shower")
WinClose("Tools")
ControlClick("VCK v4.0.2", "", "[ID:4]")
Sleep(1000)
Send("{b}")
Inloggen()

Func Inloggen()
    Do
        Sleep(250)
        $wit = PixelGetColor(90, 227)
    Until $wit = 0xFFFFFF
    MouseClick("", 563, 282)

    Do
        Send("{BS}")
        Sleep(50)
        $aantala = $aantala + 1
    Until $aantala = 15
    Send($accountnaam)
    MouseClick("", 590, 409)

    Do
        Send("{BS}")
        Sleep(50)
        $aantalp = $aantalp + 1
    Until $aantalp = 15
    Send($wachtwoord)
    Send("{ENTER}")
    Sleep(1000)
    $foutinlog = PixelGetColor(742, 520)
    If $foutinlog = 0xFFFFFF Then
        MsgBox(4, "Error", "Je inlog gegevens zijn niet goed, opnieuw inloggen?")
        If 6 Then
            $accountnaam = InputBox("Account naam", "Typ je account naam")
            $wachtwoord = InputBox("Account Wachtwoord", "Typ je account wachtwoord", "", "*")
            Sleep(500)
            Send("{ENTER}")
            Inloggen()
        Else 
            Exit
        EndIf
    EndIf
    Herstarten()

    Func Herstarten() 
        Do
            Sleep(250)
            $wit = PixelGetColor(559, 353)
        Until $wit = 0xFFFFFF
        Send("{g}")
    
        Do
            Sleep(250)
            $wit = PixelGetColor(686, 1075)
        Until $wit = 0xFFFFFF
        Sleep(500)
        Send("{ALT down}")
        Send("{c}")
        Send("{ALT up}")
    
        Do
            Sleep(250)
            $wit = PixelGetColor(137, 117)
        Until $wit = 0xFFFFFF
        Sleep(500)
        Send("Legion TD 1.60 -apns -" & $nummer & "-")
        Sleep(100)
        Send("{ENTER}")
    
        Do
            Sleep(1000)
            $gestart = PixelGetColor(66, 48)
        Until $gestart = 0xFFFFFF
    
        Do ;Loop van het spel tot het einde
            Sleep(250)
            $levelend = PixelSearch(127, 692, 127, 692, 0x33BB33, 2)
            $endgame = PixelGetColor(132, 461)
            If $levelend <> 1 Then
                If $farm = 7 Then
                    Send("{1}")
                    sleep(500)
                    Send("{v 2}")
                    Send("{c 2}")
                    Send("{x 2}")
                    Send("{d 2}")
                    Send("{a 2}")
                    Send("{e 2}")
                    Send("{w 2}")
                    Send("{q 2}")
                    Sleep(2000)
                    $farm = MsgBox(4, "Farm?", "Wil je het volgende level een farm bouwen?")
                Else
                    Sleep(2000)
                    $farm = MsgBox(4, "Farm?", "Wil je het volgende level een farm bouwen?")
                EndIf
            Else ;ENDGAME
                If $endgame = 0xFF0000 Then
                    Sleep(1000)
                    $remake = MsgBox(3, "Remake?", "Ja is remake, Nee is score bekijken+remake en Annuleren is script stoppen")
                    If $remake = 2 Then
                        Exit
                    EndIf
                
                    If $remake = 6 Then
                        Sleep(3000)
                        Send("{F10}")
                        Sleep(500)
                        Send("{e}")
                        Sleep(500)
                        Send("{q}")
                        Sleep(2000)
                        Send("{ENTER}")
                        $nummer = $nummer + 1
                        Remake()
                    EndIf
                
                    If $remake = 7 Then
                        Do
                            Sleep(250)
                            $hoofdmenu = PixelGetColor(444, 348)
                        Until $hoofdmenu = 0xFFFFFF
                        $nummer = $nummer + 1
                        Remake()
                    EndIf
                EndIf
            EndIf
        Until $endgame = 0xFF0000
    EndFunc
EndFunc

This is the error:

>C:\Program Files (x86)\AutoIt3\SciTE\..\au3check.exe "C:\Program Files (x86)\AutoIt3\Mijn scripts\LegionTD autohost.au3"

AutoIt3 Syntax Checker v1.54.8 Copyright © Tylo 2007

C:\Program Files (x86)\AutoIt3\Mijn scripts\LegionTD autohost.au3(68,2) : ERROR: syntax error

Func

^

C:\Program Files (x86)\AutoIt3\Mijn scripts\LegionTD autohost.au3(66,13) : ERROR: Herstarten(): undefined function.

Herstarten()

~~~~~~~~~~~^

C:\Program Files (x86)\AutoIt3\Mijn scripts\LegionTD autohost.au3 - 2 error(s), 0 warning(s)

>Exit code: 2 Time: 0.219

The func: Herstarten gives a error.

Maby someone can help me?

Thanks in advance,

Jeanpierre

Share this post


Link to post
Share on other sites



Jeanpierre92,

C:\Users\Jeanpierre\Desktop\Hacks & Cracks\Warcraft 3\Pro RefreshBot

Have you read this? Are you sure that you are not in breach of its terms?

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

#3 ·  Posted (edited)

Yes I know what i did wrong and it is very stupid ;)

you cant use a func() in a func() :blink:

But now I solved it, thanks for the replay :P

ooh wait you mean something else. That just a map where I put programms that I use for games.

But I put everything in that map, even help programmes like autohost etc.

And yes there are some cheats for old games that I dont play anymore, but I dont like cheat etc so now I put also all the helprogrammes in it.

This script enables autohost and autorefresh and it start the game.

So I dont make any cheats or so.

Edited by Jeanpierre92

Share this post


Link to post
Share on other sites

Gamebot, don't expect any help here.

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  
Followers 0