Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Releases
Server Releases
Casino Bot
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Altercationz" data-source="post: 411272" data-attributes="member: 59038"><p>Hi,</p><p>Quick little release the idea was from a member on here i think [USER=72299]@Damien[/USER]. i just coded it.</p><p>This is my first bot so please do leave feedback / criticism below.</p><p>You <strong>will</strong> have to create the bot (furniture) itself as i don't do that.</p><p>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.</p><p>I don't offer support on this as you just add the class (<strong>don't</strong> forget to add it in your <strong>BotAIType.cs </strong>& <strong>BotUtility.cs</strong>)</p><p>Now that we have all that out of the way, here's the bot.</p><p>[CODE]</p><p>using System;</p><p>using System.Drawing;</p><p></p><p>using Plus.HabboHotel.GameClients;</p><p>using Plus.HabboHotel.Rooms.AI.Speech;</p><p>using Plus.Communication.Packets.Outgoing.Rooms.Chat;</p><p>using Plus.HabboHotel.Rooms.AI.Responses;</p><p>using Plus.Utilities;</p><p>using Plus.Database.Interfaces;</p><p></p><p>namespace Plus.HabboHotel.Rooms.AI.Types</p><p>{</p><p> class CasinoBot : BotAI</p><p> {</p><p> private int VirtualId;</p><p></p><p> public CasinoBot(int VirtualId)</p><p> {</p><p> this.VirtualId = VirtualId;</p><p> }</p><p></p><p> public override void OnSelfEnterRoom()</p><p> {</p><p> }</p><p></p><p> public override void OnSelfLeaveRoom(bool Kicked)</p><p> {</p><p> }</p><p></p><p> public override void OnUserEnterRoom(RoomUser User)</p><p> {</p><p> }</p><p></p><p></p><p> public override void OnUserLeaveRoom(GameClient Client)</p><p> {</p><p> }</p><p></p><p> public override void OnUserSay(RoomUser User, string Message)</p><p> {</p><p> if (User == null || User.GetClient() == null || User.GetClient().GetHabbo() == null)</p><p> return;</p><p></p><p> if (Gamemap.TileDistance(GetRoomUser().X, GetRoomUser().Y, User.X, User.Y) > 5)</p><p> return;</p><p></p><p> if (User.GetClient().GetHabbo().Trusted)</p><p> {</p><p> User.GetClient().SendWhisper("You cannot use this bot because you're not trusted!");</p><p> return;</p><p> }</p><p></p><p> string Item = Message.Split(' ')[5]; // split the item from the question</p><p> string Username = Message.Split(' ')[2]; //Does altercationz have a throne?</p><p></p><p> GameClient Target = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Message.Split(' ')[5]);</p><p> if (Target == null)</p><p> {</p><p> User.GetClient().SendWhisper("User is offline.");</p><p> return;</p><p> }</p><p></p><p> int Total = 0;</p><p> using (IQueryAdapter Adapter = PlusEnvironment.GetDatabaseManager().GetQueryReactor())</p><p> {</p><p> 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");</p><p> Adapter.AddParameter("userid", Target.GetHabbo().Id);</p><p> Adapter.AddParameter("item", Message.Split(' ')[5]);</p><p> Total = Adapter.getInteger();</p><p> }</p><p></p><p> if (Total >= 0)</p><p> {</p><p> User.GetClient().SendWhisper("The user " + Username + " has no " + Item + "'s!");</p><p> return;</p><p> }</p><p></p><p> GetRoomUser().Chat("The user " + Username + " has " + Total + " " + Item + "'s!", false, GetRoomUser().LastBubble);</p><p> }</p><p></p><p> public override void OnUserShout(RoomUser User, string Message)</p><p> {</p><p> }</p><p></p><p> public override void OnTimerTick()</p><p> {</p><p> }</p><p> }</p><p>}[/CODE]</p><p>Enjoy.</p></blockquote><p></p>
[QUOTE="Altercationz, post: 411272, member: 59038"] Hi, Quick little release the idea was from a member on here i think [USER=72299]@Damien[/USER]. i just coded it. This is my first bot so please do leave feedback / criticism below. You [B]will[/B] 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 ([B]don't[/B] forget to add it in your [B]BotAIType.cs [/B]& [B]BotUtility.cs[/B]) 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() { } } }[/CODE] Enjoy. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
Server Releases
Casino Bot
Top