MercuryEmu Command.

Brad

Well-Known Member
Jun 5, 2012
2,319
992
Noting much but just thought I'd Release it.
PHP:
case "welcome":
                        if (!this.Session.GetHabbo().GotCommand("commands"))
                        {
                            return false;//2D3B;
                        }
                        if ((Params[1] != null))
                        {
                            string username = null;
                            GameClient client6 = null;
                            username = Params[1];
                            client6 = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(username);
                            Room room42 = client6.GetHabbo().CurrentRoom;
                            if (client6 == null)
                            {
                                this.Session.SendNotif("User could not be found.");
                                return true;
                            }

                            client6.SendWhisper("Welcome To Buzz Hotel, From " + this.Session.GetHabbo().Username);
                            return true;//2D3B;
                        }
                        this.Session.SendNotif("You left something empty.");
                        return true;
Just change Plus to Mercury. yes I've renamed Mercury back to it's original name.
only the user you sent it to will see it.
Command line:
:welcome (username)
Screenshot:

Ok got a new command, :twitch
8aac8d6d47dfb059e1f94183b19c50f5.png


PHP:
case "twitch":
                    case "stream":
                    case "streamers":
              
                        {
                            using (IQueryAdapter id = PlusEnvironment.GetDatabaseManager().getQueryreactor())
                            {

                                StringBuilder builder = new StringBuilder();
                                builder.Append("Hey, " + this.Session.GetHabbo().Username + " Here is a list of Twitch Streamers, it will be Very Apreciated if you Follow these :D.\n");
                                builder.Append("\n");
                                id.setQuery("SELECT id,username,twitch FROM twitch_users");                         
                                id.addParameter("user", id);
                                DataRow row3 = id.getRow();
                                builder.Append("Streamer:\n");
                                builder.Append("Twitch Username: "+row3[2]+" Twitch Link = http://twitch.tv/ "+row3[2]+ "\n");
                                builder.Append("in-game Username: " + row3[1] + "\n");
                                builder.Append("\n");
                                builder.Append("\n");

                                builder.Append("Do you stream on twitch & want to show here? Contact Brad in-game.\n");
                                this.Session.SendNotifWithScroll(builder.ToString());

                          
                            }
                      
                        }
                        return true;
Code:
DROP TABLE IF EXISTS `twitch_users`;
CREATE TABLE `twitch_users` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(550) DEFAULT NULL,
  `twitch` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of twitch_users
-- ----------------------------
INSERT INTO `twitch_users` VALUES ('1', 'Brad', 'Cappercom');

You could altar this for Fansites if your hotel Promotes them, This is yet an easy and quick command,



PHP:
case "fansites":            
                        {
                            using (IQueryAdapter id = PlusEnvironment.GetDatabaseManager().getQueryreactor())
                            {

                                StringBuilder builder = new StringBuilder();
                                builder.Append("Hey, " + Session.GetHabbo().Username + " Here is a list of Our Official Fansites, it will be Very Apreciated if you check then out :D.\n");
                                 builder.Append("\n");
                            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().getQueryreactor())
                           {
                                                        
               dbClient.setQuery("SELECT `name`,`username`,`link` FROM `fansites`");
                 DataTable GetFansites = dbClient.getTable();

                  if (GetFansites != null)
    {
        foreach (DataRow Row in GetFansites.Rows)
        {
            builder.Append("Fansite:\n");
            builder.Append("Fansite Name: " + Row["name"] + " Fansite Link = " + Row["link"] + "\n");
            builder.Append("in-game Username: " + Row["username"] + "\n");
            builder.Append("\n");
        }
    }
    else
    {
        builder.Append("There are currently no Fansites.\n");
       
    }
}

builder.Append("Want yours to show here? Message (your username) in-game to sort this out! :D\n");
Session.SendNotifWithScroll(builder.ToString());

                          
                            }
                      
                        }
                        return true;
Code:
CREATE TABLE `fansites` (
  `name` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(550) DEFAULT NULL,
  `link` varchar(255) DEFAULT NULL,

) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
 
Last edited:

Brad

Well-Known Member
Jun 5, 2012
2,319
992
Not very good since the user could be spammed with alerts buddy :)
It's set as a whisper xD So that wouldn't happen. xD

look
client6.SendWhisper("Welcome To Buzz Hotel, From " + this.Session.GetHabbo().Username);
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,194
3,901
Nice share, though I see one issue. You should check if "client6" is null before declaring the Room instance. You also don't really need to assign the username variable, and "room42", though if I were you, I would use it to check if they're in the same room.
 

