Jscript Recorder

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

Jscript Recorder // Scriptorium

1  |  

Post by jamesmc // Jan 15, 2008, 7:09am

jamesmc
Total Posts: 2566
How does it work?


Where are the results put?


Is the Jscript put out reusable?

Post by Délé // Jan 15, 2008, 9:47am

Délé
Total Posts: 1374
pic
The jscript and vbscript macro recorders are invaluable. That's where I learned a LOT of the scripting that I know. It can show you trueSpace functions and how to use them.

- Just press the macro recorder of your choice to bring up the toolbar.
- Press record
- Do something (ie: move an object in 3d, change a value on a node, etc.)
- Press stop

When you press stop a new node appears in the LE called "Recorded Macro". If there are already recorded macros in the LE it may be called "Recorded Macro, 1" or "Recorded Macro, 2", etc. If you go inside of the recorded macro you can see the actions that you recorded written in script.

The first block of code (A block of code is between two brackets {}) is pretty much useless, you see it in all macros. However, in the second block of code you will see your recorded actions. You can run the macro and it will execute the script. You can also copy that script and reuse it in your own scripts. If you examine it, you will see different ways you can alter it so that it works with other objects or uses different values.

Recorded macros don't ever display if/else statements or loops or anything to my knowledge. So if you want to learn that kind of basic scripting stuff you might want to check out the Microsoft MSDN (link below). You can also check out scripts that others have written to see how to do conditional statements, loops, arrays, and stuff like that.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/scriptinga.asp

-hth

Post by frootee // Jan 15, 2008, 10:01am

frootee
Total Posts: 2667
pic
The script macro recorders, as Dele pointed out, are truly invaluable. I think we need to present the use of these at a Scriptor Meeting. Anyone want to discuss it sometime soon? Either tonight or next week maybe? :)

Post by trueBlue // Jan 15, 2008, 10:09am

trueBlue
Total Posts: 1761
pic
It might be worth mentioning that there is two ways to start a jScript/VBscript recording.
1.) With something selected.
With something selected first, is useful when you want to apply the recorded macro to other objects with different names. IE: a Cube or Sphere or MyCubeNamedtrueBlue.
2.) Without anything selected.
Without something selected first you could apply a recorded macro to a certain named object. IE: record selecting the object first and record the macro.
These are only two examples but I am sure there is others.
Also you may note that not all actions can be recorded.
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn