SphereCommunity
.add dialog - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Submissions (/Forum-Script-Submissions)
+--- Thread: .add dialog (/Thread-add-dialog)

Pages: 1 2


.add dialog - XuN - 11-01-2013 04:11 AM

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]


RE: .add dialog - Extreme - 11-01-2013 05:34 AM

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!


RE: .add dialog - Monty - 11-04-2013 01:02 AM

Awesome, this is big advance for adding a items/chars in to world.
Good job


RE: .add dialog - Rattlehead - 11-04-2013 07:23 AM

to add to extremes post, it would be nice to have a replace function;

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

Wink


RE: .add dialog - XuN - 11-04-2013 11:50 PM

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.


RE: .add dialog - XuN - 11-05-2013 04:52 AM

Updated again to v1.2, read first post for details.


RE: .add dialog - amonvangrell - 11-05-2013 08:17 AM

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!


RE: .add dialog - XuN - 11-05-2013 08:46 AM

Ty Smile

I will take a look into that search box asap.


RE: .add dialog - XuN - 11-05-2013 09:03 PM

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.


RE: .add dialog - XuN - 11-08-2013 01:26 AM

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).