Jump to content
Sign in to follow this  
narayanjr

#include FileInstall()

Recommended Posts

narayanjr

#include "C:\Program Files\ArW-Pikid\NewTbls\expansionstring.tbl"
#include "C:\Program Files\ArW-Pikid\NewTbls\string.tbl" <-- is line 11
#include "C:\Program Files\ArW-Pikid\NewTbls\patchstring.tbl"

If Not FileExists("C:\Program Files\Diablo II\data\" Then
    DirCreate("C:\Program Files\Diablo II\data\local\LNG\ENG\")
    FileInstall("C:\Program Files\ArW-Pikid\NewTbls\expansionstring.tbl", "C:\Program Files\Diablo II\data\local\LNG\ENG\expansionstring.tbl")
    FileInstall("C:\Program Files\ArW-Pikid\NewTbls\string.tbl", "C:\Program Files\Diablo II\data\local\LNG\ENG\string.tbl")
    FileInstall("C:\Program Files\ArW-Pikid\NewTbls\patchstring.tbl", "C:\Program Files\Diablo II\data\local\LNG\ENG\patchstring.tbl")
    FileInstall("C:\Program Files\ArW-Pikid\NewTbls\expansionstring.tbl", "C:\Program Files\ArW-Pikid\NewTbls\expansionstring.tbl")
    FileInstall("C:\Program Files\ArW-Pikid\NewTbls\string.tbl", "C:\Program Files\ArW-Pikid\NewTbls\string.tbl")
    FileInstall("C:\Program Files\ArW-Pikid\NewTbls\patchstring.tbl", "C:\Program Files\ArW-Pikid\NewTbls\patchstring.tbl")
ElseIf FileExists("C:\Program Files\Diablo II\data\" Then
    If FileExists("C:\Program Files\Diablo II\data\local\LNG\ENG\expansionstring.tbl") Then
        If FileExists("C:\Program Files\Diablo II\data\local\LNG\ENG\string.tbl") Then
            If FileExists("C:\Program Files\Diablo II\data\local\LNG\ENG\patchstring.tbl") Then
                FileMove("C:\Program Files\Diablo II\data\local\LNG\ENG\expansionstring.tbl", "C:\Program Files\ArW-Pikid\OldTbls\")
                FileMove("C:\Program Files\Diablo II\data\local\LNG\ENG\string.tbl", "C:\Program Files\ArW-Pikid\OldTbls\")
                FileMove("C:\Program Files\Diablo II\data\local\LNG\ENG\patchstring.tbl", "C:\Program Files\ArW-Pikid\OldTbls\")
                FileInstall("C:\Program Files\ArW-Pikid\NewTbls\expansionstring.tbl", "C:\Program Files\Diablo II\data\local\LNG\ENG\expansionstring.tbl")
                FileInstall("C:\Program Files\ArW-Pikid\NewTbls\string.tbl", "C:\Program Files\Diablo II\data\local\LNG\ENG\string.tbl")
                FileInstall("C:\Program Files\ArW-Pikid\NewTbls\patchstring.tbl", "C:\Program Files\Diablo II\data\local\LNG\ENG\patchstring.tbl")
                FileInstall("C:\Program Files\ArW-Pikid\NewTbls\expansionstring.tbl", "C:\Program Files\ArW-Pikid\NewTbls\expansionstring.tbl")
                FileInstall("C:\Program Files\ArW-Pikid\NewTbls\string.tbl", "C:\Program Files\ArW-Pikid\NewTbls\string.tbl")
                FileInstall("C:\Program Files\ArW-Pikid\NewTbls\patchstring.tbl", "C:\Program Files\ArW-Pikid\NewTbls\patchstring.tbl")
            EndIf
        EndIf
    EndIf
EndIf

i keep getting this error, Posted Image

I need it to check to see if the folder data exists and if it does then move the files in data\local\lng\eng\ to ArW-Pikid\OldTbls\

But if the Folder data does not exist then i want it to make that folder and put the files into data\local\lng\eng\

And no matter what i want it to add the files to ArW-Pikid\NewTbls\

This is my first time using #include and FileInstall so i could have done everything wrong, Thanks for any help

(There is more to the script but it all worked until i started messing with what i included at the top)

Edited by narayanjr

Share this post


Link to post
Share on other sites
Mast3rpyr0

dont include the install files. including basically adds that file to your script before compiling.

so if you had:

test1.au3

Func install()
blah
EndFunc
oÝ÷ Ú׬·f®Ý«­¢+Ø(¥¹±Õ±ÐíÑÍÐĹÔÌÐì)Õ¹¥¹Íѱ°È ¤)± )¹Õ¹oÝ÷ Ú׬·g±{
.ÖÞr©Wjw[y«­¢+Ø)Õ¹¥¹Íѱ° ¤)± )¹Õ()Õ¹¥¹Íѱ°È ¤)± )¹Õ¹(

can you include anythign other than .au3 files?

Edited by Mast3rpyr0

Share this post


Link to post
Share on other sites
narayanjr

no idea but that worked perfectly thank you

Share this post


Link to post
Share on other sites
Generator

#Include Func basically includes all the code that you have in your included .au3. So you don't have to keep using the same code over and over again.

Example:

If you want this func in your program.

Include file:

Func _ComplexFunc()
;Lots
;Of
;Lines
;Here
;Return Code
EndFunc
oÝ÷ Ù.®è¶¦±Êâ¦Ö®¶­s`¤bô6ö×ÆWgVæ2FVà
Edited by Generator

Share this post


Link to post
Share on other sites
PsaltyDS

Read the help file on these commands.

You've already gotten several explanations of #include.

FileInstall() creates a compressed copy of the specified file inside the compiled script at compile time (when you hit F7 in SciTE and create the .exe). Then, when you run the script, the file gets uncompressed and copied to the location specified.

Both operations are accomplished by the one instance of FileInstall() in the script, so you don't have to "include" the file before "installing" it.

:rolleyes:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

×