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: #21
RE: storing / filtering massive items
yes skul but i want to get exactly the .<xx>.
this is what i'd like to get

serv.log <serv.itemdef.<*rose*>.defname> so i would get all items with the word rose at itemdef.

dunno if possible

strmatch wont work since the string wont be completed because i dont have a way to refer a non specific itemdef
is it possible to add a variable for this? as a new request??? because it would be very usefull not only for itemdefs, it would be usefull for chardefs, defnames, maybe regions... and whatever the programmer wanted, as many of them dont have a specific way to make the reference for.

am i losing my mind?

regards Smile
(This post was last modified: 07-12-2014 06:34 AM by kn4tseb.)
07-12-2014 06:10 AM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #22
RE: storing / filtering massive items
better off using the file.object, open up your .scp file and use file.readline, example:
Code:
if (<file.open <path to colored armor.scp>>)
  for line 1 <file.readline end>
    if (strmatch([itemdef *,<file.readline <local.line>>))
      local.x += 1
      local.obj<dlocal.x>=<strsub 10 <eval <eval strlen(<file.readline <local.line>>)> +-11> <file.readline <local.line>>
    endif
  endfor
endif
file.close
if (<local.x>)
  for x 1 <local.x>
    serv.log <local.obj<dlocal.x>>
  endfor
endif

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
07-12-2014 06:46 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Skul's post
Extreme
Grandmaster Poster
***

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

SphereCommunity

Post: #23
RE: storing / filtering massive items
Strmatch(*rose*,<serv.itemdef.<hval <local.x>>.defname>)
Assuming you're using the for loops

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-12-2014 07:07 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: #24
RE: storing / filtering massive items
(07-12-2014 07:07 AM)Extreme Wrote:  Strmatch(*rose*,<serv.itemdef.<hval <local.x>>.defname>)
Assuming you're using the for loops

But which values should i use at FOR LOOPS?

those custom items dont have a NUMBERED ID

the ID is the inhereted to another item

(07-12-2014 06:46 AM)Skul Wrote:  better off using the file.object, open up your .scp file and use file.readline, example:
Code:
if (<file.open <path to colored armor.scp>>)
  for line 1 <file.readline end>
    if (strmatch([itemdef *,<file.readline <local.line>>))
      local.x += 1
      local.obj<dlocal.x>=<strsub 10 <eval <eval strlen(<file.readline <local.line>>)> +-11> <file.readline <local.line>>
    endif
  endfor
endif
file.close
if (<local.x>)
  for x 1 <local.x>
    serv.log <local.obj<dlocal.x>>
  endfor
endif

18:41:ERROR:(sphere_system_1.scp,112)Can't resolve <scripts/items/sphere_item_provisions_armor_color.scp>
18:41:ERROR:(sphere_system_1.scp,112)Can't resolve <file.open >
18:41:ERROR:(sphere_system_1.scp,112)Undefined symbol ''
18:41:ERROR:(sphere_system_1.scp,120)Undefined keyword 'file.close'
(This post was last modified: 07-12-2014 07:38 AM by kn4tseb.)
07-12-2014 07:27 AM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #25
RE: storing / filtering massive items
you put <brackets> around the filename, does not require any.

example:
Code:
if (<file.open some_file.txt>) //opens some_file.txt

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
(This post was last modified: 07-12-2014 07:56 AM by Skul.)
07-12-2014 07:55 AM
Visit this user's website 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: #26
RE: storing / filtering massive items
(07-12-2014 07:55 AM)Skul Wrote:  you put <brackets> around the filename, does not require any.

example:
Code:
if (<file.open some_file.txt>) //opens some_file.txt
PHP Code:
if (<file.open scripts/items/sphere_item_provisions_armor_color.scp>)
  for 
line 1 <file.readline end>
    if (
strmatch([itemdef *,<file.readline <local.line>>))
      
local.+= 1
      local
.obj<dlocal.x>=<strsub 10 <eval <eval strlen(<file.readline <local.line>>)> +-11> <file.readline <local.line>>
    endif
  endfor
endif
file.close
if (<local.x>)
  for 
x 1 <local.x>
    
serv.log <local.obj<dlocal.x>>
  endfor
endif 

19:06:ERROR:(sphere_system_1.scp,112)Can't resolve <file.open scripts/items/sphere_item_provisions_armor_color.scp>
19:06:ERROR:(sphere_system_1.scp,112)Undefined symbol ''
19:06:ERROR:(sphere_system_1.scp,120)Undefined keyword 'file.close'

EDIT: OK OF_FileCommands was disabled.
(This post was last modified: 07-12-2014 08:49 AM by kn4tseb.)
07-12-2014 08:03 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: #27
RE: storing / filtering massive items
if (<file.open scripts/items/sphere_item_provisions_armor_color.scp>)
for line 1 9197 // <file.filelines scripts/items/sphere_item_provisions_armor_color.scp> //<file.readline 0>
if (strmatch([itemdef *rose*,<file.readline <local.line>>))
local.x += 1
local.obj<dlocal.x>=<strsub 10 <eval <eval strlen(<file.readline <local.line>>)> +-11> <file.readline <local.line>>
endif
endfor
endif
file.close
if (<local.x>)
for x 1 <local.x>
serv.log <local.obj<dlocal.x>>
endfor
endif

i got no errors but no logs either, it freezes a bit because of the ~9000 lines read but i got no serv.log Confused
i tried to understand the script but couldnt figure the " local.obj<dlocal.x>=<strsub 10 <eval <eval strlen(<file.readline <local.line>>)> +-11> <file.readline <local.line>>" line
i suppose it should be "local.obj<dlocal.x>=<strsub 10 <eval <eval strlen(<file.readline <local.line>>)> +-1> <file.readline <local.line>>"

ok i got it: local.obj<dlocal.x>=<strsub 9 <eval <eval strlen(<file.readline <local.line>>)> +-10> <file.readline <local.line>>>
(This post was last modified: 07-12-2014 09:37 AM by kn4tseb.)
07-12-2014 09:07 AM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #28
RE: storing / filtering massive items
oh ya, index for strsub starts at 0, good to see you got it resolved.

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
07-12-2014 10:49 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Skul's post
kn4tseb
Master
**

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



Post: #29
RE: storing / filtering massive items
^^
Byw, im trying to recreate my own version of powder of fortifying, does anyone know the hex graphic value of this tile? i have burnt my eyes looking into uo fiddler but i cannot find it, im using a 7.x version of the client so it should be there, anyone please?

EDIT: ohh i think i got it, it must be 01006 with a diff HUE Smile
(This post was last modified: 07-13-2014 10:11 AM by kn4tseb.)
07-13-2014 10:07 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: #30
RE: storing / filtering massive items
Guys, is the property maxuses enabled? or something similar?
i'd like to add "charges" or "remaining uses" to this custom powder of fortifying.

Thanks again ^^!
07-13-2014 04:29 PM
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)