[script] get a list of some variables???

Groove
Posts: 218
Joined: Thu Apr 17, 2014 10:36 pm

[script] get a list of some variables???

Post by Groove »

SO i want to be able to list all variables that start with a certain word

like to build a list of loaded plugins, or all loaded scripts - for example, autoload adds $Autoload::ran* values

$Autoload::ranCore/Misc.cs = "true";
$Autoload::ranCore/OC3Patch.cs = "true";

for each of the scripts it hits

pluginloader adds

$LoaderPlugin::ChatMenu = "True";
$LoaderPlugin::ScriptGL = "True";
$LoaderPlugin::TransChat = "True";

i'd like to be able to list all of those values that start with $Autoload::ran or $LoaderPlugin:: and use them in an array

but i dont know how many there will be or what they will be named

is that even possible?

failing that, could i export($LoaderPlugin::*, mylistofplugins.cs); and then somehow use that file?

(i guess worst case scenario i can maybe modify autoload and pluginloader to make the array at the same time they add those vars?)

plaes halp
bawb
Posts: 39
Joined: Thu Feb 26, 2015 12:21 pm

Re: [script] get a list of some variables???

Post by bawb »

Auto create the array when you define the variables, or type $LoaderPlugin:: into console and hit tab to scroll through the list that way lol
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: [script] get a list of some variables???

Post by perrinoia »

The console doesn't auto-complete, bob, but that is an excellent idea for a plugin.
Image
bawb
Posts: 39
Joined: Thu Feb 26, 2015 12:21 pm

Re: [script] get a list of some variables???

Post by bawb »

Is it only for functions?
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: [script] get a list of some variables???

Post by perrinoia »

I don't believe it auto completes for functions either.

You can use the up and down arrows to repeat a command that you typed previously, just like the chat hud, but I don't know if any auto complete abilities.

It also frequently echoes helpful information when you type a command and neglect the arguments.
Image
bawb
Posts: 39
Joined: Thu Feb 26, 2015 12:21 pm

Re: [script] get a list of some variables???

Post by bawb »

Yeah it does. Type "object" into console and hit tab
perrinoia
Site Admin
Posts: 3732
Joined: Sun Jul 01, 2012 7:18 pm

Re: [script] get a list of some variables???

Post by perrinoia »

Wow, I never knew it did that... I just tried it with each letter of the alphabet, and this is what it filled in!
  • abs();
    BanList::add();
    C::Clear();
    dataFinished();
    echo();
    File::copy();
    Game::EndFrame();
    hideToolWin();
    Include();
    JGBuddyCombo::select(
    kill();
    L::Clear();
    mapEditor();
    net::kick();
    Object::getName();
    playDemo();
    Quickstart();
    SAD();
    table();
    underground();
    vChatMenuHud::Create();
    WaypointToWorld();
    xmlizename();
    y
    zadmin::getWeapon();
Interesting fact, I wrote 1 of those functions, so they're not all internal to the exe, it's pulling functions loaded from script, too.
Can you guess which one I wrote?
Image
Groove
Posts: 218
Joined: Thu Apr 17, 2014 10:36 pm

Re: [script] get a list of some variables???

Post by Groove »

it autocompletes variables and functions no prob, even inside other commands

so you can type $pref::what, and then hit tab and it'll autocomplete it with vars that starts with $pref::what

but you can also type echo($pref::what and hit tab and it'll fill in the var inside the echo command
Groove
Posts: 218
Joined: Thu Apr 17, 2014 10:36 pm

Re: [script] get a list of some variables???

Post by Groove »

something interesting to try - export all functions from 1.3 and then do the same in 1.4

lots of odd little differences and added funcs in 1.4

lots of new math that i already knew was in there too but also HTML/XML related stuff like div and span, htmltag(), htmlemit and xmlizename

a few i'm curious about - isFunction() ? also a bunch of Stack functions?

i dont think Control::getId(); was in 1.3 either was it?
User avatar
Fixious
Posts: 475
Joined: Sat Nov 09, 2013 12:42 am

Re: [script] get a list of some variables???

Post by Fixious »

lots of new math that i already knew was in there too but also HTML/XML related stuff like div and span, htmltag(), htmlemit and xmlizename
Likely for PlayTribes (browser version)?
Post Reply