Code:
<?php
set_time_limit(0);
/*=======================================================================
| Vemund Eldegard aka iLost.
| #######################################################################
| Found on Otaku-Studio
| Free for use!
\======================================================================*/
$db_host = "localhost"; //Host database
$db_user = "root"; //mysql_user
$db_pass = ""; //mysql_password
$db_database = ""; //database
$connect = mysql_connect($db_host, $db_user, $db_pass) or die("Could not connect to server, error: ".mysql_error());
$db = mysql_select_db($db_database, $connect) or die("Could not connect to database, error: ".mysql_error());
$data = file_get_contents("http://www.habbo.fi/gamedata/furnidata?hash=x");
$data = str_replace("\n", "", $data);
$data = str_replace("[[", "[", $data);
$data = str_replace("]]", "]", $data);
$data = str_replace("][", "],[", $data);
foreach (explode('],[', $data) as $val)
{
$val = str_replace('[', '', $val);
$val = str_replace(']', '', $val);
$bits = explode(',', $val);
$name = str_replace('"', '', $bits[2]);
$stufftoupdate[] = '[' . $val . ']';
}
foreach ($stufftoupdate as $stuff)
{
#Start select item_name
$stuff = str_replace('"s",', '', $stuff);
$stuff = str_replace('"i",', '', $stuff);
$furni = explode('[', $stuff);
$furni = explode(']', $furni[1]);
$nome = explode('","', $furni[0]);
$nome = explode('","', $nome[1]);
$nome = $nome[0];
#End select item_name
#Start select sprite_id
$stuff = str_replace('"s",', '', $stuff);
$stuff = str_replace('"i",', '', $stuff);
$furni = explode('[', $stuff);
$furni = explode(']', $furni[1]);
$id = explode('"', $furni[0]);
$id = explode('","', $id[1]);
$id = $id[0];
#End select sprite_id
$idfurni = mysql_query("SELECT * FROM items_base WHERE item_name = '$nome'");
$furni = mysql_fetch_array($idfurni);
$furniid = $furni['item_id'];
$update = mysql_query("UPDATE items_base SET sprite_id = ".$id." WHERE iteM_id =".$furniid);
if ($update==FALSE) echo("MySQL error in item ".$nome."<br/><br/>");
else echo("Item ".$nome." updated<br/><br/>");
}
?>
Change mysql details and furnidata hotel location.