PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
ListTextCommands()

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> Development Discussion
Display posts from previous:   

Author Message
Gnafu



Joined: 02 Feb 2006
Posts: 88
Location: Livorno, Italy

PostPosted: Fri Oct 06, 2006 10:18 am    Post subject: ListTextCommands() Reply with quote

Hi everyone,

I need to know what does it returns the function ListTextCommands().

I red the docs but if a copy of the result of this command will be helpfull for me.

(just a
var res:=ListTextCommands();
syslog(res);
)

I need to convert this command into something usable with the 096 version (i'm trying to fix the control pkg for 096).

I can't run the 097 on my pc, that's why i need someone-else's help.

Thanks in advance!!

Author Message
CWO



Joined: 04 Feb 2006
Posts: 685
Location: Chicago, IL USA

PostPosted: Fri Oct 06, 2006 1:15 pm    Post subject: Reply with quote

I think its something like this:

res[pkgname][cmdlevel].cmdname

and cmdname is also a struct with .dir and .script


its either that or I'm very close to it.

And its not possible to do this on 096 unless you actually create the entire variable manually.

Author Message
Gnafu



Joined: 02 Feb 2006
Posts: 88
Location: Livorno, Italy

PostPosted: Sat Oct 07, 2006 4:46 pm    Post subject: Reply with quote

I was planning to create a cfg file and to use it to create it

Author Message
Austin
POL Developer


Joined: 30 Jan 2006
Posts: 354
Location: San Diego, California

PostPosted: Tue Oct 10, 2006 12:54 am    Post subject: Reply with quote

Code:

PolSys::ListTextCommands() - Returns a dict of a dict of structs.
                Dict 1 - Package names Dict 2 - Command levels Struct - .dir .script
                Example:
                  foreach package in ( commands )
                     Print("Pkg:"+_package_iter);
                     foreach level in ( package )
                        Print(" CmdLvl:"+_level_iter);
                        foreach command in ( level )
                           Print("     "+command);
                           SleepMS(2);
                        endforeach
                        SleepMS(2);
                endforeach
             SleepMS(2);
             endforeach

Author Message
Gnafu



Joined: 02 Feb 2006
Posts: 88
Location: Livorno, Italy

PostPosted: Thu Oct 12, 2006 1:28 pm    Post subject: Reply with quote

Austin... thanks, but i've read that before...
and i noticed it was an "Exaple" so i was asking the true struct of the return...

Author Message
Marilla



Joined: 02 Feb 2006
Posts: 329

PostPosted: Thu Oct 12, 2006 8:47 pm    Post subject: Reply with quote

The documentation quoted above tells you exactly what is returned, and the example shows you how you might use it to iterate through all the commands.

It returns a dictionary of dictionaries of structs.

The outer dictionary has as it's keys the names of the packages on the server. Each of the values of that dictionary is itself a dictionary of the command levels. Finally, each of the values of those entries are structs with .dir and .script members.

That's essentially exactly what the quoted text above says.

Post new topic   Reply to topic    PenUltima Online Forum Index -> Development Discussion All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty