How do I extend monkey ?

Community Forums/Monkey Talk/How do I extend monkey ?

semar(Posted 2011) [#1]
Hi all,
if I want to extend Monkey in HTML5 field, how do I do ?

For example, if I want to implement a new JavaScript command, ex.
function myAlert(s){
alert(s);
}

Which files should I modify, so that Monkey can recognize the new command ?

I've tryed to modify accordingly the HTML5.js, but if I type the new command inside the IDE, I get a syntax error.

Regards,
Sergio.

Last edited 2011


Warpy(Posted 2011) [#2]
My Extern example seems not to have been included in the final monkey package! I'll make a post over on monkeycoder.co.nz


Warpy(Posted 2011) [#3]
edit: just realised it's not really suitable for an app on monkey coder, because the page consists of more than just the canvas element.

Download the code from here.

Last edited 2011


Canardian(Posted 2011) [#4]
There is no .monkey source code in your example? What does this extern mean here, manually editing the output files?


Warpy(Posted 2011) [#5]
Oops. Re-uploaded, with the code!


Canardian(Posted 2011) [#6]
Ahh very cool of you, thanks! :)
I made yesterday this website for monkey developers, called http://www.monkeytools.net
Can I write an article about your extern technology there?

I also found that some very simple things or very specific things don't fit in the official monkey website, so I felt the need for a independant website which just has tools for monkeys. I will make it similar to the NeHe website, just little useful tools (tools can be ideas, examples, tutorials, hacks, etc...).

Right now I'm working on a MinGW hack to compile GLFW targets, which I will also publish as an article.

Last edited 2011


GW(Posted 2011) [#7]
Warpy, that's pretty nifty, but You'll have to do a writeup/Breakdown as some things are a bit ambiguous.

Last edited 2011


Warpy(Posted 2011) [#8]
ok

lumooja - feel free to copy my post on to monkeytools

Last edited 2011


Canardian(Posted 2011) [#9]
Awesome, thanks Warpy!


semar(Posted 2011) [#10]
Thousand thanks Warpy, very nice from you :)

Now I can try to implement an Ajax call from within Monkey :)

Best regards,
Sergio.


Chroma(Posted 2011) [#11]
Lumooja, are you going to set up a code repository so we can post snippets there at MonkeyTools.net?


TartanTangerine (was Indiepath)(Posted 2011) [#12]
@ Semar - already done it for you : http://www.monkeycoder.co.nz/Community/posts.php?topic=137


semar(Posted 2011) [#13]
EXTREMELY interesting indeed.. :)

Thanks,
Sergio.

Last edited 2011


Canardian(Posted 2011) [#14]
@Chroma: I think code snippets should be posted in the official monkey forums. I will only put stuff on monkey tools which are something what the official forums don't cover (yet), maybe more like tutorials, tips and tricks, etc....

If the official forums get developed more, and have all features which monkeytools will have, then I don't need monkeytools anymore. But I think it takes a long time to happen, that's why I made a quick decision to open monkeytools.net to have an extended place to publish monkey related stuff.

The next step is to organize all articles into categories, so it will be like a library.

Last edited 2011


Canardian(Posted 2011) [#15]
I combined two tutorials into one, so here's how to use the extern command and the target command:
http://www.monkeytools.net/articles/Adding_new_commands_to_Monkey