Altercationz
:)
Hi,
Quick little release the idea was from a member on here i think @Damien. i just coded it.
This is my first bot so please do leave feedback / criticism below.
You will have to create the bot (furniture) itself as i don't do that.
I have it setup to only work if you're on the trusted system which will be different for your emulator so set it up however you wish.
I don't offer support on this as you just add the class (don't forget to add it in your BotAIType.cs & BotUtility.cs)
Now that we have all that out of the way, here's the bot.
Enjoy.
Quick little release the idea was from a member on here i think @Damien. i just coded it.
This is my first bot so please do leave feedback / criticism below.
You will have to create the bot (furniture) itself as i don't do that.
I have it setup to only work if you're on the trusted system which will be different for your emulator so set it up however you wish.
I don't offer support on this as you just add the class (don't forget to add it in your BotAIType.cs & BotUtility.cs)
Now that we have all that out of the way, here's the bot.
Code:
using System;
using System.Drawing;
using Plus.HabboHotel.GameClients;
using Plus.HabboHotel.Rooms.AI.Speech;
using Plus.Communication.Packets.Outgoing.Rooms.Chat;
using Plus.HabboHotel.Rooms.AI.Responses;
using Plus.Utilities;
using Plus.Database.Interfaces;
namespace Plus.HabboHotel.Rooms.AI.Types
{
class CasinoBot : BotAI
{
private int VirtualId;
public CasinoBot(int VirtualId)
{
this.VirtualId = VirtualId;
}
public override void OnSelfEnterRoom()
{
}
public override void OnSelfLeaveRoom(bool Kicked)
{
}
public override void OnUserEnterRoom(RoomUser User)
{
}
public override void OnUserLeaveRoom(GameClient Client)
{
}
public override void OnUserSay(RoomUser User, string Message)
{
if (User == null || User.GetClient() == null || User.GetClient().GetHabbo() == null)
return;
if (Gamemap.TileDistance(GetRoomUser().X, GetRoomUser().Y, User.X, User.Y) > 5)
return;
if (User.GetClient().GetHabbo().Trusted)
{
User.GetClient().SendWhisper("You cannot use this bot because you're not trusted!");
return;
}
string Item = Message.Split(' ')[5]; // split the item from the question
string Username = Message.Split(' ')[2]; //Does altercationz have a throne?
GameClient Target = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Message.Split(' ')[5]);
if (Target == null)
{
User.GetClient().SendWhisper("User is offline.");
return;
}
int Total = 0;
using (IQueryAdapter Adapter = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
{
Adapter.SetQuery("SELECT COUNT(*) FROM items i JOIN furniture f ON (i.base_item = f.id) WHERE f.public_name = @item AND i.user_id = @userid");
Adapter.AddParameter("userid", Target.GetHabbo().Id);
Adapter.AddParameter("item", Message.Split(' ')[5]);
Total = Adapter.getInteger();
}
if (Total >= 0)
{
User.GetClient().SendWhisper("The user " + Username + " has no " + Item + "'s!");
return;
}
GetRoomUser().Chat("The user " + Username + " has " + Total + " " + Item + "'s!", false, GetRoomUser().LastBubble);
}
public override void OnUserShout(RoomUser User, string Message)
{
}
public override void OnTimerTick()
{
}
}
}
Last edited: