Register for your free account! | Forgot your password?

You last visited: Today at 09:22

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] auto move by clicking at map

Discussion on [Release] auto move by clicking at map within the SRO PServer Guides & Releases forum part of the SRO Private Server category.

Reply
 
Old   #1
 
bimbum*'s Avatar
 
elite*gold: 47
Join Date: Oct 2017
Posts: 574
Received Thanks: 967
[Release] auto move by clicking at map

HAI, after seeing florian's pathfinder, i decided to make something out of it.
please note its not ready yet for production since the searching algorithm kinda slow finding the target so with proper mutex for the crucial section and multiple threads you would get over this.

Gallery 1

our thread consists of four parts.

FINDING THE TARGET
since we implementing the auto move , we have to find the most optimal path to the position that we moving to.
thanks to florian0 and bueddl they implemented A* algorithm to find it not only that, they also put the collisions in considerations.

MOUSE EVENT HANDLING
after implementing the A* algorithm. we would need to detect the right mouse left up clicks (at my case you would do whatever you want) so that detecting the player coordinates piecewise detecting the real game coordinates

hooking the 3d events functions
Code:
    replaceAddr(0xD99BD8, addr_from_this(&CNIFWorldMap::OnMouseActions));
calculating the real game coordinates and initialize the pathfinder
Code:
bool CNIFWorldMap::OnMouseActions(Event3D* mouseData) {
    bool result = reinterpret_cast<bool (__thiscall *)(CNIFWorldMap *, Event3D*)>(0x00623220)(this, mouseData);

    switch(mouseData->Msg)
    {
        //right mouse up
        case 0x205:
            int currentTile_MAYBE =  reinterpret_cast<int(__thiscall *) (int*)>(0x0096f4e0)(m_currentPos);

            float PosX =  ((mouseData->lParam -  m_currentPosX) *  m_stateY) + (float)m_stateX;

            float PosY = ((-mouseData->wParam + m_currentPosY + (float)*(int *)(currentTile_MAYBE + 0x54)) *  m_viewHeight) + (float)m_viewWidth;

            // From location
            LocationInfo l1 = {0, 0, 0, D3DXVECTOR3(0, 0, 0)};

            l1.region = g_pCICPlayer->region;
            l1.pos = g_pCICPlayer->location;
            l1.field_0 = g_pCICPlayer->m_navcell;
            l1.field_1 = reinterpret_cast<int>(g_pCICPlayer->m_object_under_foot);

            // To location
            LocationInfo l2 = {0, 0, 0, D3DXVECTOR3(0, 0, 0)};

            l2.pos.x = fmod(abs(PosX),192)  * 10.0;
            l2.pos.y = fmod(abs(PosY), 192) * 10.0;
            l2.pos.z = fmod(abs(PosY), 192) * 10.0;
            l2.region.x = (PosX - (l2.pos.x) / 10.0) / 192.0 + 135;
            l2.region.y = (PosY - (l2.pos.z) / 10.0) / 192.0 + 92;

            CIFMamaMia* m_pMamaMia = (CIFMamaMia *) g_pCGInterface->GetWindowByUniqueID(1999013);

            m_pMamaMia->Start(l1,l2);

            LocationData test;
            test.region = (l2.region.y << 8) | l2.region.x;
            test.x = l2.pos.x;
            test.z = l2.pos.z;
            test.y = l2.pos.z;

            m_UniqueLocation[L"automove"] = test;
            break;
    }
    return result;
}
DRAW AT THE MAP
iam drawing a duck at the click position, i made a map which includes the texture pointers while initializing them at the creation of the world map

Code:
bool CNIFWorldMap::OnWMCreate(long ln) {
    bool x = reinterpret_cast<bool (__thiscall *)(CNIFWorldMap *,long)>(0x0060F340)(this,ln);
    m_pUniqueIcon = (IDirect3DBaseTexture9 *) Fun_CacheTexture_Create("ducksoup\\logo.ddj");
    //todo interface\targetwindow\tw_icon_unique.ddj
    return x;
}

