Sign in to follow this  
Followers 0
McDope

plz help, script wont run

5 posts in this topic

Hi,

i try to convert a VBScript into AutoIt. I see no error but if i try to compile i get "test.au3 (53) : ==> Unknown function name.: "

plz help, where is my error?

Script (sry some spaghetti like :lmao: ):

#include <GUIConstants.au3>
;Generated with Form Designer preview
$Form3 = GUICreate("JW-Mapper - EXTENDER", 327, 278, 191, 125)
$Group1 = GUICtrlCreateGroup("Einstellungen", 8, 0, 313, 241, $BS_FLAT)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Group2 = GUICtrlCreateGroup("Anzahl der Tabs", 24, 24, 145, 49, $BS_FLAT)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$TabsToProcess = GUICtrlCreateInput("200", 32, 40, 121, 21, -1, $WS_EX_CLIENTEDGE)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("Erste Datei ", 24, 88, 145, 49, $BS_FLAT)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$NameToStart = GUICtrlCreateInput("", 32, 104, 121, 21, -1, $WS_EX_CLIENTEDGE)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Edit1 = GUICtrlCreateEdit("", 24, 144, 281, 89, $ES_READONLY, $WS_EX_CLIENTEDGE)
GUICtrlSetData($Edit1, "Bedienungs-Hinweise:"&@CRLF&""&@CRLF&""&Chr(34)&"Anzahl der Tabs"&Chr(34)&": Muss angegeben werden."&@CRLF&""&@CRLF&""&Chr(34)&"Erste Datei"&Chr(34)&": Nur angeben wenn schon Dateien "&@CRLF&"vorhanden sind und nicht mit 0001.htm begonnen wird.")
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Group4 = GUICtrlCreateGroup("Done by McDope", 176, 24, 129, 113)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$Pic2 = GUICtrlCreatePic("D:\Graphics\avatar-1236.gif", 200, 40, 84, 84, $SS_SUNKEN)
GUICtrlSetTip(-1, "Yet another Tool by McDope")
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$btn_ok = GUICtrlCreateButton("&OK && Go!", 8, 248, 99, 25, $BS_FLAT)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$btn_cancel = GUICtrlCreateButton("&Abbrechen", 112, 248, 99, 25, $BS_FLAT)
GUICtrlSetFont(-1, 8, 400, 0, "Tahoma")
$btn_about = GUICtrlCreateButton("About", 216, 248, 99, 25)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $btn_ok
        $tabs = GUICtrlRead($TabsToProcess)
        $name = GUICtrlRead($NameToStart)
        $sStoragePath = "c:\jw_s1\"
        $Title = "<| JWMapper - EXTENDER | v0.72 (AutoIt)|> (c) 2006 by McDope (THW)"

        If $name = "" Then
            Sleep 10000
            For $x = 1 to $tabs Step +1
                If $x < 10 Then
                    $sSavename = "000" & $x & ".htm"
                    SaveCloseTab($sSavename)
                EndIf
                If $x == 10 Then
                    $sSavename = "0010.htm"
                    SaveCloseTab($sSavename)
                EndIf   
                If $x < 100 And x > 10 Then
                    $sSavename = "00" & $x & ".htm"
                    SaveCloseTab($sSavename)
                EndIf
                If $x == 100 Then
                    $sSavename = "0100.htm"
                    SaveCloseTab($sSavename)
                EndIf
                If $x > 100 And x < 1000 Then
                    $sSavename = "0" & $x & ".htm"
                    SaveCloseTab($sSavename)
                EndIf
                If $x == 1000 Then
                    $sSavename = "1000.htm"
                    SaveCloseTab($sSavename)
                EndIf
                If $x > 1000 Then
                    $sSavename = $x & ".htm"
                    SaveCloseTab($sSavename)
                EndIf
            Next
            MsgBox(0,"", "Fertig!")
        EndIf

        If $name <> "" Then
            Sleep 10000
            $iTemp = Int($name) + Int($tabs)
            For $x = $name to $iTemp Step +1
                If $x < 10 Then
                    $sSavename = "000" & $x & ".htm"
                    SaveCloseTab($sSavename)
                EndIf
                If $x == 10 Then
                    $sSavename = "0010.htm"
                    SaveCloseTab($sSavename)
                EndIf   
                If $x < 100 And x > 10 Then
                    $sSavename = "00" & $x & ".htm"
                    SaveCloseTab($sSavename)
                EndIf
                If $x == 100 Then
                    $sSavename = "0100.htm"
                    SaveCloseTab($sSavename)
                EndIf
                If $x > 100 And x < 1000 Then
                    $sSavename = "0" & $x & ".htm"
                    SaveCloseTab($sSavename)
                EndIf
                If $x == 1000 Then
                    $sSavename = "1000.htm"
                    SaveCloseTab($sSavename)
                EndIf
                If $x > 1000 Then
                    $sSavename = $x & ".htm"
                    SaveCloseTab($sSavename)
                EndIf
            Next
            MsgBox(0,"", "Fertig!")
        EndIf
    Case Else
    ;;;;;;;
    EndSelect
WEnd
Exit

Func SaveCloseTab($filename) ;speichert & schliesst ein tab
    Local $sTempname
    $sTempname = $sStoragePath & $filename
    Send ("{F10}")
    Send ("{ENTER}")        
    Send ("{u}")            
    Sleep 1000          
    Send ($sTempname)   
    Send ("{ENTER}")    
    Sleep $iWaitTimeSave
    Send ("^{F4}")      
    Sleep $iWaitTimeClose
EndFunc

Share this post


Link to post
Share on other sites



You have:

If $x > 100 And x < 1000 Then

your missing the '$' in front of And x in a couple of spots.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

ahhh :">

thx i must be totaly blind :lmao:

thank you


Share this post


Link to post
Share on other sites

and

Sleep $iWaitTimeSave
    Send ("^{F4}")      
    Sleep $iWaitTimeClose

Sleep() needs brackets... Sleep(100)

and..

your $iwaittime.. values have not been set

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

already seen... thx...

script is full working now :lmao:


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