Register for your free account! | Forgot your password?

You last visited: Today at 17:20

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

Advertisement



VSRO Auto-Sort - Help

Discussion on VSRO Auto-Sort - Help within the SRO PServer Questions & Answers forum part of the SRO Private Server category.

Reply
 
Old   #1
 
Judgelemental's Avatar
 
elite*gold: 0
Join Date: Aug 2013
Posts: 1,532
Received Thanks: 835
VSRO Auto-Sort - Help

Hi,

I've been trying to add the Auto-Sort feature (for a couple of weeks now using DevKit) on my VSRO server where I play alone and I cannot get it to work.

It's this feature:


I have no idea about programming and every time I tried to add it my client crashed so I gave up.

I'd really appreciate it and it would make my day if somebody can help me implement it.

(I attach the source code -credits bimbum*-, my Discord ID: snowfall5307 and my sro_client.exe).

Thank you in advance.
Attached Files
File Type: rar source.rar (7.47 MB, 238 views)
File Type: rar sro_client.rar (2.67 MB, 70 views)
Judgelemental is offline  
Old 12/07/2023, 22:32   #2
 
bimbum*'s Avatar
 
elite*gold: 47
Join Date: Oct 2017
Posts: 574
Received Thanks: 967
bubble sort algorithm for vsro,

Code:
void CIFMainPopup::OnClick_BtnSort() {
    if (!m_bIsSortRunning) {
        m_bIsSortRunning = true;

        StartTimer(220, 200);

        g_pCGInterface->GetSystemMessageView()->WriteMessage(255, 0xef00ff00, TSM_GETTEXTPTR(L"UIIT_STT_VAN_GUARD_SORT_1"), 0, 1);
    } else {
        m_bIsSortRunning = false;

        KillTimer(220);
    }
}
Code:
void CIFMainPopup::OnTimer(int timerId) {
    if (timerId == 220) {
        if (Sort()) {
            KillTimer(220);
            g_pCGInterface->GetSystemMessageView()->WriteMessage(255, 0xef00ff00, TSM_GETTEXTPTR(L"UIIT_STT_VAN_GUARD_SORT_2"), 0, 1);
            m_bIsSortRunning = false;
        }
    }
}
Code:
bool CIFMainPopup::Sort() {
    int invCount = g_pCICPlayer->GetInvSlotsCount();

    for (int i = 0; i < invCount; i++) {
        CIFSlotWithHelp *pSlot = GetInventory()->pSlots[i];
        CSOItem *pItem = pSlot->m_pSOItem;

        if (pItem != NULL && pItem->m_refObjItemId > 0) {
            const SItemData *pItemData = pItem->GetItemData();

            if (pItemData && pItem->GetQuantity() < pItemData->m_maxStack) {
                for (int j = i + 1; j < invCount; j++) {
                    CIFSlotWithHelp *pSlotJ = GetInventory()->pSlots[j];
                    CSOItem *pItemJ = pSlotJ->m_pSOItem;

                    if (pItemJ != NULL && pItemJ->m_refObjItemId > 0 && pItemJ->m_refObjItemId == pItem->m_refObjItemId) {
                        const SItemData *pItemDataJ = pItemJ->GetItemData();

                        if (pItemDataJ && pItemJ->GetQuantity() < pItemDataJ->m_maxStack) {
                            int countToMove = 0;

                            if (pItem->GetQuantity() + pItemJ->GetQuantity() <= pItemDataJ->m_maxStack)
                                countToMove = pItem->GetQuantity();
                            else if (pItem->GetQuantity() <= pItemJ->GetQuantity())
                                countToMove = pItemDataJ->m_maxStack - pItemJ->GetQuantity();
                            else
                                countToMove = pItemDataJ->m_maxStack - pItem->GetQuantity();

                            NEWMSG(0x7034);
                            pReq << BYTE(0x0) << BYTE(i + 13) << BYTE(j + 13) << UINT16(countToMove);
                            SENDMSG();
                            return false;
                        }
                    }
                }
            }
        }
    }
    return true;
}
bimbum* is offline  
Thanks
3 Users
Old 12/07/2023, 22:53   #3
 
Judgelemental's Avatar
 
elite*gold: 0
Join Date: Aug 2013
Posts: 1,532
Received Thanks: 835
Quote:
Originally Posted by bimbum* View Post
bubble sort algorithm for vsro,