void CNIFWorldMap::OnWMRenderMySelf() {
    reinterpret_cast<void (__thiscall *)(CNIFWorldMap *)>(0x0061BAC0)(this);

    std::map<std::n_wstring, LocationData>::const_iterator it = m_UniqueLocation.begin();
    for (; it != m_UniqueLocation.end(); it++) {

        int currentTile_MAYBE =  reinterpret_cast<int(__thiscall *) (int*)>(0x0096f4e0)(m_currentPos);

        float renderPosX = m_currentPosX +
                (((*it).second.x / 10.0 + (float)((((*it).second.region & 0xff) - 0x87) * 0xc0)) - (float)m_stateX) /
                            m_stateY;

        float renderPosY = m_currentPosY +
                ((float)*(int *)(currentTile_MAYBE + 0x54) -
                 (((*it).second.z / 10.0 + (float)((((*it).second.region >> 8) - 0x5c) * 0xc0)) - (float)m_viewWidth) /
                            m_viewHeight);

        D3DVECTOR dataOut[9];

        dataOut[0].x = renderPosX-5;
        dataOut[0].y = renderPosY-5;
        dataOut[0].z = 1.0;

        dataOut[2].x = dataOut[0].x + 45.0f;
        dataOut[2].y = dataOut[0].y;
        dataOut[2].z = 1.0;

        dataOut[4].x = dataOut[0].x + 45.0f;
        dataOut[4].y = renderPosY-5 + 45.0f;
        dataOut[4].z = 1.0;

        dataOut[6].x = dataOut[0].x;
        dataOut[6].y = dataOut[4].y;
        dataOut[6].z = 1.0;

        dataOut[8].z = 0.0;

        dataOut[1].z = 0.0;
        dataOut[3].z = 0.0;
        dataOut[5].z = 1.0;
        dataOut[7].z = 1.0;

        dataOut[1].x = 0.1;
        dataOut[3].x = 0.1;
        dataOut[5].x = 0.1;
        dataOut[7].x = 0.1;

        dataOut[1].y = 0.0;
        dataOut[3].y = 1.0;
        dataOut[5].y = 1.0;
        dataOut[7].y = 0.0;

        g_RStateMgr.m_pDevice->SetFVF(260);
        g_RStateMgr.m_pDevice->SetTexture(0,m_pUniqueIcon);
        g_RStateMgr.sub_4700A0();
        g_RStateMgr.m_pDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN,2,&dataOut,0x18);
    }
}
AUTO MOVE
we have the optimal path as segments , i made two timers to manage the movements

please note that its all for testing purposes, you will have to re implement everything.

Sources:
//for testing the algorithm





bimbum* is offline  
Thanks
38 Users
Old 02/11/2023, 22:51   #2
 
caner_tr's Avatar
 
elite*gold: 0
Join Date: Sep 2012
Posts: 25
Received Thanks: 5
Great Release. ty for share
caner_tr is offline  
Old 02/12/2023, 02:25   #3
 
HypnosĄ's Avatar
 
elite*gold: 1
Join Date: Mar 2016
Posts: 1,204
Received Thanks: 962
OMG, that's insanely good improvement and feature! Thank you!
HypnosĄ is offline  
Thanks
1 User
Old 02/12/2023, 03:22   #4
 
elite*gold: 0
Join Date: Oct 2012
Posts: 32
Received Thanks: 7
Great. Thank you
random82600 is offline  
Old 02/12/2023, 07:19   #5
 
elite*gold: 0
Join Date: Dec 2012
Posts: 72
Received Thanks: 7
u are always making the amazing works
790312795 is online now  
Old 02/12/2023, 09:57   #6
 
painmaker_'s Avatar
 
elite*gold: 0
Join Date: Dec 2021
Posts: 85
Received Thanks: 74
At least there are some people who don't care about any features and if they decide to release something, they will not hesitate to do so. Keep up the good work, mate.
painmaker_ is offline  
Thanks
1 User
Old 02/12/2023, 10:39   #7

 
SubZero**'s Avatar
 
elite*gold: 70
Join Date: Apr 2017
Posts: 1,023
Received Thanks: 504
Great work dude keep it up
SubZero** is offline  
Old 02/12/2023, 10:41   #8
 
elite*gold: 0
Join Date: Aug 2018
Posts: 54
Received Thanks: 77
You're amazing, thank you.
ssorpeg is offline  
Old 02/12/2023, 18:18   #9
 
Ferpa_'s Avatar
 
elite*gold: 100
Join Date: Sep 2009
Posts: 1,195
Received Thanks: 379
great work
Ferpa_ is offline  
Old 02/12/2023, 19:44   #10
 
