Jump to content
  • 0

Is it possible to sort items by name or do we have to do it manually?


Question

Posted

Hi, I've been experimenting with this script I made, and would appreciate it if you can share ways to sort the NPC shop by name or etc... This is the script:

 

Quote

prontera,117,140,0    shop    itemtype0    101,1:0
prontera,118,140,0    shop    itemtype2    101,1:0
prontera,119,140,0    shop    itemtype3    101,1:0
prontera,120,135,0    shop    itemtype4    101,1:0
prontera,121,135,0    shop    itemtype5    101,1:0
prontera,122,140,0    shop    itemtype6    101,1:0
prontera,123,140,0    shop    itemtype7    101,1:0
prontera,124,140,0    shop    itemtype8    101,1:0
prontera,125,140,0    shop    itemtype10    101,1:0
prontera,126,140,0    shop    itemtype11    101,1:0
prontera,127,140,0    shop    itemtype12    101,1:0
prontera,128,140,0    shop    itemtype18    101,1:0


-    script    itemsorter    1_M_02,{
OnInit:
freeloop(1);
    for( $@i = 500; $@i < 31172; $@i++ ){
        //announce $@i,0;
        if(getiteminfo($@i,3) >= 1){
            
            npcshopadditem "itemtype" + getiteminfo($@i,2),$@i,(getiteminfo($@i,0));
        }
    }
}

 

1 answer to this question

Recommended Posts

  • 0
Posted

you can try refer to this topic to adjust your script.

change the SQL query to order the result based on item name...something...

SELECT * FROM `item_db` ORDER BY `item_db`.`item_name`

make sure you have the complete SQL table with data inside. Just play around with the SQL query.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...