EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Tools (https://www.eqemulator.org/forums/forumdisplay.php?f=593)
-   -   Super simple dragitem to *.gif stripping code (https://www.eqemulator.org/forums/showthread.php?t=39815)

Shin Noir 07-01-2015 07:30 AM

Super simple dragitem to *.gif stripping code
 
This is a ack together that takes the latest *.dds files from live (dragitem#.dds) and turns them into item_###.gif files (that reflect the item icon ID). It's total hack, but works.

Requirements: convert
http://www.imagemagick.org/script/convert.php

My version is on a unix based system, but you can easily do windows just changing the convert commands to convert.exe, and any / to \'s.
And cp to copy.

You also need to run php code. (It's a hack!)

Code:

<?php
for ($id = 1; $id < 218; $id++) {
        echo "$id\n";       
        if (!file_exists($id)) mkdir($id);
        exec("convert dragitem$id.dds -crop 40x40 +repage +adjoin $id/item_%02d.gif");
}

$baseCounter = 500;
if (!file_exists('out')) mkdir('out');

for ($i = 1; $i < 218; $i++) {

        $files = scandir($i);

        //$row = 1;
        $numFiles = 0;
       
        $fileCounter = 0;
        $counter = $baseCounter;
        foreach ($files as $file) {

                if ($file == "." || $file == "..") continue;
                if (filesize("$i/$file") < 100) {

                        continue;
                }
                $name = $fileCounter+$counter;
               
                //echo "$file = $name";
                exec("cp $i/$file out/item_$name.gif");

                $fileCounter += 6;

                if ($fileCounter >= 31) {
                        $fileCounter = 0;
                        $counter++;
                }
        }
        $baseCounter += 36;

}

If you'd rather just get a dump of every item icon let me know.

There's ~7800 icon images


All times are GMT -4. The time now is 05:29 AM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.