Plus Emu Rev 2, Wired User Says Keyword, slight improvement.

Results 1 to 5 of 5
  1. #1
    Member Thewicard is offline
    MemberRank
    Nov 2011 Join Date
    NorwayLocation
    92Posts

    Plus Emu Rev 2, Wired User Says Keyword, slight improvement.

    Just to be kind I decided to release a small part of the garbage I've coded.

    What is improved?
    Well, when adding this the "User says keyword" works pretty much like the one of Habbo. Ignores Lower/Uppercase letter differences. You are able to use space in the keyword. And it gets detected if the keyword is within a sentence.

    Example:

    Keyword is: Easter bunny

    Works: easter bunny, EaStEr BuNnY, etc. And 1gsdsd23Easter bunny1gwsdasf23 also works.

    Replace SaysKeyword.cs with this:
    PHP Code:
    using Silverwave.HabboHotel.Items;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    namespace 
    Silverwave.HabboHotel.Rooms.Wired.Handlers.Triggers
    {
        public class 
    SaysKeyword WiredItem
        
    {
            
    #region Fields
            
    private WiredItemType mType WiredItemType.TriggerUserSaysKeyword;
            private 
    Room mRoom;
            private 
    RoomItem mItem;
            private 
    string mKeyword;
            private 
    bool mOwner;
            
    #endregion

            #region Properties
            
    public WiredItemType Type
            
    {
                
    get { return mType; }
            }
            public 
    RoomItem Item
            
    {
                
    get { return mItem; }
                
    set mItem value; }
            }
            public 
    Room Room
            
    {
                
    get { return mRoom; }
            }
            public List<
    RoomItemItems
            
    {
                
    get { return new List<RoomItem>(); }
                
    set { }
            }
            public 
    int Delay
            
    {
                
    get { return 0; }
                
    set { }
            }
            public 
    string OtherString
            
    {
                
    get { return mKeyword; }
                
    set mKeyword value; }
            }
            public 
    bool OtherBool
            
    {
                
    get { return true; }
                
    set { }
            }
            public 
    string ItemsList
            
    {
                
    get { return ""; }
                
    set { }
            }
            
    #endregion

            #region Constructors
            
    public SaysKeyword(RoomItem ItemRoom Room)
            {
                
    this.mItem Item;
                
    this.mRoom Room;
                
    this.mKeyword "";
                
    this.mOwner false;
            }
            
    #endregion

            #region Methods
            
    public bool Execute(params object[] Stuff)
            {
                
    RoomUser User = (RoomUser)Stuff[0];
                
    string Message = (string)Stuff[1];

                
    bool Correct false;

                if (
    string.IsNullOrEmpty(mKeyword))
                {
                    return 
    false;
                }
                foreach (
    string Word in Message.Split(' '))
                {
                    if (
    Message.ToLower().Contains(mKeyword.ToLower()))
                    {
                        
    Correct true;
                    }
                }
                if (!
    Correct)
                {
                    return 
    false;
                }

                List<
    WiredItemConditions mRoom.GetWiredHandler().GetConditions(this);
                List<
    WiredItemEffects mRoom.GetWiredHandler().GetEffects(this);

                if (
    Conditions.Count 0)
                {
                    foreach (
    WiredItem Condition in Conditions)
                    {
                        if (!
    Condition.Execute(User))
                        {
                            return 
    false;
                        }
                        
    mRoom.GetWiredHandler().OnEvent(Condition);
                    }
                }

                if (
    Effects.Count 0)
                {
                    foreach (
    WiredItem Effect in Effects)
                    {
                        if (!
    Effect.Execute(UsermType))
                        {
                            continue;
                        }
                        
    mRoom.GetWiredHandler().OnEvent(Effect);
                    }
                }
                
    User.GetClient().SendWhisper(Message);
                
    //Room.GetWiredHandler().OnEvent(this);
                
    return true;
            }
            
    #endregion
        
    }



  2. #2
    Apprentice jackmoore is offline
    MemberRank
    Feb 2014 Join Date
    10Posts

    Re: Plus Emu Rev 2, Wired User Says Keyword, slight improvement.

    I did that and it still didn't work, unless i did something wrong >_>

  3. #3
    Valued Member VabboWorld is offline
    MemberRank
    Oct 2013 Join Date
    FranceLocation
    124Posts

    Re: Plus Emu Rev 2, Wired User Says Keyword, slight improvement.

    Fixed *_*

  4. #4
    Account Upgraded | Title Enabled! YoWesty is offline
    MemberRank
    Oct 2012 Join Date
    285Posts

    Re: Plus Emu Rev 2, Wired User Says Keyword, slight improvement.

    Heres a better version
    PHP Code:
    using HabboEmulator.HabboHotel.Items;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    namespace 
    HabboEmulator.HabboHotel.Rooms.Wired.Handlers.Triggers
    {
        public class 
    SaysKeyword WiredItem
        
    {

            public 
    WiredSaveType SaveType
            
    {
                
    get { return WiredSaveType.TextBool; }
            }

            
    #region Fields
            
    private WiredItemType mType WiredItemType.TriggerUserSaysKeyword;
            private 
    Room mRoom;
            private 
    RoomItem mItem;
            private 
    string mKeyword;
            private 
    bool mOwner;
            
    #endregion

            #region Properties
            
    public WiredItemType Type
            
    {
                
    get { return mType; }
            }
            public 
    RoomItem Item
            
    {
                
    get { return mItem; }
                
    set mItem value; }
            }
            public 
    Room Room
            
    {
                
    get { return mRoom; }
            }
            public List<
    RoomItemItems
            
    {
                
    get { return new List<RoomItem>(); }
                
    set { }
            }
            public 
    int Delay
            
    {
                
    get { return 0; }
                
    set { }
            }
            public 
    string OtherString
            
    {
                
    get { return mKeyword; }
                
    set mKeyword value; }
            }
            public 
    bool OtherBool
            
    {
                
    get { return mOwner; }
                
    set mOwner value; }
            }
            
    #endregion

            #region Constructors
            
    public SaysKeyword(RoomItem ItemRoom Room)
            {
                
    this.mItem Item;
                
    this.mRoom Room;
                
    this.mKeyword "";
                
    this.mOwner false;
            }
            
    #endregion

            #region Methods
            
    public bool Execute(params object[] Stuff)
            {
                
    RoomUser User = (RoomUser)Stuff[0];
                
    string Message = (string)Stuff[1];

                
    bool Correct false;

                if (
    string.IsNullOrEmpty(mKeyword))
                {
                    return 
    false;
                }

                if (
    Message.ToLower().Contains(mKeyword.ToLower()))
                {
                    List<
    WiredItemConditions mRoom.GetWiredHandler().GetConditions(this);
                    List<
    WiredItemEffects mRoom.GetWiredHandler().GetEffects(this);

                    
    bool cancontinue true;
                    if (
    Conditions.Count 0)
                    {
                        foreach (
    WiredItem Condition in Conditions)
                        {
                            
    mRoom.GetWiredHandler().OnEvent(Condition);
                            if (!
    Condition.Execute(User))
                            {
                                
    cancontinue false;
                            }
                        }
                    }

                    if (
    Effects.Count && cancontinue)
                    {
                        foreach (
    WiredItem Effect in Effects)
                        {
                            if (!
    Effect.Execute(UserType))
                            {
                                continue;
                            }
                            
    mRoom.GetWiredHandler().OnEvent(Effect);
                        }
                    }

                    
    Room.GetWiredHandler().OnEvent(this);
                    return 
    true;
                }

                return 
    false;
            }
            
    #endregion
        
    }

    Just change HabboEmulator to Silverwave or w.e

  5. #5
    Proficient Member SubDababa is offline
    MemberRank
    Jan 2014 Join Date
    191Posts

    Re: Plus Emu Rev 2, Wired User Says Keyword, slight improvement.

    Why did you make a new thread for this?



Advertisement