MihailProgramming

Can some one help me convert this file to autoit?

6 posts in this topic

The code is:

@echo off
set m2ver=Alpha 1.0.1
set m2=%~dp0
if not exist %~dp0\lib\nul (
    set b=%cd%
    cd %m2%
    md lib
    cd %b%
)
set lib=%~dp0\lib
set me=%~1
if not exist "%me%" goto end
for /f "eol=/ delims=" %%i in (%me%) do call :executer %%i

:executer
if "%~1"=="" goto end
if "%~1"=="#define" goto define
if "%~1"=="#include" goto include
if "%~1"=="#goto" goto goto
if "%~1"=="#execute" goto execute
if "%~1"=="#call" goto call
if "%~1"=="#if" goto if
if "%~1"=="#ifnot" goto ifnot
if "%~1"=="#while" goto while
if "%~1"=="#ver" goto ver
goto out-commands

:ver
echo Official M2 Installed
echo Version: %m2ver%
goto end

:while
:wst
if %~2 (
    call :executer %~3
    call :executer %~4
    call :executer %~5
    goto wst
)
goto end

:call
if exist "%~2" for /f "eol=/ delims=" %%i in (%~2) do call :executer %%i
goto end

:execute
if exist "%~2" call %~2 %~3
goto end

:ifnot
if not %~2 call :executer %3 %4 %5 %6 %7 %8 %9
goto end

:if
if %~2 call :executer %3 %4 %5 %6 %7 %8 %9
goto end

:restart
for /f "eol=/ delims=" %%i in (%me%) do call :executer %%i
goto end

:goto
set i=%~2
set /a lines=%i%-1
if "%i%"=="0" goto restart
if "%lines%"=="0" goto restart
for /f "skip=%lines% eol=/ delims=" %%i in (%me%) do call :executer %%i
goto end

:define
if "%~2"=="" goto end
if "%~3"=="" goto end
set %~2=%~3
goto end

:include
if not exist %lib%\%~2\nul goto end
path %path%;%lib%\%~2
goto end

:out-commands
if not exist "%lib%\%~1\%~2.bat" goto end
call %~2.bat %3 %4 %5 %6 %7 %8 %9
goto end

:end

Thank you for helping me!

Share this post


Link to post
Share on other sites



Welcome to AutoIt forums Mihail! :welcome:, What are you trying to do with that batch script? Since its beyond my scope to convert it to AutoIt script, you can try these resources to get down the basics of AutoIt, TD :)


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

Super trivial to convert, you need (not in this order)

FileExists, If...EndIf, Local/Global, While, Calling functions, For...Next.

// THERE IS NO GOTO IN AutoIt

 


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Welcome to Autoit and the forum!
As we do not spoon feed users here, can you please show us what you have tried so far?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Please show us a sample Input file, so we can better understand your BAT script.

BTW. Why you want to convert it to AU3 ? Never change a running system. :D


My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post


Link to post
Share on other sites

Hi MihailProgramming, I think what you need to know is that you can write a AU3 script that looks and works much like a bat.  Thats where I started, basic batch, just on steroids...

However, using AutoIts GUI capabilities you can either just put a simple GUI on it, to hide what your script is doing, or you can actually create a full GUI where everything uses all of AutoIT.  

Perhaps start with just basics - make a very simple au3 script that jsut does exactly the same with no GUI components.  Once you get the hang of it, the rest will come easily. :)

Good luck


Skysnake

Why is the snake in the sky?

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