Sign in to follow this  
Followers 0
345138

Insert a .bat code into a .au3 code?

21 posts in this topic

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.

Share this post


Link to post
Share on other sites

Have you searched the forums yet?

Do a search for "bat" in "Example Script" forum.


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 :)

Share this post


Link to post
Share on other sites

i have, nada came up

Share this post


Link to post
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 :)

Share this post


Link to post
Share on other sites

I know. but im gonna substitute au3 code for that.

Share this post


Link to post
Share on other sites

I dont want to have it read the .bat file i need the code to be in the .au code.

Share this post


Link to post
Share on other sites

how would i go about designing it?

Share this post


Link to post
Share on other sites

Ok, ive got school though so l8r

Share this post


Link to post
Share on other sites

ill post l8r

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Post the full .bat code and someone might translate it for you if they are bored.

But don't expect anyone to write something for you, they don't have to, you are not paying for our help ;)

Share this post


Link to post
Share on other sites

Im ten, what do you want me to pay with Virtual Dollars?

Share this post


Link to post
Share on other sites

Im ten, what do you want me to pay with Virtual Dollars?

You could start learning how to do it yourself or do what I said in the first place and post the full bat code and someone might translate it for you.

Share this post


Link to post
Share on other sites

i just need this part translated!

Share this post


Link to post
Share on other sites

:D You're not listening to anyone here.

IT WOULD BE A HELL OF A LOT EASIER TO TRANSLATE THAT .BAT CODE TO .AU3 IF WE HAD THE WHOLE .BAT.

Get it now? ;)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

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.

 

Share this post


Link to post
Share on other sites

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

I guess this last remark just shut the door for any helper - you're not only lazy and ignorant, you're rude too. ;)


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 :)

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

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!

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