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
find, collect and extract
Author Message
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #2
RE: find, collect and extract
You have many options: (2 of them)

1 - create a list with all reagent ids and search them using <rescount i_reag_name>

PHP Code:
[defnames reags]
reag_0 i_reag_nightshade

[function grabreags]
for 
<last number in deflist>
 if <
rescount <def.reag_<dlocal._for>>>
  
local.amount <rescount <def.reag_<dlocal._for>>>
  
consume <dlocal.amount> <def.reag_<dlocal._for>>
  
// add <dlocal.amount> of <def.reag_<dlocal._for>> in your reagent crystal
 
endif
endfor 

2 - using a recursive forcont in your backpacks (backpack inside your main backpack) and check if they are t_reagent

PHP Code:
[function grabreags]
ref1 <crystal reagent uid>
forcont <findlayer.21>
 if <
type> == t_reagent
  cont 
<ref1>
 
elif <type> == t_container
  _grabreags 
<ref1>
 endif
endfor

[function 
grabreags]
forcont <uid>
 if <
type> == t_reagent
  cont 
<crystal reagent>
 
elif <type> == t_container
  _grabreags 
<args>
 endif
endfor 

Will you store the reagents using TAGs? If yes, you will have to remove the reags and add the amounts in your pack in the tags.

To grab values from the crystal, make buttons and when pressed, create x amount of you want and place in backpack and decrease the same value from the tags.

To know what items are stored in the crystal, store the reagents baseid in one tag, like tag.items i_reag_nightshade,i_reag_blood_moss and in your gump, make a for to fill the dialog.

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
(This post was last modified: 05-28-2014 01:49 AM by Extreme.)
05-28-2014 01:44 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
find, collect and extract - ograso - 05-28-2014, 12:10 AM
RE: find, collect and extract - Extreme - 05-28-2014 01:44 AM

Forum Jump:


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