08 Feb, 2007, Justice wrote in the 21st comment:
Votes: 0
The library I'm using is:
http://www.mozilla.org/js/spidermonkey/

Takes a little to get up to speed, but I can provide examples if anyone needs them.

// Setup Global Object
global = JS_NewObject(js_context, &global_class, NULL, NULL);

JS_InitStandardClasses(js_context, global);
js_init_global(js_context, global);

// Add Error Reporter?
JS_SetErrorReporter(js_context, &js_error_reporter);

// Read context
ok = JS_EvaluateScript(js_context, global,
argument, strlen(argument), "static", 0, &rval);

// check for error
if (ok == JS_FALSE)
{
bug("There was an error");
}

// Cleanup
JS_ClearScope(js_context, global);
JS_GC(js_context);
09 Feb, 2007, Davion wrote in the 22nd comment:
Votes: 0
You could always write an article on a basic way to attach JS to Smaug, and then it could be expanded by others as they learn more ;)
10 Feb, 2007, Guest wrote in the 23rd comment:
Votes: 0
Yes, I think an article on embedding javascript as an alternative scripting language would be a good thing.

But why stop there? Lua, Python, and others also scream out to have similar articles if anyone knows how to do that :)
12 Feb, 2007, Fizban wrote in the 24th comment:
Votes: 0
Hmm, I'll look into the OasisOLC for Smaug idea, that could be quite ideal. From a code standpoint I do generally prefer Smaug/ROM over CircleMUD and Smaug with OasisOLC and DG Scripts would work quite well.
12 Feb, 2007, kiasyn wrote in the 25th comment:
Votes: 0
I really want to embed php, im just not sure its possible ;)
12 Feb, 2007, Omega wrote in the 26th comment:
Votes: 0
anything is possible if you believe Kiasyn!
27 Feb, 2007, killstheweak wrote in the 27th comment:
Votes: 0
I ported part of OasisOLC to smaug way back in '99 i think, i posted it to the smaug mailing list, and got bitched at cause the post was to big :P It had one bug which i eventually fixed. I think the part i converted was redit, oedit, and medit, was missing some of the smaug options tho. It's in the smaug mailing list archives somewhere, probably take some digging to find it.
20.0/27