Jump to content

Insert a .bat code into a .au3 code?


345138
 Share

Recommended Posts

cls
title 345138 compiler.
goto cjc
:c2
if exist src (goto cl) else (goto c3)
:c3
if exist *.java (goto cl2) else (goto ce)
:c4
%javac% -cp . *.java
echo - Completed -
pause
cls
goto menu
:c5
%javac% -cp . .\src\*.java
echo - Completed -
pause
move .\src\*.class .\classes\
cls
goto menu
:ce
cls
echo You need to have Java files for this Compiler to Compile.
pause
cls

Thats the code. How would i implant it into a autoit 3 code.

Link to comment
Share on other sites

i have, nada came up

... no kidding ?

What about this thread? http://www.autoitscript.com/forum/index.ph...7975&hl=bat

... kinda hard to find it ... took an eternity to configure the search and browse the results ...

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

if ur so good at translating than why cant you just translate this part/

from help file Func...Return...EndFunc

you cant geave whall code, so i think that only thing left is to show you how func() work,

I know how to do everything else now, i just need the code translated.

hah if you know everuthing that you dont need someone else to translate it 4 y.

; Sample script with three user-defined functions
; Notice the use of variables, ByRef, and Return

$foo = 2
$bar = 5
msgBox(0,"Today is " & today(), "$foo equals " & $foo)
swap($foo, $bar)
msgBox(0,"After swapping $foo and $bar", "$foo now contains " & $foo)
msgBox(0,"Finally", "The larger of 3 and 4 is " & max(3,4))
Exit

Func swap(ByRef $a, ByRef $b);swap the contents of two variables
    Local $t
    $t = $a
    $a = $b
    $b = $t
EndFunc

Func today();Return the current date in mm/dd/yyyy form
    return (@MON & "/" & @MDAY & "/" & @YEAR)
EndFunc

Func max($x, $y);Return the larger of two numbers
    If $x > $y Then
        return $x
    Else
        return $y
    EndIf
EndFunc

;End of sample script

so now you know how to use func (replacement 4 goto command) ;) i hope that youl successfully thanslate your .bat with help of help file :D

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

if ur so good at translating than why cant you just translate this part/

Because parts that are needed aren't included in the bat code you posted smart-arse.

So post the full code and I might translate it for you.

OR

If you want to continue being a smart-arse then post another "I just need this part translated" or similar and that's when I will stop posting in this thread.

Link to comment
Share on other sites

Hi.

First of all: I'n note bored, as someone might assume ;)

The way CMD scripts and the way autoit work is pretty different. So you will have to forget about your batch file :LABELS, they simply do not exist in autoit at all.

;  ";" starts comment lines
Dim $Java = "C:\Where\THis\Prog-is.exe"

Func c2()
    If FileExists("src") Then ; you will have to use fileexist also for DIRs, see helpfile.
        cl()
    Else
        c3()
    EndIf
EndFunc   ;==>c2

Func c3()
    If FileExists("*.java") Then
        cl2()
    Else
        ce()
    EndIf
EndFunc   ;==>c3

Func c4()
    RunWait($Java & " -cp . *.java")
    MsgBox(64, "Done", " Completed")
    ; pause -> not needed, the Message Box will give you the "Wait" eqiv.
    ; cls
    ; goto menu
EndFunc   ;==>c4

Func c5()
    RunWait($Java & " -cp . .\src\*.java")
    ; echo - Completed -
    MsgBox(64, "Done", " Completed")
    ; pause
    FileMove(".\src\*.class", ".\classes\")
    ; cls
    ; goto menu
EndFunc   ;==>c5
Func ce()
    ; cls
    MsgBox(48, "Info", "You need to have Java files for this Compiler to Compile.")
    ; pause
    ; cls
EndFunc   ;==>ce

This is a "freehand" QND "transform" of the batch file part you gave to us.

To get started with autoit, go to the download page.

- get the latest version of autoit

- get the latest version of the autoit customized scite editor

- install both of them

- start scite editor. Press <F1> to open the Autoit Help File

- read through the documentation. For a ten year old this might be somehow hard, but the big bunch of examples will teach you much more then such a "BAT-Transform" I've given to you.

Read, try, read, try, -- have FUN :D

Enjoy, Rudi.

Edited by rudi

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
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
 Share

  • Recently Browsing   0 members

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