Brad

Well-Known Member
Jun 5, 2012
2,319
992
Nice share, though I see one issue. You should check if "client6" is null before declaring the Room instance. You also don't really need to assign the username variable, and "room42", though if I were you, I would use it to check if they're in the same room.
thanks, yeah It was something quick as users Wanted it because there lazy to type it themselfs, I'll work on that now & thanks :)
 

teunc

New Member
Sep 3, 2011
6
0
Small question, can you make this so that the user detonating the command says: *Welcomes %USER% to the hotel*
 

Brad

Well-Known Member
Jun 5, 2012
2,319
992
Small question, can you make this so that the user detonating the command says: *Welcomes %USER% to the hotel*
Change
Code:
 client6.SendWhisper("Welcome To Buzz Hotel, From " + this.Session.GetHabbo().Username);
to
Code:
 client6.SendWhisper("Welcomes " + Params[1] + "to (hotelname)");
 

teunc

New Member
Sep 3, 2011
6
0
Thanks for such a quick reply, but I meant like the detonating user SAYS it, so that everyone can see it. That'll be great
 

Brad

Well-Known Member
Jun 5, 2012
2,319
992
Change
Code:
 client6.SendWhisper("Welcome To Buzz Hotel, From " + this.Session.GetHabbo().Username);
to
Code:
 client6.SendWhisper("Welcomes " + Params[1] + "to (hotelname)");
try this
Code:
client6.SendChatMessage("Welcomes " + Params[1] + "to (hotelname)");
 

Brad

Well-Known Member
Jun 5, 2012
2,319
992
try thus
Code:
SendChatMessage(this.Session, "Welcomes" + Params[1] +" to (hotelname)");
 

Jaden

not so active
Aug 24, 2014
886
263
Probably a pointless command. sending a whisper you can manually send a whisper what if you like Send an alert and deduct some of the users credits and package it to the new user
 

Brad

Well-Known Member
Jun 5, 2012
2,319
992
Probably a pointless command. sending a whisper you can manually send a whisper what if you like Send an alert and deduct some of the users credits and package it to the new user
It's for the lets just say "lazy" users. I said it's nothing much, alot of users Requested me to add it so i did. 
Ok got a new command, :twitch
8aac8d6d47dfb059e1f94183b19c50f5.png


case "twitch":
case "stream":
case "streamers":

{
using (IQueryAdapter id = PlusEnvironment.GetDatabaseManager().getQueryreactor())
{

StringBuilder builder = new StringBuilder();
builder.Append("Hey, " + this.Session.GetHabbo().Username + " Here is a list of Twitch Streamers, it will be Very Apreciated if you Follow these :D.\n");
builder.Append("\n");
id.setQuery("SELECT id,username,twitch FROM twitch_users");
id.addParameter("user", id);
DataRow row3 = id.getRow();
builder.Append("Streamer:\n");
builder.Append("Twitch Username: "+row3[2]+" Twitch Link = "+row3[2]+ "\n");
builder.Append("in-game Username: " + row3[1] + "\n");
builder.Append("\n");
builder.Append("\n");

builder.Append("Do you stream on twitch & want to show here? Contact Brad in-game.\n");
this.Session.SendNotifWithScroll(builder.ToString());


}

}
return true;
Code:
DROP TABLE IF EXISTS `twitch_users`;
CREATE TABLE `twitch_users` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(550) DEFAULT NULL,
  `twitch` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of twitch_users
-- ----------------------------
INSERT INTO `twitch_users` VALUES ('1', 'Brad', 'Cappercom');

You could altar this for Fansites if your hotel Promotes them, This is yet an easy and quick command,
 

Jerry

not rly active lol
Jul 8, 2013
1,956
522
That twitch command could cause you higher MySQL data being sent as you're using a query as users can spam it. Just saying.
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,194
3,901

Your problem there is that you'll only ever have one result. Also, you should check this line:
PHP:
id.addParameter("user", id);
You have no error because the addParameter void requires an object(which you passed through), but you never use the "user" parameter, and have no reason to do it like that.

Here is a little advice:

