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
.add dialog
Author Message
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #1
.add dialog
I have done this dialog to update the old-prehistoric menu using deflists.

Note: A release version that supports DefLists is needed. and also adding this to sphere.ini

Code:
[RESOURCELIST]
ITEMDEF
CHARDEF

To install it type .f_add_setup and wait ~30seconds until it finishes.
Once installed you can go to the script and remove the COMMENT on f_oncommand to use .add and overwrite de default .add function or type .add1 directly.

Code:
Normal Version
V1.1: Updated the whole lists names and reworked the full system, uses ~250kb less in spheredata. Note if you are updating from version 1.0 use .f_add_update, if not f_add_setup

V1.2: Removed tilepic from items/chars selections, now they have a button that creates another block more with info about items and a small and simple entry for spawn that npc.

v1.3: Using tags instead of args to  create the lists, so categories,etc with commas doesn't get fucked up in the proccess (This fixes some categories wrong sorted).
        -Now each block is showing 1 entry less so it shows a header of the menu you are on and a count of entry/total entries and page/totalpages in the items/chars section, also removed this from the top of the dialog in preparation for search box

v1.4: Added search function, it is not as fast as it should so it comes with a def to enable/disable for living servers.


http://forum.spherecommunity.net/sshare.php?download=267

Code:
SQLite Version
V1.1: Fixed items/chars not being created because of uncomplete transaction from lists to sql.
http://forum.spherecommunity.net/sshare.php?download=281 (SQLite version)

[Image: tzio.png]

[Image: w9zr.png]
(This post was last modified: 03-01-2014 01:10 AM by XuN.)
11-01-2013 04:11 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes XuN's post
Extreme
Grandmaster Poster
***

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

SphereCommunity

Post: #2
RE: .add dialog
Hello man!
Nice script, uhh?!

I have one idea for you, instead join the words with underline, you could try use the STRTRIM function.
It will lower the time to make the list anyway.

Here is the example:
PHP Code:
STRTRIM
This 
function be used to strip all whitespace (spacestabsnewlinesfrom the start and end of a string.

The following script demonstrates this:

[FUNCTION 
f_strtrim]
LOCAL.TEXT "     TEST     "
SERV.LOG 1. <LOCAL.TEXT>
SERV.LOG 2. <STRTRIM <LOCAL.TEXT>>

When runthe following output will be seen on the Sphere console:

1.      TEST     
2. TEST 

Good job!

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.
11-01-2013 05:34 AM
Find all posts by this user Like Post Quote this message in a reply
Monty
Apprentice
*

Posts: 40
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jun 2012
Reputation: 1



Post: #3
RE: .add dialog
Awesome, this is big advance for adding a items/chars in to world.
Good job

C# application developer.
C/C++,SQL,PLSQL programming.
Oracle database / information system developer.
Cooperation for development of new shard.
11-04-2013 01:02 AM
Find all posts by this user Like Post Quote this message in a reply
Rattlehead
Master
**

Posts: 290
Likes Given: 3
Likes Received: 8 in 6 posts
Joined: Jun 2012
Reputation: 8



Post: #4
RE: .add dialog
to add to extremes post, it would be nice to have a replace function;

STRREPLACE("poop", "crap", <local.string>)

Wink

[Image: matts_siggy.gif]
(This post was last modified: 11-04-2013 07:24 AM by Rattlehead.)
11-04-2013 07:23 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #5
RE: .add dialog
Updated the script, now it uses a different way of listing items much more cleaner and easier, not even using text for lists, so it's not using these strfunctions anymore.

Warning: (Only for updating the script) Once you replaced the script, type f_add_update ingame and wait until it removes old lists and it creates new ones.

Added also (count/totalcount) in top of dialog for Categories and Subsections, so you can see how much of them you have (I'm thinking on a way to make it shorter to do not exceed the dialog limits, and also for showing the total count of items/npcs in each subsection).

New screenshot added to post #1 to replace the old one.
(This post was last modified: 11-05-2013 01:22 AM by XuN.)
11-04-2013 11:50 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #6
RE: .add dialog
Updated again to v1.2, read first post for details.
11-05-2013 04:52 AM
Find all posts by this user Like Post Quote this message in a reply
amonvangrell
Banned

Posts: 337
Likes Given: 17
Likes Received: 32 in 20 posts
Joined: Aug 2012

britannia shard

Post: #7
RE: .add dialog
this is amazing...!! i was doing something similar but your scp its far better... ;]
one question, is it possible to add a search box that dig on the list for an specific item and make it easy to find what you are looking for?

keep going man this is so great!

+1 rep for you!
11-05-2013 08:17 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #8
RE: .add dialog
Ty Smile

I will take a look into that search box asap.
11-05-2013 08:46 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #9
RE: .add dialog
v1.3 Using tags instead of args to create the lists, so categories,etc with commas doesn't get fucked up in the proccess.

Now each block is showing 1 entry less so it shows a header of the menu you are on and a count of entry/total entries and page/totalpages in the items/chars section, also removed this from the top of the dialog in preparation for search box.
11-05-2013 09:03 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #10
RE: .add dialog
I didn't post anymore, but after some testings (and lack of more ideas) i have to say that is pointless to have a search box, since it should run among all lists serching and it can take up to the same time its taking creating them, so no point of waiting 30s for a search (freezing the server in the proccess).
11-08-2013 01:26 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes XuN's post
Post Reply 


Forum Jump:


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