SphereCommunity
List problem - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: List problem (/Thread-List-problem)



List problem - afronola - 05-09-2013 03:52 AM

Code:
[function test]
src.tag.xx <args>
src.say <src.tag.xx>
serv.LIST.<src.tag.xx>.ADD <src.uid>

I left the space this script is as follows.

Code:
.test exa pro

Code:
[LIST exa]
ELEM=" pro.ADD 01"

need to be in this state.

Code:
[LIST exa pro]
ELEM="01"



RE: List problem - darksun84 - 05-09-2013 04:15 AM

In this case it's better to not use blank spaces as separator, in fact you actually have

src.tag.xx = exa pro //ok

I think that the blank space between exa pro will cause "pro.ADD <src.uid>" to become an argument of that list function.

serv.list.<src.tag.xx>.ADD <src.uid> will become serv.list.exa pro.ADD <src.uid>

So you can remove the blank splaces or use commas as separator like

PHP Code:
.test exa,pro
src
.tag.xx = <argv[0]><argv[1]>  // argv[0] is exa and argv[1] is pro
serv.list.<src.tag.xx>.add <src.uid

I think it should work, but i didn't test it.Blush


RE: List problem - Mordaunt - 05-09-2013 04:17 AM

Yeah... you might want to explain a little more clearly what it is you are trying to do here. I know lists but I don't understand what this is supposed to achieve.

If you want the list to just put in the src uid then

LIST.<src.tag.xx>.ADD <src.uid>

would work fine, not sure what your exa and exapro are supposed to be doing


RE: List problem - Alaric - 05-09-2013 04:20 AM

You can't use space and you don't need serv. before it.


list.name_of_the_list.add <src.uid>


RE: List problem - afronola - 05-09-2013 05:08 AM

exa pro is textenry on player. if this i can`t argv.

while i was use
Code:
serv.list.exa pro.add 01
successfuly. why?


RE: List problem - Mordaunt - 05-09-2013 05:14 AM

because pro.add is not a valid thing to do in lists, or in fact anywhere else in sphere:

LIST.xxx to show elements in list. Also, can be used like LIST.xxx=value to clear list and add a value
LIST.xxx.ADD to add new element to list, can be number or string
LIST.xxx.CLEAR to clear list
LIST.xxx.index to read/write value on element in list
LIST.xxx.COUNT to get count of elements in list
LIST.xxx.index.REMOVE to remove element at specified index in list
LIST.xxx.index.INSERT to insert element at specified index in list
LIST.xxx.FINDELEM search_value returns index of first found element in list. Search starting from begin
LIST.xxx.index.FINDELEM search_value returns index of first found element in list. Search starting from index
SERV.PRINTLISTS to print all lists and their elements
SERV.CLEARLISTS to clear all lists. If used with mask parameter, then clear all lists, which name countains specified mask


RE: List problem - afronola - 05-10-2013 12:44 AM

ok, thanks