Scripting Question about creating files
All  1-4  5-14

Previous
Next
 From:  Larry Fahnoe (FAHNOE)
9665.5 In reply to 9665.4 
There isn't really a current API guide, but I've found studying Michael's code (particularly the .js and .htm files in MoI's commands directory) to be quite helpful in developing a sense of how the API works. The v3/4 release notes also contain numerous hints about scripting and the API as do the forum posts.

v3 release notes: https://moi3d.com/wiki/V3Beta
v4 release notes: https://moi3d.com/wiki/V4Beta

--Larry
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Teddy Lindsey (TEDDYLINDSEY)
9665.6 In reply to 9665.5 
Thanks for the tips, Larry! I will spend more time poking around in the commands directory and reading the release notes in more detail.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9665.7 In reply to 9665.4 
Hi Teddy, there is also some info here but not much sorry:
http://moi3d.com/wiki/Scripting

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Teddy Lindsey (TEDDYLINDSEY)
9665.8 In reply to 9665.7 
Going through existing scripts from others has been very helpful.

What version of the Javascript/ECMAScript interpreter is built into MOI? I've found that newer language features like the "for-of loop" don't seem to be supported.

Thanks,
Teddy
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
9665.9 In reply to 9665.8 
I believe it is ECMAScript5 = ECMAScript2009 = Javascript5 = ES5

Babeljs.io can be used online to convert ES6 to ES5. Use the "try it out" tab.

ECMAScript6 has the confusing year 2015 name.
ECMAScript6 has "let" and (weird to me) function naming, and weird double arrows. And I think Cosh() and Sinh().

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9665.10 In reply to 9665.8 
Hi Teddy, yes I think it only supports ECMAScript5 like Brian writes above.

The interpreter is JavaScriptCore that comes with QtWebKit with Qt 5.4.1 .

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
9665.11 In reply to 9665.10 
Hi Michael,
I wanted to use Math.js for complex numbers and elliptic functions, and possibly other functions, but notice that it is
at least ES6 (ECMAScript 2015. Do you think MoI v5 may have ES6 or later compatibility?

I guess I can translate some of Math.js to ES5...

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9665.12 In reply to 9665.11 
Hi Brian, it will take quite a bit of work to update the scripting engine so I'm not sure when that could happen. Probably not for MoI v5.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
9665.13 In reply to 9665.12 
Thank you Michael.

EDITED: 7 Dec 2020 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Message 9665.14 deleted 7 Dec 2020 by BEMFARMER
 

Reply to All Reply to All

 

 
 
Show messages: All  1-4  5-14