Code:
void CIFMainPopup::OnClick_BtnSort() {
    if (!m_bIsSortRunning) {
        m_bIsSortRunning = true;

        StartTimer(220, 200);

        g_pCGInterface->GetSystemMessageView()->WriteMessage(255, 0xef00ff00, TSM_GETTEXTPTR(L"UIIT_STT_VAN_GUARD_SORT_1"), 0, 1);
    } else {
        m_bIsSortRunning = false;

        KillTimer(220);
    }
}
Code:
void CIFMainPopup::OnTimer(int timerId) {
    if (timerId == 220) {
        if (Sort()) {
            KillTimer(220);
            g_pCGInterface->GetSystemMessageView()->WriteMessage(255, 0xef00ff00, TSM_GETTEXTPTR(L"UIIT_STT_VAN_GUARD_SORT_2"), 0, 1);
            m_bIsSortRunning = false;
        }
    }
}
Code:
bool CIFMainPopup::Sort() {
    int invCount = g_pCICPlayer->GetInvSlotsCount();

    for (int i = 0; i < invCount; i++) {
        CIFSlotWithHelp *pSlot = GetInventory()->pSlots[i];
        CSOItem *pItem = pSlot->m_pSOItem;

        if (pItem != NULL && pItem->m_refObjItemId > 0) {
            const SItemData *pItemData = pItem->GetItemData();

            if (pItemData && pItem->GetQuantity() < pItemData->m_maxStack) {
                for (int j = i + 1; j < invCount; j++) {
                    CIFSlotWithHelp *pSlotJ = GetInventory()->pSlots[j];
                    CSOItem *pItemJ = pSlotJ->m_pSOItem;

                    if (pItemJ != NULL && pItemJ->m_refObjItemId > 0 && pItemJ->m_refObjItemId == pItem->m_refObjItemId) {
                        const SItemData *pItemDataJ = pItemJ->GetItemData();

                        if (pItemDataJ && pItemJ->GetQuantity() < pItemDataJ->m_maxStack) {
                            int countToMove = 0;

                            if (pItem->GetQuantity() + pItemJ->GetQuantity() <= pItemDataJ->m_maxStack)
                                countToMove = pItem->GetQuantity();
                            else if (pItem->GetQuantity() <= pItemJ->GetQuantity())
                                countToMove = pItemDataJ->m_maxStack - pItemJ->GetQuantity();
                            else
                                countToMove = pItemDataJ->m_maxStack - pItem->GetQuantity();

                            NEWMSG(0x7034);
                            pReq << BYTE(0x0) << BYTE(i + 13) << BYTE(j + 13) << UINT16(countToMove);
                            SENDMSG();
                            return false;
                        }
                    }
                }
            }
        }
    }
    return true;
}
I have no idea what to do with these but I'll try my best!
Thank you.
Judgelemental is offline  
Old 12/12/2023, 14:42   #4
 
elite*gold: 0
Join Date: Dec 2022
Posts: 4
Received Thanks: 2
missing line or no ? m_bIsSortRunning error blabla

is it a sro culture to answer like a riddle instead of giving it directly
Q8Quard is offline  
Thanks
2 Users
Old 12/12/2023, 15:06   #5

 
lidzy's Avatar
 
elite*gold: 5
Join Date: Sep 2019
Posts: 128
Received Thanks: 17
Filters already did that why would you like to do it with DevKit ?
lidzy is offline  
Old 12/12/2023, 15:41   #6
 
Judgelemental's Avatar
 
elite*gold: 0
Join Date: Aug 2013
Posts: 1,532
Received Thanks: 835
Quote:
Originally Posted by Q8Quard View Post
missing line or no ? m_bIsSortRunning error blabla

is it a sro culture to answer like a riddle instead of giving it directly
Inflated (fragile) ego, inferiority complex and lack of social skills along with little emotional intelligence.

Quote:
Originally Posted by lidzy View Post
Filters already did that why would you like to do it with DevKit ?
Because I play alone and I don't want to pay for a filter unless it's permanent.
Judgelemental is offline  
Reply


Similar Threads Similar Threads
vSRO Auto Equipment, vSRO Auto Equipment, Full Sun +12 - FB - STATLI
02/09/2025 - SRO PServer Guides & Releases - 5 Replies
Hello Guys In the current state, auto items come between 1DG-10DG. It is set to level 15 for 2DG, other dgs are at the level of full set can not be consumed. (23Lv, 31Lv, 40Lv, 47Lv, 57Lv, 69Lv, 81Lv, 95Lv) Items are set to Sun, you can make necessary edits from TR_AUTOEQUIP_SPARE trigger. Items come with +12 100% stats and STR, INT blues. You can edit this part using the FN_ADD_INITIAL_EQUIP_SPARE procedure. Things to do; Just execute the Table, Procedure, and Trigger. Execute order:...
[Help]Some sort of Tool...
02/28/2010 - EO PServer Hosting - 2 Replies
Hey there, Is there any kind of tool that lets someone ban/change name and other stuff? same as http://www.elitepvpers.com/forum/eo-pserver-hosting /228552-release-acme-admin-tool.html but something else.. because it wouldn't let others use commands.. it would say no table found.. Thanks :awesome:
[HELP]sort of nooby, drops
02/13/2010 - EO PServer Hosting - 7 Replies
how do u restore the normal eudemons drops, if anyone has something close to real eudemons i'd really appreciate it if you could help me do this, it doesn't have to be perfect, i need something to do the following with drops: about 20x normal eudemons gold drop, and about 5x eudemons item drop right now my server is droping only eo cards, and droping massive amounts of gold(500k on the lowest level monsters, etc)
Storage Auto Sort Script???
03/17/2008 - Silkroad Online - 7 Replies
I have looked through the fourms and searched looking to see if there are any scripts that will help sort your storage items. If someone knows of a script that does this please let me know :) This will especially be good for arrangeing tablets and alchemy in your storage box so you can just dump your alchemy items into your storage box and have script auto sort all your items!!! :D



All times are GMT +1. The time now is 17:21.


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.