The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Listing items
Author Message
JohnVeritas
Apprentice
*

Posts: 49
Likes Given: 0
Likes Received: 4 in 4 posts
Joined: Feb 2014
Reputation: 2



Post: #1
Listing items
Hello guys, I want to list items with a proper command but I want the listed items placed by their amout. For instace; I have a lot of potions, when I use the command .listpotions, I want to see, which potions I have and how many of them. And if I have 20 heal 19 cure and 21 refresh, in the list refresh potion must be the first place, also I dont want to see the potion names that I dont have in my backpack.

(p.s Sorry about my bad english. )
05-21-2014 09:31 PM
Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #2
RE: Listing items
Do you have stackable potions or separate?

for stackable:
1. use a function with forconttype t_potion - store potion uids separated by comma in one local.string. Send the whole string to second function that will sort it.nope

2. MySQL

3. usin a list- basically the same as the long string in the first case.
(This post was last modified: 05-22-2014 02:27 AM by Alaric.)
05-21-2014 10:49 PM
Find all posts by this user Like Post Quote this message in a reply
JohnVeritas
Apprentice
*

Posts: 49
Likes Given: 0
Likes Received: 4 in 4 posts
Joined: Feb 2014
Reputation: 2



Post: #3
RE: Listing items
My potions are stackable but dont stand upon it, it's just a sample, it could be ores too. Anyways I see, I can get values of my potions with checking forconttype t_potion but I can't understand how to store uids, can u show a example ?
05-21-2014 11:29 PM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #4
RE: Listing items
you must use RESCOUNT

Code:
[FUNCTION listpotions]
IF (<RESCOUNT i_potion_mana>)
  SYSMESSAGE Mana Potion: <RESCOUNT i_potion_mana>
ENDIF
IF (<RESCOUNT i_potion_heal>)
  SYSMESSAGE Heal Potion: <RESCOUNT i_potion_heal>
ENDIF
...
05-22-2014 12:20 AM
Find all posts by this user Like Post Quote this message in a reply
JohnVeritas
Apprentice
*

Posts: 49
Likes Given: 0
Likes Received: 4 in 4 posts
Joined: Feb 2014
Reputation: 2



Post: #5
RE: Listing items
Well I'm already done a list script but it just too simple. Check it;

Code:
[function pots]
dialog d_potions
return 1

[dialog d_potions]
5,5
page 0
resizepic 0 0 5120 270 270
resizepic 5 5 3000 260 260
dhtmlgump 90 20 150 20 0 0 Potion Counter

tilepic 13 70 <eval 3852>
gumppic 55 70 2443
dhtmlgump 82 72 150 20 0 0 <def.bfont_yellow><eval <rescount i_potion_heal>>
dhtmlgump 35 50 150 20 0 0 heal

tilepic 15 110 <eval 3847>
gumppic 55 110 2443
dhtmlgump 82 112 150 20 0 0 <def.bfont_yellow><eval <rescount i_potion_cure>>
dhtmlgump 35 90 150 20 0 0 cure

tilepic 11 150 <eval 3851>
gumppic 55 150 2443
dhtmlgump 82 152 150 20 0 0 <def.bfont_yellow><eval <rescount i_potion_refresh>>  
dhtmlgump 35 130 150 20 0 0 refresh

tilepic 26 190 <eval 3848>
gumppic 55 190 2443
dhtmlgump 82 192 150 20 0 0 <def.bfont_yellow><eval <rescount i_potion_agility>>
dhtmlgump 35 170 150 20 0 0 agility

tilepic 133 70 <eval 3852>
gumppic 170 70 2443
dhtmlgump 197 72 150 20 0 0 <def.bfont_yellow><eval <rescount i_potion_healgreat>>
dhtmlgump 153 50 150 20 0 0 g.heal

tilepic 135 110 <eval 3847>
gumppic 170 110 2443
dhtmlgump 197 112 150 20 0 0 <def.bfont_yellow><eval <rescount i_potion_curegreat>>
dhtmlgump 153 90 150 20 0 0 g.cure

tilepic 131 150 <eval 3851>
gumppic 170 150 2443
dhtmlgump 197 152 150 20 0 0 <def.bfont_yellow><eval <rescount i_potion_refreshtotal>>
dhtmlgump 153 130 150 20 0 0 t.refresh

tilepic 146 190 <eval 3846>
gumppic 170 190 2443
dhtmlgump 197 192 150 20 0 0 <def.bfont_yellow><eval <rescount i_potion_nightsight>>
dhtmlgump 153 170 150 20 0 0 nightsight

[DIALOG d_potions text]

But... I want that list count potions and list them "much to less" by their amount.
05-22-2014 12:33 AM
Find all posts by this user Like Post Quote this message in a reply
Alaric
Journeyman
*

Posts: 227
Likes Given: 7
Likes Received: 9 in 4 posts
Joined: Oct 2012
Reputation: 7



Post: #6
RE: Listing items
Its bad with thos uids, ignore it. You have to really use the rescount. (Didn't know sphere has this function Smile)
I don't know about an easy way to do this, damn... Everything is too heavy.
(This post was last modified: 05-22-2014 01:30 AM by Alaric.)
05-22-2014 12:57 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)