Jump to content

Need help with Reshacker BMP add script


Recommended Posts

Idk if im in the right place to be asking about this but i have been scouring google trying to figure out how to make a script that will add thousands of Bitmap images into reshacker i need to follow a specific number sequence so im planning on typing every file path out manually but i just cant get the script to work what i got sofar is

 

[FILENAMES]

Exe=gfx002.egf

SaveAs=gfx002.egf

Log=


[COMMANDS]
{
-addoverwrite  C:\Users\Skyeler\Desktop\gfx\GUI\GuiHUD - Backup\Bitmap_1, BITMAP, 1, 0

-addoverwrite  C:\Users\Skyeler\Desktop\gfx\GUI\GuiHUD - Backup\Bitmap_2, BITMAP, 101, 0
}

 

its either this or resorting to a scar divi mouseclick script -.-'

Link to comment
Share on other sites


Well, if you use path or filenames with spaces you will need to wrap them in double quotes.

The syntax for the -addoverwrite command is different if you use it "on it's own", like:

-addoverwrite	ExeFile, SaveAsFile, ResourceFile, ResourceMaskResourceHacker.exe -addoverwrite MyProg.exe, MyProgNew.exe, NewImage.bmp , bitmap,128,
 

or as a ResHacker script:

syntax: ResourceHacker.exe -script ScriptFile
 

ScriptFile is a text file with the following layout:

 

 

//comments are preceded by double slashes[FILENAMES]Exe=MyProg.exeSaveAs=MyProgNew.exeLog=[COMMANDS]-addoverwrite ResourceSrc, ResourceMask...

But a Reshacker script is intended to run multiple commands on a SAME file, what you want is instead seemingly to run a same command (or a few of them) on multiple files.

You need to make a batch (or vbs or autoit or other scripting language) capable of running the reshacker program on a list of files (or on all the files inside a given folder) or capable of creating a number of Reshacker script files and then run them.

If you provide an EXACT description of what you want to do and how you have the file arranged, then someone could assist you better.

jaclaz

Link to comment
Share on other sites

Well, if you use path or filenames with spaces you will need to wrap them in double quotes.

The syntax for the -addoverwrite command is different if you use it "on it's own", like:

-addoverwrite	ExeFile, SaveAsFile, ResourceFile, ResourceMaskResourceHacker.exe -addoverwrite MyProg.exe, MyProgNew.exe, NewImage.bmp , bitmap,128,
 

or as a ResHacker script:

syntax: ResourceHacker.exe -script ScriptFile
 

ScriptFile is a text file with the following layout:

 

 

//comments are preceded by double slashes[FILENAMES]Exe=MyProg.exeSaveAs=MyProgNew.exeLog=[COMMANDS]-addoverwrite ResourceSrc, ResourceMask...

But a Reshacker script is intended to run multiple commands on a SAME file, what you want is instead seemingly to run a same command (or a few of them) on multiple files.

You need to make a batch (or vbs or autoit or other scripting language) capable of running the reshacker program on a list of files (or on all the files inside a given folder) or capable of creating a number of Reshacker script files and then run them.

If you provide an EXACT description of what you want to do and how you have the file arranged, then someone could assist you better.

jaclaz

 

 

 

Well, if you use path or filenames with spaces you will need to wrap them in double quotes.

The syntax for the -addoverwrite command is different if you use it "on it's own", like:

-addoverwrite	ExeFile, SaveAsFile, ResourceFile, ResourceMaskResourceHacker.exe -addoverwrite MyProg.exe, MyProgNew.exe, NewImage.bmp , bitmap,128,
 

or as a ResHacker script:

syntax: ResourceHacker.exe -script ScriptFile
 

ScriptFile is a text file with the following layout:

 

 

//comments are preceded by double slashes[FILENAMES]Exe=MyProg.exeSaveAs=MyProgNew.exeLog=[COMMANDS]-addoverwrite ResourceSrc, ResourceMask...

But a Reshacker script is intended to run multiple commands on a SAME file, what you want is instead seemingly to run a same command (or a few of them) on multiple files.

You need to make a batch (or vbs or autoit or other scripting language) capable of running the reshacker program on a list of files (or on all the files inside a given folder) or capable of creating a number of Reshacker script files and then run them.

If you provide an EXACT description of what you want to do and how you have the file arranged, then someone could assist you better.

jaclaz

 

well that i want to do is add Bitmap images without having to add 1 by 1 the number sequence iim using starts at 1 and jumps to 101 then continues adding 1 till 18  and jumps to 41-58 then 81-98 then once it hits 98 it adds 1 to the first number jumps to 21-38 and 61-78 then repeats from 1

 

1 = first number

01 = second number

 

 

i took a screen shot my file in reshacker if that helps

25t95w3.jpg

Link to comment
Share on other sites

Yep, and these kinds of things are what batch files tend to be good for, *like*

@ECHO OFFSETLOCAL ENABLEEXTENSIONSCALL :do_something 1FOR /L %%? IN (101, 1, 118) DO CALL :do_something %%?FOR /L %%? IN (141, 1, 158) DO CALL :do_something %%?FOR /L %%? IN (181, 1, 198) DO CALL :do_something %%?::You should have got the idea by nowPAUSEGOTO :EOF:do_somethingECHO Bitmap # is %1GOTO :EOF

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

Yep, and these kinds of things are what batch files tend to be good for, *like*

@ECHO OFFSETLOCAL ENABLEEXTENSIONSCALL :do_something 1FOR /L %%? IN (101, 1, 118) DO CALL :do_something %%?FOR /L %%? IN (141, 1, 158) DO CALL :do_something %%?FOR /L %%? IN (181, 1, 198) DO CALL :do_something %%?::You should have got the idea by nowPAUSEGOTO :EOF:do_somethingECHO Bitmap # is %1GOTO :EOF

jaclaz

so basically these Commands dont work is what your saying cause im being told to learn how to write batch when theres an option named -add why dont we keep it simple instead of jumping up 10 levels i dont want to learn how to write Batch at the moment because simple i dont have to there is no need for me to learn another code language when there is these Single Commands that should suffice for what im trying to do but every time i use them it returns Invalid Syntax

 

Single Commands:

command and command_parameters:

-compile resource_script.rc -add ExeFile, SaveAsFile, ResourceFile, ResourceMask -addskip ExeFile, SaveAsFile, ResourceFile, ResourceMask -addoverwrite ExeFile, SaveAsFile, ResourceFile, ResourceMask -modify ExeFile, SaveAsFile, ResourceFile, ResourceMask -extract ExeFile, ResourceFile, ResourceMask -delete ExeFile, SaveAsFile, ResourceMask

 

i dont want any jazzhands no extra schitt i just want the base function of adding these files all in 1 script to actually do somthing other then tell me that the Call doesnt exist ... this isnt rocket science so stop trying to turn it into that.... i f**king hate people that overcomplicate things simply cause its easy to learn and thats whats happening with and Code nowadays you cant ever find the simplest most basic acpects of that Chunk of code the bare necessities required to make it function ... yea you can never find that thats like asking somone for the answer to life you get 40,000 resaults about the same thing written a million different ways with 1 extra peice of BS added in to it every time ... this is the main reason many people tend to have issues attempting to learn how to code nobody keeps it basic there always teaching the more complex code nowadays instead of the code that just functions... yea we get it your code is big and does the exact function of a code 1/10th the size but it has a few extra things like a compressor some otheer peice of BS not neccessaraly needed for the task at hand but since its there it confuses you with an information Overload of components that have no relitive to the function your trying to use

 

can we just tone it back a little its anoying to see people say learning to code is difficult its not ... its the fact that you cant ever find a simple example of fully formated working complete Chunk without the extra s***

 

its like your trying to teach a somone who speaks another language how to say different fruits in your language then jumping to automotive terms and back to fruits

Edited by skyeler
Link to comment
Share on other sites

i dont want any jazzhands no extra schitt i just want the base function of adding these files all in 1 script to actually do somthing other then tell me that the Call doesnt exist ... this isnt rocket science so stop trying to turn it into that.... i f**king hate people that overcomplicate things simply cause its easy to learn and thats whats happening with and Code nowadays you cant ever find the simplest most basic acpects of that Chunk of code the bare necessities required to make it function ... yea you can never find that thats like asking somone for the answer to life you get 40,000 resaults about the same thing written a million different ways with 1 extra peice of BS added in to it every time ... this is the main reason many people tend to have issues attempting to learn how to code nobody keeps it basic there always teaching the more complex code nowadays instead of the code that just functions... yea we get it your code is big and does the exact function of a code 1/10th the size but it has a few extra things like a compressor some otheer peice of BS not neccessaraly needed for the task at hand but since its there it confuses you with an information Overload of components that have no relitive to the function your trying to use

Look, you posted a question in a place that is called:

Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)

Code snippets, tutorials, and help on implementing code

And - strangely enough - you were given some code snippets and some help on implementing code

 

Of course you are perfectly free to not appreciate any of what was provided, but whining because you didn't have exactly what you expected, or that you cannot find what you want makes little sense.

 

The batch snippet is just an example, you can use any other of the scripting languages you are familiar with to create a valid ResHacker script or a set of ResHacker commands.

 

can we just tone it back a little its anoying to see people say learning to code is difficult its not ... its the fact that you cant ever find a simple example of fully formated working complete Chunk without the extra s***

Yeah, sure, life is tough :(, sometimes you cannot get for free exactly what you want.

 

its like your trying to teach a somone who speaks another language how to say different fruits in your language then jumping to automotive terms and back to fruits

Not really, it's like trying to teach someone who speaks another language, and who has a communication problem, who actually asked for assistance in solving the communication problem BUT doesn't want to learn the language that could solve the problem and gets quickly annoyed.

 

But it is actually a non-issue, I had the impression that when someone asks for assistance and receives it he/she would receive it graciously, no matter if it is exactly what he/she expected or not, if needed asking for clarifications,  simply this is not the case, and I see no :no: reason to continue attempting to assist you.

 

jaclaz

 

Link to comment
Share on other sites

 

i dont want any jazzhands no extra schitt i just want the base function of adding these files all in 1 script to actually do somthing other then tell me that the Call doesnt exist ... this isnt rocket science so stop trying to turn it into that.... i f**king hate people that overcomplicate things simply cause its easy to learn and thats whats happening with and Code nowadays you cant ever find the simplest most basic acpects of that Chunk of code the bare necessities required to make it function ... yea you can never find that thats like asking somone for the answer to life you get 40,000 resaults about the same thing written a million different ways with 1 extra peice of BS added in to it every time ... this is the main reason many people tend to have issues attempting to learn how to code nobody keeps it basic there always teaching the more complex code nowadays instead of the code that just functions... yea we get it your code is big and does the exact function of a code 1/10th the size but it has a few extra things like a compressor some otheer peice of BS not neccessaraly needed for the task at hand but since its there it confuses you with an information Overload of components that have no relitive to the function your trying to use

Look, you posted a question in a place that is called:

Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)

Code snippets, tutorials, and help on implementing code

And - strangely enough - you were given some code snippets and some help on implementing code

 

Of course you are perfectly free to not appreciate any of what was provided, but whining because you didn't have exactly what you expected, or that you cannot find what you want makes little sense.

 

The batch snippet is just an example, you can use any other of the scripting languages you are familiar with to create a valid ResHacker script or a set of ResHacker commands.

 

can we just tone it back a little its anoying to see people say learning to code is difficult its not ... its the fact that you cant ever find a simple example of fully formated working complete Chunk without the extra s***