srothanglong's Avatar
 
elite*gold: 0
Join Date: Apr 2019
Posts: 298
Received Thanks: 80
wow! good bro
srothanglong is offline  
Thanks
1 User
Old 02/15/2023, 05:18   #11

 
Yarken1337's Avatar
 
elite*gold: 75
Join Date: Oct 2021
Posts: 97
Received Thanks: 67
good job
Yarken1337 is offline  
Old 02/15/2023, 14:55   #12
 
elite*gold: 0
Join Date: Feb 2013
Posts: 79
Received Thanks: 10
after these years and i still treat g_RStateMgr as g_pd3dDevice!
am i missing alot ?
ZeonNETWORK is offline  
Old 02/19/2023, 11:54   #13
 
elite*gold: 0
Join Date: Jul 2020
Posts: 163
Received Thanks: 15
waiting The biggest release
The in side client browser <3

Hope you help us soon and release it
Thank you for your GREAT WORK
you one of the legends of Silkroad Developers like Florine and pushedx
kotsh23 is offline  
Old 02/20/2023, 06:08   #14
 
kyuubi09's Avatar
 
elite*gold: 0
Join Date: Dec 2021
Posts: 20
Received Thanks: 31
Just want to notice you, this release will only works on vSRO188,
In newer clients like cSRO, vSRO274, iSRO, etc they are using anewer map than vsro188.
Code:
CNIFWorldMapRenderPanel
CNIFWorldMapView
CNIFWorldMapViewBottomBox
CNIFWorldMapViewBtnHandler
CNIFWorldMapViewGuide
CWorldMap_DungeonMapInfo
CWorldMap_InstanceInfo
CWorldMap_LocalInfo
CWorldMap_MapInfo
CWorldMapDungeonColleague
CWorldMapFieldColleague
CWorldMapFortressNPCColleague
CWorldMapGuideData
CWorldMapGuideDataManager
CWorldMapLocalColleague
CWorldMapPlayerColleague
CWorldMapQuestNPCColleague
CWorldMapSkillPointColleague
CWorldMapViewController
CWorldMapViewer
IWorldMapViewerEventListener
[vSRO188 is using CNIFWorldMap.
What is the diffreent? The new map is rewrited and its just got improved from leaked memrey and the render codes are got sorted CNIFWorldMapView is the interface continer and CWorldMapViewer CNIFWorldMapRenderPanel who doing the renders stuff.
So if u want to render custom stuff in the world map it will be complex to find the funcs and do yours.
kyuubi09 is offline  
Thanks
4 Users
Old 02/21/2023, 21:51   #15
 
T0o0P's Avatar
 
elite*gold: 0
Join Date: Sep 2016
Posts: 165
Received Thanks: 38
Nice Keep
T0o0P is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[HELP] VSRO Auto move state map
08/13/2020 - SRO PServer Questions & Answers - 3 Replies
Hi guys, I'm facing a problem that when I teleport to Pharaoh Temple and press M to show Temple map but it always shows the Entire Map. https://i.ibb.co/fSbJgV2/image.png My expectation is showing the Temple map but it doesn't work. Any idea to fix that?
Is there any correction? Player Has DC by clicking on the border map
07/24/2019 - Shaiya PServer Development - 0 Replies
I research a lot before opening this topic, and about the map border in ep6, if the player clicks on it, the player is disconnected from the game, I would like to know if there is a fix for it, and I would like your help to correct it. if anyone has correction for this error i would be grateful, or any help for correction
Simple auto clicker [right clicking]
02/02/2016 - CO2 Bots & Macros - 47 Replies
Edit: http://www.elitepvpers.com/forum/co2-bots-macros/1 34729-conquer-clicker-z-all-versions-will-posted-h ere-2.html Please refer to this thread /\ This auto clicker will simply right click every 1.5 seconds, saving your wrists a lot of damage/exhaustion. Any suggestions are more than welcome (suggestions for other programs are okay too). A picture and the program follows;
Simple Auto-clicking Program
06/21/2009 - CO2 Bots & Macros - 7 Replies
I use the program to fix intensify / scatter. Really saves your had from getting tired of clicking while plvling. Click-A-Lot is the name of this auto-clicker. Its freeware as well.



All times are GMT +1. The time now is 09:24.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.