GetLocalizedText and C++ menu

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 32
  1. #16
    Shynd's Avatar Contributor
    Reputation
    97
    Join Date
    May 2008
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Name your variables something unique; how many variables named 'count' do you think are referenced in all of the Blizzard UI and other AddOns you have installed and why do you think that GetLocalizedText("count") is going to return YOUR count instead of one of the dozens of others that are probably being used?

    GetLocalizedText and C++
  2. #17
    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 Shynd View Post
    Name your variables something unique; how many variables named 'count' do you think are referenced in all of the Blizzard UI and other AddOns you have installed and why do you think that GetLocalizedText("count") is going to return YOUR count instead of one of the dozens of others that are probably being used?
    Thanks for your reply.

    Well...

    1.) Tried it with iiitemcccounttt as varname .. .doesn't work, too.
    2.) Like I said, ingame as

    /script count = GetItemCount(6256)
    /script print(count);

    It works :/

  3. #18
    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)
    Apologize for Double-posting.

    Anyone got an idea?

  4. #19
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could write a stub function that returns the address of the string and just call that. You'd have to register a lua function though(patch the protection check). This is probably similar to what GetLocalizedText does but w/e. Actually, you could just have an injected function that doesn't have to be registered that just pops a var off the lua stack and returns it.

  5. #20
    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 lanman92 View Post
    You could write a stub function that returns the address of the string and just call that. You'd have to register a lua function though(patch the protection check). This is probably similar to what GetLocalizedText does but w/e. Actually, you could just have an injected function that doesn't have to be registered that just pops a var off the lua stack and returns it.
    Well, GetLocalisedText works fine.
    The problem is using lua-functions with arguments with DoString.
    I really don't know why they fail..well, print() works for some reasons.

  6. #21
    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)
    Originally Posted by flo8464 View Post
    Well, GetLocalisedText works fine.
    The problem is using lua-functions with arguments with DoString.
    I really don't know why they fail..well, print() works for some reasons.

    Just because your post is a tad unclear and I don't want people to be confused.

    Lua functions with arguments work fine with DoString. Your code is screwed.

  7. #22
    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)
    Much to screw?

    Code:
    typedef void  (__cdecl *DoLuaStringPtr)(const char* lString,const char* lString2, void* luastate);
    DoLuaStringPtr	 DoLuaString = reinterpret_cast<DoLuaStringPtr>(0x49AAB0);
    
    DoLuaString("print(GetItemCount(6256))", "print(GetItemCount(6256))", NULL);

  8. #23
    ramey's Avatar Member
    Reputation
    45
    Join Date
    Jan 2008
    Posts
    320
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have zero problems using DoString.

  9. #24
    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 ramey View Post
    I have zero problems using DoString.
    You are doing it like me ?

  10. #25
    ramey's Avatar Member
    Reputation
    45
    Join Date
    Jan 2008
    Posts
    320
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by flo8464 View Post
    You are doing it like me ?
    I used to, but at the moment I am creating my own DoString macro

    edit: For some functions are you just not escaping your quotes? :|
    Last edited by ramey; 07-02-2009 at 10:28 AM.

  11. #26
    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 ramey View Post
    I used to, but at the moment I am creating my own DoString macro

    edit: For some functions are you just not escaping your quotes? :|
    Where should I escape quotes if the only ones I use are those to tell the compiler its a string ?
    And I don't get what you mean when you say you create your own macro? There is nothing more comfortable than a function pointer...

  12. #27
    ramey's Avatar Member
    Reputation
    45
    Join Date
    Jan 2008
    Posts
    320
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by flo8464 View Post
    Where should I escape quotes if the only ones I use are those to tell the compiler its a string ?
    And I don't get what you mean when you say you create your own macro? There is nothing more comfortable than a function pointer...
    For example DoString("message(\"lol\")", "message(\"lol\")", NULL);

    ...

    Lua_DoString is a macro itself in lua, you might want to have a look at the lua source sometime. It is a macro of a few functions, but I create my own macro.

  13. #28
    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 ramey View Post
    For example DoString("message(\"lol\")", "message(\"lol\")", NULL);

    ...

    Lua_DoString is a macro itself in lua, you might want to have a look at the lua source sometime. It is a macro of a few functions, but I create my own macro.

    I know how its implemented in Lua (Combining loadstring and pcall) , using lua for my scripting in c++ applications for 1 year now

    Back to topic: Did you use DoString() like I posted here or different? I really cant figure out whats wrong ...

  14. #29
    ramey's Avatar Member
    Reputation
    45
    Join Date
    Jan 2008
    Posts
    320
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have used it like that before. What exactly is the problem?

  15. #30
    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 ramey View Post
    I have used it like that before. What exactly is the problem?
    GetItemCount(6256) returns zero if used by DoString() --> wrong
    GetItemCount(6256) returns one if used as "\script xxx" in WoW-chatbox --> correct

    I also can't use all other Lua-Functions with aguments ...except print().

    That doesn't make sense to me.

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Above and beyond Orgrimmar
    By Matt in forum World of Warcraft Exploits
    Replies: 3
    Last Post: 12-30-2006, 08:37 PM
  2. Recipes.. and their locations
    By Matt in forum World of Warcraft Guides
    Replies: 4
    Last Post: 12-03-2006, 08:21 AM
  3. Farming Bijous and Coins in ZG
    By Matt in forum World of Warcraft Guides
    Replies: 1
    Last Post: 11-02-2006, 06:48 PM
  4. 8 World of Warcraft Guide Packs (Gold, Profs and Skills)
    By Matt in forum World of Warcraft Guides
    Replies: 17
    Last Post: 09-23-2006, 10:53 AM
  5. WoWGlider and GALB Botting Locations
    By Matt in forum World of Warcraft Bots and Programs
    Replies: 14
    Last Post: 04-11-2006, 08:01 PM
All times are GMT -5. The time now is 02:11 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