Requesting suggestions for a follow hero script

This is a discussion on Requesting suggestions for a follow hero script within the Warcraft 3 Hacks, bots and tools board part of the Warcraft 3 forum category; Currently, I have an autoit script that uses pixel color matching to scan for an ally hero (specified by color) ...

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    skuldam's Avatar
    skuldam is offline Newbie
    Array
    Join Date
    Oct 2011
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    0
    Reputation
    0

    Question Requesting suggestions for a follow hero script

    Currently, I have an autoit script that uses pixel color matching to scan for an ally hero (specified by color) using the mini map, and then moves my hero to that location. This approach is very buggy and the pixel does not always match.

    What are better ways to programmatically have my hero follow an ally hero?

    Would it be possible using memory offsets (like in maphacks)?

    Thanks for inputs!


  2. #2
    ZeD's Avatar
    ZeD
    ZeD is offline RoR 0x266E


    Array
    Join Date
    Feb 2007
    Location
    Germany
    Posts
    1,440
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    14
    Reputation
    698
    Use wc3 jass natives and a proper programming language rather than a script language, like C++ or asm or smth like that.

    WC3 Jass Natives have been collected by YourName (thanks for that): WC3 Jass Natives

  3. #3
    skuldam's Avatar
    skuldam is offline Newbie
    Array
    Join Date
    Oct 2011
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    0
    Reputation
    0
    Quote Originally Posted by Dennis View Post
    Use wc3 jass natives and a proper programming language rather than a script language, like C++ or asm or smth like that.
    Great! I will look into this. Thanks for tip!

    Are there any code examples that I can look at that make calls to WC3 Jass Natives?
    Last edited by skuldam; 10-27-2011 at 01:48 AM.

  4. #4
    ZeD's Avatar
    ZeD
    ZeD is offline RoR 0x266E


    Array
    Join Date
    Feb 2007
    Location
    Germany
    Posts
    1,440
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    14
    Reputation
    698
    Quote Originally Posted by skuldam View Post
    Great! I will look into this. Thanks for tip!

    Are there any code examples that I can look at that make calls to WC3 Jass Natives?
    If you are able to use C++ you can use typedefs to call those functions:

    Code:
    ...
    DWORD dwGameDLL = (DWORD)GetModuleHandle( TEXT( "Game.dll" ) );
    
    typedef void (__cdecl *PingMiniMapEx_t)( float* fX, float* fY, float* fDuration,
       int nRed, int nGreen, int nBlue, bool bExtras );
    
    PingMiniMapEx_t PingMiniMapEx = PingMiniMapEx_t(dwGameDLL+0x3B8660);
    
       ...
       float fX = 0, float fY = 0, float fDuration = 10;
       PingMiniMapEx( &fX, &fY, &fDuration, 0xFF, 0xFF, 0xFF, false ); // Places a MiniMapEx-Type ping on the
                                                                       // center of the minimap in a white color.
       ...
    Remember you've to call those functions out of warcrafts threads, means you got to hook other functions and check for special events like a command you use in "your" function which, in the hooked function, will be recognized and place that ping, on the minimap.
    Last edited by ZeD; 10-27-2011 at 02:51 AM.

  5. #5
    skuldam's Avatar
    skuldam is offline Newbie
    Array
    Join Date
    Oct 2011
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    0
    Reputation
    0
    Quote Originally Posted by Dennis View Post
    Remember you've to call those functions out of warcrafts threads, means you got to hook other functions and check for special events like a command you use in "your" function which, in the hooked function, will be recognized and place that ping, on the minimap.
    I was able to follow the code; however, I am confused by what you mean by "hook other functions". My question is, if I just want to get that ping executed properly in your code above, what else would I have to do in order to compile it properly? More example is greatly appreciated.

    Thanks!

  6. #6
    ZeD's Avatar
    ZeD
    ZeD is offline RoR 0x266E


    Array
    Join Date
    Feb 2007
    Location
    Germany
    Posts
    1,440
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    14
    Reputation
    698
    You should learn more about C++ programming to understand, or better to say to use, the code I've posted above.
    When you've managed to learn the basics of C++ I would feel free to help you out with further problems.

    You can search in the internet for C++ eBooks, I recommend you buying books about that anyways, as its ways clearer and better explained in those real books.

  7. #7
    skuldam's Avatar
    skuldam is offline Newbie
    Array
    Join Date
    Oct 2011
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    0
    Reputation
    0
    Quote Originally Posted by Dennis View Post
    You should learn more about C++ programming to understand, or better to say to use, the code I've posted above.
    When you've managed to learn the basics of C++ I would feel free to help you out with further problems.

    You can search in the internet for C++ eBooks, I recommend you buying books about that anyways, as its ways clearer and better explained in those real books.
    I apologize for sounding noobish in terms of the basics of C++. I actually have working experienced of C/C++. I was able to understand the snippet you posted, and also the function pointer that you that you made in the typdef. However, I was not able to comprehend what other functions you were referring to in terms of "hook other functions" and how the "special events" are to be handled. Hence, I wanted to see a bit more code.

    Thanks!

  8. #8
    ZeD's Avatar
    ZeD
    ZeD is offline RoR 0x266E


    Array
    Join Date
    Feb 2007
    Location
    Germany
    Posts
    1,440
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    14
    Reputation
    698
    That's the part of where the basics of C++ are missing.

    See, there's the sourcecode of SelfHack somewhere around in this wc3 hack section. Its coded in C++, pointers & offsets are outdated but its not hard to get those new ones when you understand how memory works.

    In the SelfHack there's a "runenotifier" and "roshannotifier", which both use the PingMinimapEx function, and these notifier functions are HOOKED (detoured) out of wc3's original threads.

  9. #9
    Desu_Is_A_Lie's Avatar
    Desu_Is_A_Lie is offline Hacker
    Array
    Join Date
    Nov 2009
    Location
    Tver', Russian Federation
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    8
    Reputation
    170
    disregard the original post

    Just to state that more clearly (since at first even I didn't get what you (^) actually said, so was the original post) - JASS native functions are NOT needed to be hooked, so you could call them. You have to hook functions only if you need to detect some event.
    Last edited by Desu_Is_A_Lie; 10-27-2011 at 06:33 PM.

  10. #10
    YourName's Avatar
    YourName is offline THE ONE AND ONLY DARK KNIGHTY


    Array
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    1,553
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rep Power
    16
    Reputation
    1088
    Quote Originally Posted by Desu_Is_A_Lie View Post
    disregard the original post

    Just to state that more clearly (since at first even I didn't get what you (^) actually said, so was the original post) - JASS native functions are NOT needed to be hooked, so you could call them. You have to hook functions only if you need to detect some event.
    You have to run JASS natives from a Warcraft thread, though.
    Providing you with foolish stuff since 2007.

Page 1 of 2 12 LastLast

Similar Threads

  1. warcraft 3 memory reading of Dota Hero Level ? where is the address of my hero?
    By AlexeiK in forum Warcraft 3 Hacks, bots and tools
    Replies: 18
    Last Post: 02-11-2014, 07:32 AM
  2. Follow me please (new to twitter?) help me out
    By delo312 in forum Entertainment
    Replies: 0
    Last Post: 09-23-2009, 10:10 AM
  3. Replies: 4
    Last Post: 08-23-2009, 10:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •