[Question] C# Syntax menu

User Tag List

Results 1 to 4 of 4
  1. #1
    Syltex's Avatar Sergeant Major
    Reputation
    23
    Join Date
    Jul 2010
    Posts
    174
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Question] C# Syntax

    Hey just a quick question, im not programming in C# (using AutoIt :O )
    So the question: I went and studied some old bots thats written in c# and i saw a instersting function:

    Code:
          /// <summary>
            /// Returns True if unit is in combat, else False.
            /// </summary>
            public Boolean InCombat
            {
                get
                {
                    return (((Memory.ReadUInt(Memory.ReadUInt(this.BaseAddress + (uint)Resources.Offsets.InCombat.Offset1) + (uint)Resources.Offsets.InCombat.Offset2) >> (int)Resources.Offsets.InCombat.Mask) & 1) != 0);
                }
            }
    What does the red text mean?

    [Question] C# Syntax
  2. #2
    l0l1dk's Avatar Elite User

    Reputation
    499
    Join Date
    Sep 2010
    Posts
    342
    Thanks G/R
    1/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't have hardly any experience with C#, but I think that the red text is the variable that whether you are in combat or not is stored in, and if you are then the function returns 1.

  3. #3
    The-Eradicator's Avatar Contributor

    Reputation
    149
    Join Date
    May 2007
    Posts
    829
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's a right shift.
    The most beautiful thing we can experience is the mysterious. It is the source of all true art and all science. He to whom this emotion is a stranger, who can no longer pause to wonder and stand rapt in awe, is as good as dead: his eyes are closed.
    Albert Einstein

  4. #4
    Syltex's Avatar Sergeant Major
    Reputation
    23
    Join Date
    Jul 2010
    Posts
    174
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by The-Eradicator View Post
    It's a right shift.
    So if you look it in as a math problem it would look like this : ?
    Code:
    (InCombat.Offset1 + InCombat.Offset2) / InCombat.Mask


    EDIT1:
    Found the solution by your help

    Ops are << and >>.
    * n << k = n * 2^k
    * n >> k = n / 2^k
    Last edited by Syltex; 03-03-2011 at 06:09 PM.

Similar Threads

  1. [Question] What is the syntax for Gm Level 2?
    By mafiaboy in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 12-02-2007, 11:12 AM
  2. Model Changing Question
    By MasterYuke in forum World of Warcraft General
    Replies: 6
    Last Post: 09-17-2006, 09:56 PM
  3. Sorry..newb mail question
    By nolbishop in forum World of Warcraft General
    Replies: 2
    Last Post: 06-07-2006, 07:21 PM
  4. Question..
    By janzi9 in forum Community Chat
    Replies: 3
    Last Post: 04-02-2006, 10:20 AM
  5. A GALB question
    By bassman in forum World of Warcraft General
    Replies: 4
    Last Post: 03-28-2006, 09:49 AM
All times are GMT -5. The time now is 01:59 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search