User forums > General (but related to Code::Blocks)

Angelscript

(1/2) > >>

tiwag:
i would like to use/test the angelscript scripting features of C::B

can we have some information about how to use,
which functions of C::B could be triggered from a scipt, ...

maybe a few examples would be fine !

thx
--tiwag

mandrav:
It hasn't been decided yet where and how it 'll be used :P
Now that you started this thread, I 'd like to ask folks to post their ideas/opinions on how to use scripting. Where would be appropriate to put hooks etc.

I must bring the current bindings up to date (this is easy), since the SDK has changed enough.
Then I 'll give you a couple of examples ;)

mandrav:
Well, that was quick ;)
I only had to change one binding, from what I saw.

Update to latest revision (at least 1775).
Create a file, say "test.script".
Paste the following in it:

--- Code: ---int main()
{
    // adjust the path to one of your projects
    Project@ prj = ProjectManager.LoadProject("C:/Devel/glfw/glfwapp.cbp", true);
    ShowMessage("Project loaded :)");

    ProjectManager.CloseProject(prj);
    // or
    // ProjectManager.CloseActiveProject();

    ShowMessage("Project closed :)\nBye.");
    return 0;
}

--- End code ---

Choose "File->Run script".
Select your script :)

I 'll document the already exposed classes, maybe tonight, so you can play some more with it.
The bindings are in sdk/as/scriptbindings.cpp, if you want to take a look yourself :)

tiwag:
works nice !
i'll look into the sdk/as/scriptbindings.cpp too

thx

takeshimiya:
Can scripts ran from pre/post build steps?

Like Post-build step: as somescript.script.

Another thing:
Having AngelScripting outside C::B (binding stdlib, stl, and some filesystem portable library only) would be great also, for using as a common python/perl/bash/batch script replace.

It could be used in situations like in C::B own project update.bat/update.sh, and use only one instead update.script.
In that particular case, I don't know if it'll be desirable, but for personal project that will be an improvement (I don't want to learn entirely bash or other languages only to do some basic command line scripting).

Navigation

[0] Message Index

[#] Next page

Go to full version