Script_SetSendMailMoney Help menu

Shout-Out

User Tag List

Results 1 to 8 of 8
  1. #1
    oldmanofmen's Avatar Member
    Reputation
    12
    Join Date
    Jan 2010
    Posts
    104
    Thanks G/R
    4/3
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Script_SetSendMailMoney Help

    Hello, for the bot I'm working on getting it to send mail. For this I need to use this function to get the gold sent from the botted character to a bot banker character.

    The function's rebased address is: 0x560FF4
    This function takes 1 argument which I am assuming is the gold value.

    I am trying to call it like this:

    push eax
    mov eax, Base + 0x560FF4
    call eax
    retn

    Since there are no examples of this function being called within the client does anyone have any idea how this function is called correctly?
    Last edited by oldmanofmen; 07-26-2013 at 10:03 PM.

    Script_SetSendMailMoney Help
  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)
    It's a Lua C function. The argument is the Lua state. The function retrieves its arguments from Lua's stack when it's called.

    The easiest way to call it is to use FrameScript::ExecuteBuffer or a similar function to run a Lua string which calls it.

  3. #3
    Master674's Avatar Elite User
    Reputation
    487
    Join Date
    May 2008
    Posts
    578
    Thanks G/R
    2/23
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could call it like that:

    Code:
    lua_getglobal(L, "SetSendMailMoney"); // pushes SetSendMailMoney onto the stack (@ -2)
    lua_pushinteger(L, amount); // push argument (stack @ -1)
    lua_pcall(L, 1, 0, 0);// calls the function just below the number of argument (1) from the top of the stack (= -2)
    Last edited by Master674; 07-27-2013 at 07:32 AM.

  4. #4
    SKU's Avatar Contributor
    Reputation
    306
    Join Date
    May 2007
    Posts
    565
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Master674 View Post
    You could call it like that:

    Code:
    lua_getglobal(L, "SetSendMailMoney"); // pushes SetSendMailMoney onto the stack (@ -2)
    lua_pushinteger(L, amount); // push argument (stack @ -1)
    lua_pcall(L, 1, 0, 0);// calls the function just below the number of argument (1) from the top of the stack (= -2)
    If it fails (unlikely, seeing as the parameter is correct), you might want to pop the error message off the stack.

    Code:
    // Version: 5.3.0 17128 Jun 26 2013
    // Not rebased / assumes base 0x00400000.
    
    // Lua.
    enum
    {
    	klua_gettop = 0x004D50FF,
    	klua_settop = 0x004D5110,
    
    	klua_insert = 0x004D51FD,
    	klua_remove = 0x004D5163,
    
    	klua_isnumber = 0x004D54FF,
    	klua_isstring = 0x004D552D,
    
    	klua_pushvalue = 0x004D541D,
    
    	klua_type = 0x004D54A0,
    	klua_typename = 0x004D54BF,
    
    	klua_tonumber = 0x004D55C6,
    	klua_tointeger = 0x004D55F5,
    	klua_toboolean = 0x004D5657,
    	klua_tolstring = 0x004D567F,
    
    	klua_pushnil = 0x004D57A8,
    	klua_pushnumber = 0x004D57C4,
    	klua_pushinteger = 0x004D57E8,
    	klua_pushlstring = 0x004D580C,
    	klua_pushstring = 0x004D5851,
    
    	klua_pushcclosure = 0x004D58D5,
    	klua_pushboolean = 0x004D59B5,
    
    	klua_gettable = 0x004D5A30,
    	klua_getfield = 0x004D5A56,
    	klua_rawget = 0x004D5AAA,
    	klua_rawgeti = 0x004D5B3A,
    	klua_createtable = 0x004D5BC9,
    
    	klua_settable = 0x004D5DF9,
    	klua_setfield = 0x004D5E26,
    	klua_rawset = 0x004D5E7E,
    	klua_rawseti = 0x004D5F3F,
    
    	klua_call = 0x004D6128,
    	klua_pcall = 0x004D6177,
    	klua_load = 0x004D61DD,
    
    	klua_next = 0x004D63B0,
    };
    L = [0x00F23D50]

  5. #5
    Corthezz's Avatar Elite User Authenticator enabled
    Reputation
    386
    Join Date
    Nov 2011
    Posts
    325
    Thanks G/R
    191/98
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey,
    as this thread is about executing Lua functions in a different way I would like to ask one question.
    Does using this method have any advantage or significant differences over using DoString or ExecuteBuffer to call WoW API functions?

  6. #6
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1515
    Join Date
    May 2008
    Posts
    2,433
    Thanks G/R
    81/336
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Why bother to mess with Lua? The function is really quite simple:

    Code:
    signed int __cdecl Script_SetSendMailMoney(lua_state *L)
    {
      signed int result; // eax@2
      unsigned __int64 amount; // [sp+Ch] [bp-8h]@3
    
      if ( lua_isnumber(L, 1) && CGGameUI::GetWOWMONEYFromLua(L, 1, &amount) )
      {
        if ( CGMailInfo::SetSendMoney(amount) )
          lua_pushnumber(L, 1.0);
        else
          lua_pushnil(L);
        result = 1;
      }
      else
      {
        luaL_error(L, "Usage: SetSendMailMoney(amount)");
        result = 0;
      }
      return result;
    }
    You can simply use the SetSendMoney function:

    Code:
    signed int __cdecl CGMailInfo::SetSendMoney(unsigned __int64 amount)

  7. #7
    oldmanofmen's Avatar Member
    Reputation
    12
    Join Date
    Jan 2010
    Posts
    104
    Thanks G/R
    4/3
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks all and sorry for the poorly written question, I'm surprised any of you actually understood what I meant. It was early in the morning when I wrote the question. This has been immensely helpful and I have managed to get it working and doing exactly what I wanted it to do. Thanks again.

  8. #8
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Corthezz View Post
    Hey,
    as this thread is about executing Lua functions in a different way I would like to ask one question.
    Does using this method have any advantage or significant differences over using DoString or ExecuteBuffer to call WoW API functions?
    Using the lua API is
    1. more generic, as it enables you to start your own, seperated lua state (unlikely to be of benefit)
    2. less suspicious, since you don't use FrameScript_Execute as everyone else
    3. letting you realize how lua works and appropriate stack cleanup

    It's a matter of taste, but using the lua API is certainly not worse (aesthetically) than using FrameScript_Execute. In my eyes, using FrameScript_Execute is like cnping one of those ugly MSDN samples directly into your code: It works as far as you can tell, but you don't know its side effects or how changes affect its functionality.
    So as long as you can easily execute functions from the main thread, I would go for the lua API.

Similar Threads

  1. Help WoW Fish-Bot
    By Eliteplague in forum World of Warcraft General
    Replies: 2
    Last Post: 12-10-2024, 05:46 PM
  2. HELP: Gold Scam Exploit
    By GoldDragon in forum World of Warcraft General
    Replies: 11
    Last Post: 01-23-2007, 07:26 PM
  3. Banner Ad Redesign help
    By Matt in forum Community Chat
    Replies: 57
    Last Post: 07-08-2006, 08:40 PM
  4. Hit points and talent points? Please help
    By hankusdankus in forum World of Warcraft General
    Replies: 6
    Last Post: 05-04-2006, 02:00 PM
  5. bot help
    By xwhitedeathx in forum World of Warcraft General
    Replies: 3
    Last Post: 05-01-2006, 03:50 AM
All times are GMT -5. The time now is 10:07 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