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-nmm6 (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-nmm6 (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-nmm6 (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
storing / filtering massive items
Author Message
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #1
storing / filtering massive items
Hello people, i need to know if is this possible

i need to know how could i be able to store a list or string with all items which for example have t_armor type.

probably using the itemdef hex value

something like

for 1 10000
strmatch(t_armor,<serv.itemdef.<hval <dlocal._for>>.type)
endfor

but strmatch only returns true or false, i'd like to get as return the id or type or the hexa itemdef for those who actually achieve this request

is it possible?

regards
(This post was last modified: 07-08-2014 12:54 PM by kn4tseb.)
07-08-2014 12:47 PM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

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

SphereCommunity

Post: #2
RE: storing / filtering massive items
for 1 10000
if strmatch(*t_armor*,*<serv.itemdef.<hval <dlocal._for>>.type>*)
serv.b <serv.itemdef.<hval <dlocal._for>>.baseid>
endif
endfor

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.
07-08-2014 01:43 PM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #3
RE: storing / filtering massive items
understood, think i got it, thank you very much!

PHP Code:
for 1 50000
IF STRMATCH(*i_ingot_iron*,<serv.itemdef.<hval <dlocal._for>>.resources>) && (<serv.itemdef.<hval <dlocal._for>>.canuse>&07) && STRMATCH(*blacksmithing*,<serv.itemdef.<hval <dlocal._for>>.skillmake>) && !(STRMATCH(*amazon*,<serv.itemdef.<hval <dlocal._for>>.baseid>)) && !(STRMATCH(*decorative*,<serv.itemdef.<hval <dlocal._for>>.baseid>))
serv.log <eval <serv.itemdef.<hval <dlocal._for>>.id>>
endif
endfor 
this is the longest check ive ever done xDDD, was usefull so i can see which items i'd use, of course i wont use this check at the script itself because it is too big and will take alot of resources
even for a raid 0 SSD corsair XMS system ^^
(This post was last modified: 07-08-2014 04:06 PM by kn4tseb.)
07-08-2014 02:35 PM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

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

SphereCommunity

Post: #4
RE: storing / filtering massive items
Hmm, whats the objective of this scripts?

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.
07-09-2014 01:21 AM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #5
RE: storing / filtering massive items
i just wanted to get all items in server with i_ingot_iron for resourcs, canuse by humans, its for BS BOD gump
so i serv.log the ID and the baseid, then i did an args with those ids and could match the TILEPIC with the name of it
(This post was last modified: 07-09-2014 04:15 AM by kn4tseb.)
07-09-2014 04:15 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

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

SphereCommunity

Post: #6
RE: storing / filtering massive items
fuuuuuu

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.
07-09-2014 08:00 AM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #7
RE: storing / filtering massive items
im sorry >.< i really wanted brazil to win.
(This post was last modified: 07-09-2014 09:44 AM by kn4tseb.)
07-09-2014 09:36 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #8
RE: storing / filtering massive items
BlushBlushBlushBlushBlush
07-09-2014 10:20 AM
Find all posts by this user Like Post Quote this message in a reply
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #9
RE: storing / filtering massive items
xDDD anyway, would you guys help me a bit? i need to know if its possible to get the first word of a text no matter which one it is and return it in uppercase
i know STRTOUPPER do that for a whole text but i need it only to the first one

EDIT: ok ok i think i got it with STRSUB

;>
(This post was last modified: 07-09-2014 11:24 AM by kn4tseb.)
07-09-2014 10:29 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #10
RE: storing / filtering massive items
STRARG
STRARG can be used to extract the first word from a string. The following example demonstrates this:

[FUNCTION f_strarg]
SERV.LOG <STRARG One Two Three>

You will see the word "One" output to the console.


Ah you mean letter, not word Big Grin
(This post was last modified: 07-09-2014 10:53 AM by darksun84.)
07-09-2014 10:52 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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