Thanks, I would definitely goint to use it! :-)
This is a discussion on [C#] Webbuild Updater by JNike within the Habbo Releases forums, part of the Habbo Hotel category; Hey, i've coded before 1 week a cool tool. It updates your webbuild to the actualest. Every 60 seconds it ...
Hey,
i've coded before 1 week a cool tool. It updates your webbuild to the actualest. Every 60 seconds it gets the newest webbuild with help of Regex and updates your database table and the row for the webbuild.
I think its useful for my hotel cuz i use all habbo styles from habbo.de. So i'm ripping every 60 Seconds the styles of the Hotel.
Here are the classes in C#, only for good programmers in C# meaned, they have to create their own classes etc.: (Don't forget to import the mysql dll from the mysql conector :-])
Mysql.cs
Regex.csCode:using System; using System.Collections.Generic; using System.Linq; using System.Text; using MySql.Data.MySqlClient; using MySql.Data; using System.Data; namespace Webbuild_Updater_for_HabbuCMS { class Mysql { protected string HOST; protected string USERNAME; protected string PASSWORT; protected string DATABASE; protected uint PORT = 3306; private static MySqlCommand mCommand; private static MySqlConnection mConnection; public Mysql(string H, string U, string P, string D, uint PORT = 3306) { this.HOST = H; this.USERNAME = U; this.PASSWORT = P; this.DATABASE = D; this.PORT = PORT; } public bool OpenMysqlConnection() { MySqlConnectionStringBuilder mString = new MySqlConnectionStringBuilder(); mString.Server = this.HOST; mString.Port = this.PORT; mString.Database = this.DATABASE; mString.Password = this.PASSWORT; mString.UserID = this.USERNAME; mConnection = new MySqlConnection(mString.ToString()); try { mConnection.Open(); } catch { } return mConnection.State == ConnectionState.Open ? true : false; } public void ExecuteQuery(string Q) { mCommand = new MySqlCommand(Q, mConnection); mCommand.ExecuteNonQuery(); } } }
Program.csCode:using System; using System.Collections.Generic; using System.Linq; using System.Text; using MySql.Data.MySqlClient; using MySql.Data; using System.Text.RegularExpressions; using System.Net; namespace Webbuild_Updater_for_HabbuCMS { class REGEX { protected string URL; private WebClient WEBCLIENT = new WebClient(); private Regex mRegex; private Match mMatch; public REGEX(string URL) { this.URL = URL; } public string ReturnWebbuild() { string HTML = WEBCLIENT.DownloadString(this.URL); this.mRegex = new Regex("<link rel=\"shortcut icon\" href=\"http://images.habbo.com/habboweb/(.*?)/web-gallery/v2/favicon.ico\" type=\"image/vnd.microsoft.icon\" />", RegexOptions.Compiled); this.mMatch = this.mRegex.Match(HTML); return this.mMatch.Value.ToString().Substring(65, 40); } } }
Well, done! There you go RZ :)Code:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; namespace Webbuild_Updater_for_HabbuCMS { class Program { private static Mysql mSQL; private static string HOST, USER, PASS, DATA; private static uint PORT; private static bool MYSQL_CONNECTED = false; private static Thread _TRE; private static REGEX mRegex = new REGEX("http://habbo.de"); static void Main(string[] args) { Console.WriteLine("Habbo Webbuild Leaker\nProgrammiert von JNike in C#\nBenutzt MySQL, Regex und das .NET Framework"); Console.WriteLine("\n-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --"); Console.Write("\n[..] MySQL Host >> "); HOST = Console.ReadLine(); Console.Write("\n[.:] MySQL User >> "); USER = Console.ReadLine(); Console.Write("\n[::] MySQL Pass >> "); PASS = Console.ReadLine(); Console.Write("\n[:+] MySQL Datenbank >> "); DATA = Console.ReadLine(); Console.Write("\n[++] MySQL Port [3306] >> "); try { PORT = Convert.ToUInt32(Console.ReadLine()); } catch { } MYSQL_CONNECTED = StartMysqlConnection(); Console.WriteLine(Environment.NewLine); if (MYSQL_CONNECTED) { _TRE = new Thread(new ThreadStart(ExecuteUpdateSql)); _TRE.Start(); } Console.ReadKey(true); } private static bool StartMysqlConnection() { mSQL = new Mysql(HOST, USER, PASS, DATA, PORT); return mSQL.OpenMysqlConnection(); } private static void ExecuteUpdateSql() { while (true) { for (int i = 0; i <= 60; i++) { Thread.Sleep(1000); Console.WriteLine("Noch {0} Sekunden bis zum nächsten Update!", 60 - i); } if (MYSQL_CONNECTED) { mSQL.ExecuteQuery("UPDATE web_settings SET webbuild = '" + mRegex.ReturnWebbuild() + "'"); Console.WriteLine(" >> Update wurde ausgeführt -- " + mRegex.ReturnWebbuild() + " --"); } else Console.WriteLine(" [++] -- MYSQL DATENBANKVERBINDUNG NICHT VERBUNDEN!"); } } } }
Thanks, I would definitely goint to use it! :-)
No problem.
Just to know:
mSQL.ExecuteQuery("UPDATE web_settings SET webbuild = '" + mRegex.ReturnWebbuild() + "'");
Change the Query with your own table and row. If you've got problems doing this, just let me know how your table is named and your row is named and i'll do it for you.
Nice job I'll have a look at it.
Thanks, Facebook
Rest In Peace, To my dog Sparky. Never forgotten <3
Skype: Danny.runsnyc
msn: dannyrunsnyc@hotmail.com
This should be done web side, and every 60 seconds? Might be hard on the server, do it every hour or so :P
Regards, zJordan---------------------------------------I rep back. So do the wise thing, and rep me for 1 free rep back!
Regards, zJordan---------------------------------------I rep back. So do the wise thing, and rep me for 1 free rep back!
Every 24 hours would be best, it's not like Habbo update their webbuild every hour...
Hmmm. It's better when somebody can code it in his our Habbo Hotel private server. That would be very nice! Then your hotel server can automatically update every (let we say) 1 hour your web_build. I think it's easy to make?
Habbo won't remove their previous webbuild in at least 6 hours so why each minute?
What's the advantages of using this over the PHP version? :s
I don't know if this code is working, didn't test it but...PHP Code:using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using MySql.Data.MySqlClient;
using MySql.Data;
using System.Threading;
namespace Webbuild_Update
{
class Program
{
private static MysqlManager mSQL;
private static string HOST, USER, PASS, DATA;
private static string Webbuild = "";
private static bool MYSQL_CONNECTED = false;
private static Thread _TRE;
private static Updater mRegex = new Updater("http://habbo.de");
static void Main(string[] args)
{
Console.WriteLine("Booting up Habbo Webbuild Updater...");
Console.WriteLine("Starting MysqlManager :: ");
Console.Write("Mysql Host: "); HOST = Console.ReadLine();
Console.Write("Mysql User: "); USER = Console.ReadLine();
Console.Write("Mysql Password: "); PASS = Console.ReadLine();
Console.Write("Mysql Database: "); DATA = Console.ReadLine();
MysqlManager Manager = new MysqlManager(HOST, USER, PASS, DATA);
Webbuild = mRegex.ReturnWebbuild();
mSQL.ExecuteQuery("UPDATE web_settings SET webbuild = '" + mRegex.ReturnWebbuild() + "'");
MYSQL_CONNECTED = StartMysqlConnection();
Console.WriteLine(Environment.NewLine);
if (MYSQL_CONNECTED)
{
_TRE = new Thread(new ThreadStart(ExecuteUpdateSql));
_TRE.Start();
}
Console.ReadKey(true);
}
private static bool StartMysqlConnection()
{
mSQL = new MysqlManager(HOST, USER, PASS, DATA);
return mSQL.OpenMysqlConnection();
}
private static void ExecuteUpdateSql()
{
while (true)
{
for (int i = 0; i <= 60; i++)
{
Thread.Sleep(1000);
Console.WriteLine("{0} seconds to the next webbuild check", 60 - i);
}
if (MYSQL_CONNECTED)
{
if (Webbuild == mRegex.ReturnWebbuild())
Console.WriteLine("Allready downloaded the latest webbuild of Habbo");
else
{
mSQL.ExecuteQuery("UPDATE web_settings SET webbuild = '" + mRegex.ReturnWebbuild() + "'");
Console.WriteLine("Updated your Webbuild -- " + mRegex.ReturnWebbuild() + " --");
}
}
else
Console.WriteLine("MYSQL ERROR");
}
}
}
}
why don't save the webbuild in a string by starting the program ?
It runs a Query and it save it in a string.
Now the program checks Habbo's webbuild every minute.
If the checked webbuild == the Webbuild in the string, than it doesn't run the query.
Otherwise it runs the query..
Maybe better,
- Waves ~~