Yeah, sure, life is tough :(, sometimes you cannot get for free exactly what you want.

 

its like your trying to teach a somone who speaks another language how to say different fruits in your language then jumping to automotive terms and back to fruits

Not really, it's like trying to teach someone who speaks another language, and who has a communication problem, who actually asked for assistance in solving the communication problem BUT doesn't want to learn the language that could solve the problem and gets quickly annoyed.

 

But it is actually a non-issue, I had the impression that when someone asks for assistance and receives it he/she would receive it graciously, no matter if it is exactly what he/she expected or not, if needed asking for clarifications,  simply this is not the case, and I see no :no: reason to continue attempting to assist you.

 

jaclaz

 

im asking for assistance with reshacker scripting and you just end up telling me to go learn batch the issue i had with that was the fact that there is a way to make reshacker add the files so going and learning a whole different language would be very much counter productive cause i would then still have to learn how to make a script work in reshacker so learning batch would help me about as much as taking my keyboard and smashing it up against my face

 

i just wanna juice the orange with my hands your telling me to make a orange juicer and then juice the orange  i wanna remove the extra step of the orange juicer

Edited by skyeler
Link to comment
Share on other sites

I'll try to type this slowly. 

 

Reshacker has built-in a very primitive scripting language that has NO provision for anything but - after having set 3 (three) specific variables, the Exe to be edited, the new name to which it will be saved and an optional log file - executing in sequence, one by one, any number of explicit command lines, where each line corresponds to a single command with the appropriate parameters.

 

You want to use a Reshacker script in order to change tens or hundreds of resources.

 

You can well write manually tens or hundreds of command lines, adding them to the script or automate (in batch or any other scripting language) the generation of these tens of command lines.

 

Batch (or *any* other scripting language) is the tool that may allow you to create these tens of lines of the ResHacker script.

 

You are not wanting to squeeze an orange with your hands (that would be done with a Hex Editor in the case of resources), you want to squeeze tens or hundreds of oranges with your nice orange juicer (the ResHacker), BUT:

... i want to do is add Bitmap images without having to add 1 by 1 the number sequence

you don't want to walk and take a new orange from the box after having squeezed the previous one.

What I proposed you was not to build an orange juicer :no:, you already have the orange juicer, it was to build something like this:

an automatic feeder for your juicer.

jaclaz

Link to comment
Share on other sites

So your taking a very primitive task and turning it onto somthing with many more components and different things thanks thats really what i needed...i dont need another problem to solve i need the information for blank spaces that are left from the half assed discription of how to use the "reshacker" scripting given by 99% of the people over the internet

 

blank spaces such as why when i copy a syntax over from the webpage i downloaded the program from that specific syntax tells me its an invalid syntax

 

or things such as how to set the beginning of the script up with all the generic tables and info needed to run it correctly starter things like that you know the beginning format as an exapmle (Scar divi with the Start, Begin and End lines) if this relitive formating is needed or not when using a specific syntax simple stuff like that

Edited by skyeler
Link to comment
Share on other sites

Well, you asked for that (complex use of a primitive scripting provision) by declaring you wanted to edit tens or hundreds of resources without manually typing the numbers.

 

I cannot understand what you mean by "scar divi". :unsure:

 

Post the EXACT script file you are using (for a SINGLE resource editing) and that gives you a syntax error, and maybe someone might understand what the issue is.

 

jaclaz

Link to comment
Share on other sites

http://www.file-extensions.org/egf-file-extension

And the OP wants to change a (one or more) "BMP" (?) inside of it for some odd reason.

 

In addition the OP is Copy/Pasting "snippets" not realizing that many sites don't use

code tags
that corrupts by inserting spaces and/or garbage. The OP (apparently) wants a "lesson" in replacing said (multiple?) BMP's within said EGF file(s) using ResHacker "script" but tosses just the "syntax" info in.

 

Might we suggest (again) that the OP provide the "script" they're attempting to use. Honest, it probably won't provide any "secrets" by doing so. The OP seem to be reticent/reluctant/obstinate in providing it. We help with *specific* problems, not *generic* (read that as "giving a lesson in a particular scripting language"). It may behoove the OP to work with the GUI and a copy of the File to determine "how it works" and the ResHacker Suffix/FileType Naming Conventions (see next paragraph with link).

 

This is apparently the version the OP is using and referencing. Perhaps the OP might also learn how to use the CodeBox we all use here in the forum as well? (See example above...)

http://www.angusj.com/resourcehacker/

 

HTH (and settle down, Spanky...)

Link to comment
Share on other sites

sorry

 

the EGF's are the image storage containers for all the seperate BMP Sprites for a 2D Game its basicly just a file directory

 

i need to add the file and ID it i didnt wanna have to write a whole other subprocess for somthing such as add and name

 

also it didnt matter to me if i had to write every single number id in manually is what i think i said o.o' i just didnt wanna have to click add then click the image i wanted to add then rename it to the next ID since its 18 images per Npc

 

Scar divi is just a scripting program that uses pascal (tho the whole process of getting screen locations and making timed waits is just a whole lot more of a pain in the neck 8 or 10 lines per image add)

 

a copy of the file

https://www.mediafire.com/?m4ze6n37yeyn9ae

 

again my bad if i thought it was gunna be easyer then using -add getting the Image location and knowing what i wanted to name it

Edited by skyeler
Link to comment
Share on other sites

Well, you could "dump" the Resources ( :unsure: ) to get the current info, but wouldn't you still have to manually figure out which was what in order to modify each one or even to add another several without "stomping on" the pre-existing ones? It kind of looks like you're "stuck" with manual and "test". That is, unless jaclaz has a "simple solution".... In any case, you'd *still* have to Test and construct a suitable script to repeat what you've already done. :crazy:

Link to comment
Share on other sites

  • 1 year later...

here is what i used in XP (its kind of unfinished and not from me alone) - but it is good enough to extract all resources of a folder, - and change them...

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
  • Recently Browsing   0 members

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