[Question] How to determine if a bg has started? menu

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 33
  1. #16
    guizmows's Avatar Banned
    Reputation
    57
    Join Date
    Feb 2008
    Posts
    414
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can check if you have the bg begin buff on you or not.

    [Question] How to determine if a bg has started?
  2. #17
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Tanaris4 View Post
    lua GetBattleGroundStatus

    Code:
    #define BGNone            0
    #define BGQueued        1
    #define BGWaiting        2
    #define BGActive        3
    That won't say if a bg has started or not, BattlegroundStatus is active whenever you are inside a bg;

    i like the idea of looking up gameobjects to check if it started or not, gonna
    go write some code for that now

  3. #18
    guizmows's Avatar Banned
    Reputation
    57
    Join Date
    Feb 2008
    Posts
    414
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    here is how I do :

    Code:
    bgStarted = !Me.HasBuff(44521);
    It's very easy.

  4. #19
    Tanaris4's Avatar Contributor Authenticator enabled
    Reputation
    148
    Join Date
    Oct 2008
    Posts
    646
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Nesox View Post
    That won't say if a bg has started or not, BattlegroundStatus is active whenever you are inside a bg;

    i like the idea of looking up gameobjects to check if it started or not, gonna
    go write some code for that now
    Ahh so not actually in the game? BGActive = you are in the battleground.

    Then just check to see if you have the Preparation buff, if you do, the BG isn't going on.
    https://tanaris4.com

  5. #20
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Tanaris4 View Post
    Ahh so not actually in the game? BGActive = you are in the battleground.

    Then just check to see if you have the Preparation buff, if you do, the BG isn't going on.
    isn't preparation only for the arena?

  6. #21
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Nesox View Post
    isn't preparation only for the arena?
    No, you don't notice all the warriors spamming battle shout? :P
    Hey, it compiles! Ship it!

  7. #22
    Pimpace's Avatar Member
    Reputation
    -4
    Join Date
    Sep 2009
    Posts
    55
    Thanks G/R
    1/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And how can we determine if bg has ended?

    I mean, do you have to wait those 2 minutes when bg has ended? You know when the scorewindow is up at the end. If you don't click the "leave battleground" button you stay in. (there is a 2m countdown right?) So the true question is; when didn't leave but bg has ended, BattleGroundStatus says: none? Or still active until you leave really?
    Last edited by Pimpace; 11-18-2009 at 03:23 PM.

  8. #23
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Pimpace View Post
    And how can we determine if bg has ended?
    Here is my translation of lua_GetBattlefieldWinner. Did this a half year ago, so don't blame me if I messed up.
    Just update it with the last binary:

    //hasBattlefieldEnded : 4bit-Integer, 0x01129344
    //battlefieldWinner: Double, 0x01129348

    Code:
    int SomeWoWClass::lua_getBattleFieldWinner(lua_State* L)
    {
      	double returnvalue;
    
    	if(hasBattlefieldEnded != 0)
      	{
        		returnvalue = battlefieldWinner;
    
        		if(returnvalue < 0)
    		{
          			returnvalue += 4294967296; //UINT_MAX
    		}
    
        		lua_pushNumber(L, returnvalue);
      	}
      	else
      	{
        		lua_pushNil(L);
      	}
    
      	return 1;
    }
    Hey, it compiles! Ship it!

  9. #24
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your addresses seem to be correct but your translation of the function seems to be a bit off.

    This one should be accurate:
    Code:
    int __cdecl Lua_GetBattlefieldWinner(void* pLuaState)
    {
      if (HasBattlefieldEnded)
      {
        LuaPushNumber(pLuaState, BattlefieldWinner);
      }
      else
      {
        LuaPushNil(pLuaState);
      }
      
      return 1;
    }

  10. #25
    flo8464's Avatar Active Member
    Reputation
    30
    Join Date
    Apr 2009
    Posts
    434
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, I know.
    Did it some time ago and had a strange style doing so I know later exactly what types those vars have etc.

    Funny that Hexrays displayed it to me as __thiscall, which makes absolutly no sense for a lua function.

    if(returnvalue < 0)
    {
    returnvalue += 4294967296; //UINT_MAX
    }
    So this is exactly doing...nothing? I guess I have to read a bit more about binary operations, compiler generated arithmetics and stuff.
    Especially as WoW treats so many numbers as double.

    I see, I need HexRays 1.1 .... but its just so damn expensive, so I got to live with my cracked 1.0 -.-
    Hey, it compiles! Ship it!

  11. #26
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The crap with "4.294967296e9" is the math required to convert an integer to a double. Sorry, I ommitted the casts in the code I posted.

    It would actually be more likely to look like this at the source level:
    LuaPushNumber(pLuaState, static_cast<double>(BattlefieldWinner));

    I'm about to go out so I don't have time to explain it, but you should be able to pull up some answers with the help of Google.

  12. #27
    Pimpace's Avatar Member
    Reputation
    -4
    Join Date
    Sep 2009
    Posts
    55
    Thanks G/R
    1/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by flo8464 View Post
    Here is my translation of lua_GetBattlefieldWinner. Did this a half year ago, so don't blame me if I messed up.
    Just update it with the last binary:

    //hasBattlefieldEnded : 4bit-Integer, 0x01129344
    //battlefieldWinner: Double, 0x01129348

    Code:
    int SomeWoWClass::lua_getBattleFieldWinner(lua_State* L)
    {
      	double returnvalue;
    
    	if(hasBattlefieldEnded != 0)
      	{
        		returnvalue = battlefieldWinner;
    
        		if(returnvalue < 0)
    		{
          			returnvalue += 4294967296; //UINT_MAX
    		}
    
        		lua_pushNumber(L, returnvalue);
      	}
      	else
      	{
        		lua_pushNil(L);
      	}
    
      	return 1;
    }
    Sorry if my question is lame, but do I need lua module injection to WoW if I want this to work? And if I do, can be doable without it?

  13. #28
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Pimpace View Post
    Sorry if my question is lame, but do I need lua module injection to WoW if I want this to work? And if I do, can be doable without it?
    last time i checked you needed to inject a cookie into wow and you can use all the secret winapi functions for reading memory!

  14. #29
    Pimpace's Avatar Member
    Reputation
    -4
    Join Date
    Sep 2009
    Posts
    55
    Thanks G/R
    1/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Nesox View Post
    last time i checked you needed to inject a cookie into wow and you can use all the secret winapi functions for reading memory!
    Hmmm...
    My goal would be if I can check bg's end. All this only by memory reading. Only need to determine its end, so is there somewhere a memory address I can read from?
    Last edited by Pimpace; 11-19-2009 at 09:17 AM.

  15. #30
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Pimpace View Post
    Hmmm...
    My goal would be if I can check bg's end. All this only by memory reading. Only need to determine its end, so is there somewhere a memory address I can read from?
    Did it ever cross your mind to open IDA or a simmiliar tool and take a look at where getBattleFieldWinner() fetches it's values?
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. [Question] How to determine whether the quest completed, after the quest has been turne
    By DawnFoods in forum WoW Bots Questions & Requests
    Replies: 1
    Last Post: 12-31-2016, 09:42 PM
  2. [C++ Script] [Question] How to determine Creature HP mode LFR / HEROIC / FLEXI
    By keivulan in forum WoW EMU Questions & Requests
    Replies: 0
    Last Post: 10-31-2014, 12:18 PM
  3. [Question]How to determine if a frame is shown
    By leather in forum WoW Memory Editing
    Replies: 5
    Last Post: 11-28-2009, 03:22 PM
  4. Question: How to change from priv. serv to blizzards?
    By Bridude in forum World of Warcraft General
    Replies: 5
    Last Post: 03-21-2007, 10:07 PM
All times are GMT -5. The time now is 03:55 PM. 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