PHP:
StringBuilder builder = new StringBuilder();
builder.Append("Hey, " + Session.GetHabbo().Username + " Here is a list of Twitch Streamers, it will be Very Apreciated if you Follow these :D.\n");
builder.Append("\n");
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().getQueryreactor())
{
    //I removed the `id` column as it seemed you didn't use it, maybe ORDER BY?
    dbClient.setQuery("SELECT `username`,`twitch` FROM `twitch_users`");
    DataTable GetStreamers = dbClient.getTable();//Fetch the streamers.

    if (GetStreamers != null)//Check if there are any streamers.
    {
        foreach (DataRow Row in GetStreamers.Rows)//Iterate the rows, and append each streamer.
        {
            builder.Append("Streamer:\n");
            builder.Append("Twitch Username: " + Row["Twitch"] + " Twitch Link = http://twitch.tv/ " + Row["Twitch"] + "\n");
            builder.Append("in-game Username: " + Row["username"] + "\n");
            builder.Append("\n");
        }
    }
    else
    {
        //This would be a nice place to append a string saying there are no streamers.
    }
}

builder.Append("Do you stream on twitch & want to show here? Contact Brad in-game.\n");
Session.SendNotifWithScroll(builder.ToString());

Good job though, and keep it up. :p
 

Jaden

not so active
Aug 24, 2014
886
263
That twitch command could cause you higher MySQL data being sent as you're using a query as users can spam it. Just saying.
Don't use mySQL at all just use a Params for the last bit after "/" but if you want to display their username.
make a field called public string tUser; in gethabbo you can use a query for selecting the username from the database because habbo.cs is the session that logs whe the user logs in and logs out
 

Brad

Well-Known Member
Jun 5, 2012
2,319
992
Your problem there is that you'll only ever have one result. Also, you should check this line:
PHP:
id.addParameter("user", id);
You have no error because the addParameter void requires an object(which you passed through), but you never use the "user" parameter, and have no reason to do it like that.

Here is a little advice:

PHP:
StringBuilder builder = new StringBuilder();
builder.Append("Hey, " + Session.GetHabbo().Username + " Here is a list of Twitch Streamers, it will be Very Apreciated if you Follow these :D.\n");
builder.Append("\n");
using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().getQueryreactor())
{
    //I removed the `id` column as it seemed you didn't use it, maybe ORDER BY?
    dbClient.setQuery("SELECT `username`,`twitch` FROM `twitch_users`");
    DataTable GetStreamers = dbClient.getTable();//Fetch the streamers.

    if (GetStreamers != null)//Check if there are any streamers.
    {
        foreach (DataRow Row in GetStreamers.Rows)//Iterate the rows, and append each streamer.
        {
            builder.Append("Streamer:\n");
            builder.Append("Twitch Username: " + Row["Twitch"] + " Twitch Link = http://twitch.tv/ " + Row["Twitch"] + "\n");
            builder.Append("in-game Username: " + Row["username"] + "\n");
            builder.Append("\n");
        }
    }
    else
    {
        //This would be a nice place to append a string saying there are no streamers.
    }
}

builder.Append("Do you stream on twitch & want to show here? Contact Brad in-game.\n");
Session.SendNotifWithScroll(builder.ToString());

Good job though, and keep it up. :p
Thankyou Very Appreciated :D I will Start to use it like that from now :D :)
 

Ecko1223

Member
Feb 28, 2013
344
43
It's for the lets just say "lazy" users. I said it's nothing much, alot of users Requested me to add it so i did. 
Ok got a new command, :twitch
8aac8d6d47dfb059e1f94183b19c50f5.png


case "twitch":
case "stream":
case "streamers":

{
using (IQueryAdapter id = PlusEnvironment.GetDatabaseManager().getQueryreactor())
{

StringBuilder builder = new StringBuilder();
builder.Append("Hey, " + this.Session.GetHabbo().Username + " Here is a list of Twitch Streamers, it will be Very Apreciated if you Follow these :D.\n");
builder.Append("\n");
id.setQuery("SELECT id,username,twitch FROM twitch_users");
id.addParameter("user", id);
DataRow row3 = id.getRow();
builder.Append("Streamer:\n");
builder.Append("Twitch Username: "+row3[2]+" Twitch Link = "+row3[2]+ "\n");
builder.Append("in-game Username: " + row3[1] + "\n");
builder.Append("\n");
builder.Append("\n");

builder.Append("Do you stream on twitch & want to show here? Contact Brad in-game.\n");
this.Session.SendNotifWithScroll(builder.ToString());


}

}
return true;
Code:
DROP TABLE IF EXISTS `twitch_users`;
CREATE TABLE `twitch_users` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(550) DEFAULT NULL,
  `twitch` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of twitch_users
-- ----------------------------
INSERT INTO `twitch_users` VALUES ('1', 'Brad', 'Cappercom');

You could altar this for Fansites if your hotel Promotes them, This is yet an easy and quick command,

Any chance you could make this for phoenix? That'd be cool
 

Users who are viewing this thread

Top