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
forinstances but for types
Author Message
Art
Journeyman
*

Posts: 118
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2012
Reputation: 0



Post: #1
forinstances but for types
Greetings.

Code:
forinstances i_platemail_chest
...
endfor

But i should to check each item on server for type. How i can do it without 'foritems 9999' ?
(This post was last modified: 12-15-2012 10:08 PM by Art.)
12-15-2012 10:07 PM
Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #2
RE: forinstances but for types
there is no internal thing like foritemtypes so most simple solution is running forinstances for all items which has that type, or looping all items with forchars, foritems etc.

another option is you can create little program which read sphere save files and record items uid which has that type to the mysql, after that you can use that data and loop through uids. but this method only work for background changes.
(This post was last modified: 12-16-2012 12:22 AM by Shaklaban.)
12-16-2012 12:20 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #3
RE: forinstances but for types
Code:
FORINSTANCES i_platemail_chest
  if (<type>==t_whatever)
    do function...
  endif
endfor

[Image: 2nis46r.jpg]
12-16-2012 02:59 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Art
Journeyman
*

Posts: 118
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2012
Reputation: 0



Post: #4
RE: forinstances but for types
I should check not only iron platemail chest, but others too.

foritems 9999 checks only items on ground. Maybe i can check, if it's container, then use forcont?

Code:
foritems 9999
if <type> == t_container
     forcont <uid>
     ...
     endfor
endfor

Is it safe?

...

oh yes, also i should check bankbox on characters, and vendor box.. uh.
(This post was last modified: 12-16-2012 03:52 AM by Art.)
12-16-2012 03:49 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #5
RE: forinstances but for types
At best it's going to lag your server, at worse it could hang it.

Are you live?

[Image: 2nis46r.jpg]
12-16-2012 03:53 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Art
Journeyman
*

Posts: 118
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2012
Reputation: 0



Post: #6
RE: forinstances but for types
Well i just put needed function to ON=@ItemEquip to change properties of items.
12-27-2012 06:16 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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