- Joined
- Jul 14, 2012
- Messages
- 244
- Reaction score
- 147
Furniture, pets AND clothes with zoomout + automated script (last update: 04-07-2015)
Hello ragezone,
I've made a script which will make the zoomout images and codes automatically, so it will take me about 30 minutes (because I have to decompile, run my script, export) to fix the new released furniture, pets and clothes from habbo.
I will also release my script here, but I'm not going to help if you can't get it working.
I will post the zoomout furnitures, pets and clothes anyway, so you might not even need my script.
Here's are my scripts (these are for furniture and pets):
index.php
SimpleImage.php
How to use these scripts:
- Put them in a directory of your choice.
- Decompile the furniture (without the graphic tags) with decompiler trillix (to get a .flex project).
- Copy all flex project directories to the same directory of your scripts.
- Run index.php.
- ???
Profit.
Now you can import them into flash builder 4.6 and export them right away, voila, you're done.
For the people wondering why I did this in php, I love php and I was sure I could make it with php.
Also, almost everyone runs php on their server, so everyone should be able to run this script (if you have the gd library extension turned on from php).
I've made a new script to rename custom furniture really fast.
- First you decompile (with trillix decompiler to a .flex project) an existing furniture, you want to recolor, or just remake, or whatever.
- Place it in the same directory as this code
- Edit the name in the script ($newname)
- Run the script
Done!
namechange.php
Here's the script to get clothes with zoomout.
You'll need to add the SimpleImage.php script to the same directory to get it working as well (see above)
Instructions: The same as furniture.
clothes.php
Here are the zoomout furniture I have fixed for now:
Dino:
Infobus:
Army:
Paris:
Screenshot paris and dino:
Theatre and some more furni
Screenshot Theatre and some more furni:
32+1 Clothes with zoomout, including new dino clothes:
Screenshot of pets and clothes with zoomout:
(dino clothes look better already in the new download)
Here's a screenshot of the other clothes:
2 new furni with zoomout, youtube logic changed to static furniture, no graphic tags:
15 habbo15 furni with zoomout:
12 furni with goth furni and stuff with zoomout:
Well I hope you'll be happy with these.
Cya,
-Ricardo
edit:
p.s. I'm also working on a script for zoomout clothes, should be done soon™
edit2:
Confirmed working for pets, just not looking great..
edit3:
Added theatre and more furni
edit4:
Made a code to rename custom furniture really fast
Also finished the code for zoomout clothes, you can check my reply to test the, if they work I'll post the script in the thread.
edit5:
Finished the script for clothes with zoomout images and stuff, looks better than pets, but it's not perfect!
edit6:
For clothes, -0.5 seem to work better than + 0.5, if it's ugly with +0.5, try using -0.5. I've switched to default - 0.5 for now.
edit7:
Added 32 clothes with zoomout, with reworked dino clothes included
edit8:
forgot skulldino.swf, added it
edit9:
added 2 new furni
edit10:
Fixed 2 scripts, new versions added
edit11:
added 15 habbo15 furni with zoomout
edit12:
added 12 goth and more furni with zoomout
Hello ragezone,
I've made a script which will make the zoomout images and codes automatically, so it will take me about 30 minutes (because I have to decompile, run my script, export) to fix the new released furniture, pets and clothes from habbo.
I will also release my script here, but I'm not going to help if you can't get it working.
I will post the zoomout furnitures, pets and clothes anyway, so you might not even need my script.
Here's are my scripts (these are for furniture and pets):
index.php
PHP:
<?php
#version 1.0.5
$start_time = microtime(TRUE);
include('SimpleImage.php');
function sortt($a,$b){
return strlen($a)-strlen($b);
}
function delendoor2($matches)
{
if($matches[2]%2 != 0)
{
$helft = $matches[2] / 2 - 0.5;
}
else
{
$helft = $matches[2] / 2;
}
return $matches[1] . $helft . $matches[3] ;
}
$daarna = "src";
$testing = 0;
echo'<pre>';
$tellen = 0;
$dirs = array_filter(glob('*'), 'is_dir');
foreach($dirs as $mapnaam)
{
if(strpos($mapnaam,'.swf.flex') !== false)
{
$tellen ++;
$map = $mapnaam .'/'. $daarna;
$bestanden = scandir($map);
unset($bestanden[0]);
unset($bestanden[1]);
usort($bestanden,'sortt');
$teltel = 0;
$basename = 'test';
while(strpos($basename,'.as') === false)
{
$basename = $bestanden[$teltel];
$teltel++;
}
$basename = substr($basename, 0, -3);
foreach($bestanden as $bestand)
{
$laatste3 = substr($bestand, -3);
if($laatste3 != 'png')
{
if($bestand == $basename .'.as' && $testing != 1)
{
$myfile = fopen($map .'/'. $bestand, "r") or die("Unable to open file!");
$content = fread($myfile,filesize($map .'/'. $bestand));
fclose($myfile);
$regels = explode('<br />', nl2br($content));
foreach($regels as $key => $regel)
{
$newregels[] = $regel;
if(strpos($regel,'_64_') !== false)
{
$newregels[] = '';
$newregels[] = str_replace('_64_', '_32_', $regel);
}
}
$newregels[] = '';
$regels = implode('', $newregels);
file_put_contents($map .'/'. $bestand,$regels);
}
unset($newregels);
if(strpos($bestand,'_64_') !== false && $testing != 1)
{
$myfile = fopen($map .'/'. $bestand, "r") or die("Unable to open file!");
$content = fread($myfile,filesize($map .'/'. $bestand));
$content = str_replace('_64_', '_32_', $content);
fclose($myfile);
$bestandsnaam = str_replace('_64_', '_32_', $bestand);
file_put_contents($map .'/'. $bestandsnaam,$content);
}
if($basename .'_'. $basename .'_assets.dat' == $bestand && $testing != 1)
{
$myfile = fopen($map .'/'. $bestand, "r") or die("Unable to open file!");
$content = fread($myfile,filesize($map .'/'. $bestand));
fclose($myfile);
$regels = explode('<br />', nl2br($content));
foreach($regels as $key => $regel)
{
$newregels[] = $regel;
if(strpos($regel,'_64_') !== false)
{
$newregels[] = preg_replace_callback('/(x="-?)(\d+)(")/', 'delendoor2', preg_replace_callback('/(y="-?)(\d+)(")/', 'delendoor2', str_replace('_64_', '_32_', $regel)));
}
}
$newregels[] = '';
$regels = implode('', $newregels);
file_put_contents($map .'/'. $bestand,$regels);
}
unset($newregels);
if($basename .'_'. $basename .'_logic.dat' == $bestand && $testing != 1)
{
$myfile = fopen($map .'/'. $bestand, "r") or die("Unable to open file!");
$content = fread($myfile,filesize($map .'/'. $bestand));
fclose($myfile);
$regels = explode('<br />', nl2br($content));
foreach($regels as $key => $regel)
{
$newregels[] = $regel;
if(strpos($regel,'size="64"') !== false)
{
$newregels[] = str_replace('size="64"', 'size="32"', $regel);
}
}
$newregels[] = '';
$regels = implode('', $newregels);
file_put_contents($map .'/'. $bestand,$regels);
}
unset($newregels);
if($basename .'_'. $basename .'_visualization.dat' == $bestand && $testing != 1)
{
$myfile = fopen($map .'/'. $bestand, "r") or die("Unable to open file!");
$content = fread($myfile,filesize($map .'/'. $bestand));
$regels = explode('<br />', nl2br($content));
$regelaan = 0;
$regelsweg = 0;
foreach($regels as $key => $regel)
{
if((strpos($regel,'size="64"') !== false || $regelaan == 1) && strpos($regel,'</visualizationData>') === false)
{
$newregels[] = str_replace('size="64"', 'size="32"', $regel);
$regelaan = 1;
}
}
foreach($regels as $key => $regel)
{
if(strpos($regel,'</visualizationData>') !== false)
{
$sluitkey = $key;
}
}
if(count($newregels) > 0)
{
$newregels = array_reverse($newregels);
foreach($newregels as $newregel)
{
array_splice($regels, $sluitkey, 0, $newregel);
}
}
foreach($regels as $key => $regel)
{
if(strpos($regel,'size="32"') !== false && $regelsweg != 2)
{
$regelsweg = 1;
}
if(strpos($regel,'size="64"') !== false)
{
$regelsweg = 2;
}
if($regelsweg == 1)
{
unset($regels[$key]);
}
}
fclose($myfile);
$regels = implode('', $regels);
file_put_contents($map .'/'. $bestand,$regels);
}
unset($newregels);
if($basename .'_manifest.dat' == $bestand && $testing != 1)
{
$myfile = fopen($map .'/'. $bestand, "r") or die("Unable to open file!");
$content = fread($myfile,filesize($map .'/'. $bestand));
fclose($myfile);
$regels = explode('<br />', nl2br($content));
foreach($regels as $key => $regel)
{
$newregels[] = $regel;
if(strpos($regel,'_64_') !== false)
{
$newregels[] = str_replace('_64_', '_32_', $regel);
}
}
$regels = implode('', $newregels);
file_put_contents($map .'/'. $bestand,$regels);
}
unset($newregels);
if($basename .'_index.dat' == $bestand && $testing != 1)
{
$myfile = fopen($map .'/'. $bestand, "r") or die("Unable to open file!");
$content = fread($myfile,filesize($map .'/'. $bestand));
fclose($myfile);
$content = str_replace('furniture_purchasable_clothing', 'furniture_multistate', $content);
file_put_contents($map .'/'. $bestand,$content);
}
}
else if($laatste3 == 'png' && strpos($bestand,'icon') === false && $testing != 1)
{
$image = new SimpleImage();
$image->load($map . '/' . $bestand);
if($image->getWidth() > 1 && $image->getHeight() > 1)
{
if($image->getWidth()%2 != 0)
{
$image->resizeToWidth($image->getWidth() / 2 + 0.5);
}
else
{
$image->resizeToWidth($image->getWidth() / 2);
}
}
$nieuwenaam = str_replace('64', '32', $bestand);
$image->save($map . '/' . $nieuwenaam);
}
}
}
}
$end_time = microtime(TRUE);
$time_taken = $end_time - $start_time;
$time_taken = round($time_taken,5);
echo $tellen .' Furniture generated in '.$time_taken.' seconds.';
?>
SimpleImage.php
PHP:
<?php
/*
* File: SimpleImage.php
* Author: Simon Jarvis
* Copyright: 2006 Simon Jarvis
* Date: 08/11/06
* Link: http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details:
* http://www.gnu.org/licenses/gpl.html
*
*/
class SimpleImage {
var $image;
var $image_type;
function load($filename) {
$image_info = getimagesize($filename);
$this->image_type = $image_info[2];
if( $this->image_type == IMAGETYPE_JPEG ) {
$this->image = imagecreatefromjpeg($filename);
} elseif( $this->image_type == IMAGETYPE_GIF ) {
$this->image = imagecreatefromgif($filename);
} elseif( $this->image_type == IMAGETYPE_PNG ) {
$this->image = imagecreatefrompng($filename);
}
}
function save($filename, $image_type=IMAGETYPE_JPEG, $compression=75, $permissions=null) {
// do this or they'll all go to jpeg
$image_type=$this->image_type;
if( $image_type == IMAGETYPE_JPEG ) {
imagejpeg($this->image,$filename,$compression);
} elseif( $image_type == IMAGETYPE_GIF ) {
imagegif($this->image,$filename);
} elseif( $image_type == IMAGETYPE_PNG ) {
// need this for transparent png to work
imagealphablending($this->image, false);
imagesavealpha($this->image,true);
imagepng($this->image,$filename);
}
if( $permissions != null) {
chmod($filename,$permissions);
}
}
function output($image_type=IMAGETYPE_JPEG) {
if( $image_type == IMAGETYPE_JPEG ) {
imagejpeg($this->image);
} elseif( $image_type == IMAGETYPE_GIF ) {
imagegif($this->image);
} elseif( $image_type == IMAGETYPE_PNG ) {
imagepng($this->image);
}
}
function getWidth() {
return imagesx($this->image);
}
function getHeight() {
return imagesy($this->image);
}
function resizeToHeight($height) {
$ratio = $height / $this->getHeight();
$width = $this->getWidth() * $ratio;
$this->resize($width,$height);
}
function resizeToWidth($width) {
$ratio = $width / $this->getWidth();
$height = $this->getheight() * $ratio;
$this->resize($width,$height);
}
function scale($scale) {
$width = $this->getWidth() * $scale/100;
$height = $this->getheight() * $scale/100;
$this->resize($width,$height);
}
function resize($width,$height, $xx = 0, $yy = 0, $ww = '', $hh = '') {
$new_image = imagecreatetruecolor($width, $height);
/* Check if this image is PNG or GIF, then set if Transparent*/
if(($this->image_type == IMAGETYPE_GIF) || ($this->image_type==IMAGETYPE_PNG)){
imagealphablending($new_image, false);
imagesavealpha($new_image,true);
$transparent = imagecolorallocatealpha($new_image, 255, 255, 255, 127);
imagefilledrectangle($new_image, 0, 0, $width, $height, $transparent);
}
if($ww != '') {
$widthh = $ww;
} else {
$widthh = $this->getWidth();
}
if($hh != '') {
$heighth = $hh;
} else {
$heighth = $this->getHeight();
}
imagecopyresampled($new_image, $this->image, 0, 0, $xx, $yy, $width, $height, $widthh, $heighth);
$this->image = $new_image;
}
}
?>
How to use these scripts:
- Put them in a directory of your choice.
- Decompile the furniture (without the graphic tags) with decompiler trillix (to get a .flex project).
- Copy all flex project directories to the same directory of your scripts.
- Run index.php.
- ???
Profit.
Now you can import them into flash builder 4.6 and export them right away, voila, you're done.
For the people wondering why I did this in php, I love php and I was sure I could make it with php.
Also, almost everyone runs php on their server, so everyone should be able to run this script (if you have the gd library extension turned on from php).
I've made a new script to rename custom furniture really fast.
- First you decompile (with trillix decompiler to a .flex project) an existing furniture, you want to recolor, or just remake, or whatever.
- Place it in the same directory as this code
- Edit the name in the script ($newname)
- Run the script
Done!
namechange.php
PHP:
<?php
#version 1.0.1
$start_time = microtime(TRUE);
$newname = "newfurniname"; //Edit this field to your new furni name
$daarna = "src";
$testing = 0;
echo'<pre>';
$tellen = 0;
$dirs = array_filter(glob('*'), 'is_dir');
foreach($dirs as $mapnaam)
{
if(strpos($mapnaam,'.swf.flex') !== false)
{
$tellen ++;
$map = $mapnaam .'/'. $daarna;
$meubel = substr($mapnaam, 0, -9);
$projecten = scandir($mapnaam);
$bestanden = scandir($map);
unset($bestanden[0]);
unset($bestanden[1]);
unset($projecten[0]);
unset($projecten[1]);
foreach($projecten as $project)
{
if($project != $daarna && $testing != 1)
{
$myfile = fopen($mapnaam .'/'. $project, "r") or die("Unable to open file!");
$content = fread($myfile,filesize($mapnaam .'/'. $project));
$content = str_replace($meubel, $newname, $content);
file_put_contents($mapnaam .'/'. $project,$content);
}
}
foreach($bestanden as $bestand)
{
$laatste3 = substr($bestand, -3);
if($laatste3 != 'png' && $testing != 1)
{
$myfile = fopen($map .'/'. $bestand, "r") or die("Unable to open file!");
$content = fread($myfile,filesize($map .'/'. $bestand));
$content = str_replace($meubel, $newname, $content);
fclose($myfile);
file_put_contents($map .'/'. $bestand,$content);
$newbestand = str_replace($meubel, $newname, $bestand);
rename($map .'/'. $bestand, $map .'/'. $newbestand);
}
else if($laatste3 == 'png' && $testing != 1)
{
$newbestand = str_replace($meubel, $newname, $bestand);
rename($map .'/'. $bestand, $map .'/'. $newbestand);
}
}
if($testing != 1)
{
$newmap = str_replace($meubel, $newname, $mapnaam);
rename($mapnaam, $newmap);
}
}
}
$end_time = microtime(TRUE);
$time_taken = $end_time - $start_time;
$time_taken = round($time_taken,5);
echo $tellen .' Files generated in '.$time_taken.' seconds.';
?>
Here's the script to get clothes with zoomout.
You'll need to add the SimpleImage.php script to the same directory to get it working as well (see above)
Instructions: The same as furniture.
clothes.php
PHP:
<?php
#version 1.0.1
$start_time = microtime(TRUE);
include('SimpleImage.php');
function sortt($a,$b){
return strlen($a)-strlen($b);
}
function delendoor2($matches)
{
if($matches[2]%2 != 0)
{
$helft = $matches[2] / 2 - 0.5;
}
else
{
$helft = $matches[2] / 2;
}
return $matches[1] . $helft . $matches[3] ;
}
function delendoor2value($matches)
{
if($matches[2]%2 != 0)
{
$helft = $matches[2] / 2 - 0.5;
}
else
{
$helft = $matches[2] / 2;
}
if($matches[4]%2 != 0)
{
$helft4 = $matches[4] / 2 - 0.5;
}
else
{
$helft4 = $matches[4] / 2;
}
return $matches[1] . $helft . $matches[3] . $helft4 . $matches[5] ;
}
$daarna = "src";
$testing = 0;
echo'<pre>';
$tellen = 0;
$dirs = array_filter(glob('*'), 'is_dir');
foreach($dirs as $mapnaam)
{
$tellen ++;
$map = $mapnaam .'/'. $daarna;
$bestanden = scandir($map);
unset($bestanden[0]);
unset($bestanden[1]);
usort($bestanden,'sortt');
$basename = substr($bestanden[0], 0, -3);
foreach($bestanden as $bestand)
{
$laatste3 = substr($bestand, -3);
if($laatste3 != 'png')
{
if($bestand == $basename .'.as' && $testing != 1)
{
$myfile = fopen($map .'/'. $bestand, "r") or die("Unable to open file!");
$content = fread($myfile,filesize($map .'/'. $bestand));
$regels = explode('<br />', nl2br($content));
foreach($regels as $key => $regel)
{
if(strpos($regel,'_h_') !== false)
{
$newregels[] = '';
$newregels[] = str_replace('_h_', '_sh_', str_replace(' h_', ' sh_', $regel));
}
if($regel == '
}')
{
$sluitkey = $key;
}
}
$newregels[] = '';
foreach($newregels as $newregel)
{
array_splice($regels, $sluitkey, 0, $newregel);
}
fclose($myfile);
$regels = implode('', $regels);
file_put_contents($map .'/'. $bestand,$regels);
}
unset($newregels);
if(strpos($bestand,'_h_') !== false && $testing != 1)
{
$myfile = fopen($map .'/'. $bestand, "r") or die("Unable to open file!");
$content = fread($myfile,filesize($map .'/'. $bestand));
$content = str_replace('_h_', '_sh_', $content);
fclose($myfile);
$bestandsnaam = str_replace('_h_', '_sh_', $bestand);
file_put_contents($map .'/'. $bestandsnaam,$content);
}
unset($newregels);
if($basename .'_manifest.dat' == $bestand && $testing != 1)
{
$myfile = fopen($map .'/'. $bestand, "r") or die("Unable to open file!");
$content = fread($myfile,filesize($map .'/'. $bestand));
$regels = explode('<br />', nl2br($content));
foreach($regels as $key => $regel)
{
if(strpos($regel,'name="h_') !== false)
{
$newregels[] = str_replace('name="h_', 'name="sh_', $regel);
}
if(strpos($regel,'<param') !== false)
{
$newregels[] = preg_replace_callback('/(value="-?)(\d+)(,-?)(\d+)(")/', 'delendoor2value', $regel);
}
if(strpos($regel,'</asset>') !== false)
{
$newregels[] = $regel;
}
if(strpos($regel,'</assets>') !== false)
{
$sluitkey = $key;
}
}
if(count($newregels) > 0)
{
$newregels = array_reverse($newregels);
foreach($newregels as $newregel)
{
array_splice($regels, $sluitkey, 0, $newregel);
}
}
fclose($myfile);
$regels = implode('', $regels);
file_put_contents($map .'/'. $bestand,$regels);
}
unset($newregels);
}
else if($laatste3 == 'png' && $testing != 1)
{
$image = new SimpleImage();
$image->load($map . '/' . $bestand);
if($image->getWidth() > 1 && $image->getHeight() > 1)
{
if($image->getWidth()%2 != 0)
{
$image->resizeToWidth($image->getWidth() / 2 + 0.5);
}
else
{
$image->resizeToWidth($image->getWidth() / 2);
}
}
$nieuwenaam = str_replace('_h_', '_sh_', $bestand);
$image->save($map . '/' . $nieuwenaam);
}
}
}
$end_time = microtime(TRUE);
$time_taken = $end_time - $start_time;
$time_taken = round($time_taken,5);
echo $tellen .' Furniture generated in '.$time_taken.' seconds.';
?>
Here are the zoomout furniture I have fixed for now:
Dino:
You must be registered to see links
Infobus:
You must be registered to see links
Army:
You must be registered to see links
Paris:
You must be registered to see links
Screenshot paris and dino:
You must be registered to see links
Theatre and some more furni
You must be registered to see links
Screenshot Theatre and some more furni:
You must be registered to see links
32+1 Clothes with zoomout, including new dino clothes:
You must be registered to see links
You must be registered to see links
Screenshot of pets and clothes with zoomout:
You must be registered to see links
(dino clothes look better already in the new download)
Here's a screenshot of the other clothes:
You must be registered to see links
2 new furni with zoomout, youtube logic changed to static furniture, no graphic tags:
You must be registered to see links
15 habbo15 furni with zoomout:
You must be registered to see links
12 furni with goth furni and stuff with zoomout:
You must be registered to see links
Well I hope you'll be happy with these.
Cya,
-Ricardo
edit:
p.s. I'm also working on a script for zoomout clothes, should be done soon™
edit2:
Confirmed working for pets, just not looking great..
edit3:
Added theatre and more furni
edit4:
Made a code to rename custom furniture really fast
Also finished the code for zoomout clothes, you can check my reply to test the, if they work I'll post the script in the thread.
edit5:
Finished the script for clothes with zoomout images and stuff, looks better than pets, but it's not perfect!
edit6:
For clothes, -0.5 seem to work better than + 0.5, if it's ugly with +0.5, try using -0.5. I've switched to default - 0.5 for now.
edit7:
Added 32 clothes with zoomout, with reworked dino clothes included
edit8:
forgot skulldino.swf, added it
edit9:
added 2 new furni
edit10:
Fixed 2 scripts, new versions added
edit11:
added 15 habbo15 furni with zoomout
edit12:
added 12 goth and more furni with zoomout
Last edited: