SphereCommunity
storing / filtering massive items - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: storing / filtering massive items (/Thread-storing-filtering-massive-items)

Pages: 1 2 3 4


storing / filtering massive items - kn4tseb - 07-08-2014 12:47 PM

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


RE: storing / filtering massive items - Extreme - 07-08-2014 01:43 PM

for 1 10000
if strmatch(*t_armor*,*<serv.itemdef.<hval <dlocal._for>>.type>*)
serv.b <serv.itemdef.<hval <dlocal._for>>.baseid>
endif
endfor


RE: storing / filtering massive items - kn4tseb - 07-08-2014 02:35 PM

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 ^^


RE: storing / filtering massive items - Extreme - 07-09-2014 01:21 AM

Hmm, whats the objective of this scripts?


RE: storing / filtering massive items - kn4tseb - 07-09-2014 04:15 AM

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


RE: storing / filtering massive items - Extreme - 07-09-2014 08:00 AM

fuuuuuu


RE: storing / filtering massive items - kn4tseb - 07-09-2014 09:36 AM

im sorry >.< i really wanted brazil to win.


RE: storing / filtering massive items - darksun84 - 07-09-2014 10:20 AM

BlushBlushBlushBlushBlush


RE: storing / filtering massive items - kn4tseb - 07-09-2014 10:29 AM

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

;>


RE: storing / filtering massive items - darksun84 - 07-09-2014 10:52 AM

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