Bot Code Management Question menu

Shout-Out

User Tag List

Results 1 to 5 of 5
  1. #1
    DarkLinux's Avatar Former Staff
    CoreCoins Purchaser Authenticator enabled
    Reputation
    1627
    Join Date
    May 2010
    Posts
    1,846
    Thanks G/R
    193/539
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    Bot Code Management Question

    Hello,
    Some time back I coded a bot in C# and almost everything I did was 1/2 assed and poorly coded. I am starting up a new bot project in C++ but this time I am going to do it properly . The only problem I am running into is code management. I dont know how to call a function with out declaring a new one every time. Im not the best at explaining things, but ill try.



    I have a function in my main exe that moves the character from point to point.
    That function calls CTM from the dll. It really calls the function for a management class in the dll which then calls ctm. Its an initialization thing...
    The problem is in ctm.cpp, how can I call memory.cpp? I would like to call it from the management class but that will just create a loop.. I think..

    I would like to call WriteFloat from any place in the dll with out declaring it every time I use CTM
    Code:
    #pragma once
    #include "stdafx.h"
    #include "memory .h"
    
    namespace Yara {
    	
    	public ref class CTM
    	{	
    	public : 
    		Memory wow;
    		void Move(float x)
    		{
    			wow.WriteFloatB((DWORD)0x22,x,sizeof(x));
    		}
    	private : 
    
    	};
    }
    Anyway to make it global? I have seen some people do it in C#.

    I was looking over Shadow bot,
    Code:
    MyWoW.Memory.ReadUInt(This + 0x8);
    In one of his classes he calls the above code, but he never declares MyWoW in that class, that I can see
    Can I do that in C++, if so how?

    If I am just crazy please tell me the best way to do this? Or is my method ok? I really dont think so...

    Thanks for your help and time!
    Rep to all that help (If your into that i guess)

    Last edited by DarkLinux; 12-14-2011 at 03:40 AM.

    Bot Code Management Question
  2. #2
    Jens's Avatar Contributor
    Reputation
    179
    Join Date
    Sep 2006
    Posts
    251
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    'Static' is the keyword you're looking for.

    making the function static allows you to call it like this:
    Code:
    Memory::WriteFloat();

  3. #3
    DarkLinux's Avatar Former Staff
    CoreCoins Purchaser Authenticator enabled
    Reputation
    1627
    Join Date
    May 2010
    Posts
    1,846
    Thanks G/R
    193/539
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    I did not even think of that lols.. Thats what I get for programming at 4am...
    Thanks for the help +3Rep!

  4. #4
    DarkLinux's Avatar Former Staff
    CoreCoins Purchaser Authenticator enabled
    Reputation
    1627
    Join Date
    May 2010
    Posts
    1,846
    Thanks G/R
    193/539
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Sense you are full of good ideas I am going to ask one more question on the same topic
    I am starting to think my management class is being a little redundant...
    How would you call the static functions for an external source?
    Like above, but without the middle blue box for the management class...

    I was thinking you could do the same.. but its does not look to work...
    exe
    Code:
    #using <Yara.dll>
    ....
    using namespace Yara;
    ...
    Manager wow;
    ...
    wow.Memory::Initialize(ProcessIDList[selectedIndex]);
    //or even
    Memory::Initialize(ProcessIDList[selectedIndex]);
    Thanks!
    Last edited by DarkLinux; 12-15-2011 at 03:18 AM.

  5. #5
    Jens's Avatar Contributor
    Reputation
    179
    Join Date
    Sep 2006
    Posts
    251
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you make the memory library static calling Memory::Initialize(); should work just fine =).

    Instead of making the entire library static you could just take in the handle to the wow process as a parameter in a constructor and set up the library that way, making the memory library wrap the process, which is better design in my mind.

Similar Threads

  1. [Bot] Question: Lazy Bot Object Manager Pointers and Offsets
    By gxavier in forum WoW Memory Editing
    Replies: 1
    Last Post: 07-29-2015, 11:31 AM
  2. Some bot development related questions.
    By Mikanor in forum SWTOR Bots and Programs
    Replies: 1
    Last Post: 02-05-2012, 09:29 AM
  3. [Selling] Varius runescape bot codes
    By perssons in forum General MMO Buy Sell Trade
    Replies: 0
    Last Post: 10-19-2011, 01:47 PM
  4. [Release] Fishing Bot. Coded by me. :)
    By PopcornWoW in forum World of Warcraft Bots and Programs
    Replies: 44
    Last Post: 03-09-2008, 03:56 AM
All times are GMT -5. The time now is 05:56 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