Jump to content
  • 0

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


anjasoleil1

Question


  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  65
  • Reputation:   0
  • Joined:  05/11/14
  • Last Seen:  

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));
        }
    }
}

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

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.

Link to comment
Share on other sites

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.

×
×
  • Create New...