New script if you want to have multiple things happen on the same event.
New script if you want to have multiple things happen on the same event. Does require some scripting knowlegde to use though. If there are any bugs please let me know, but it should work fairly well. If you have any suggestions on how to improve this let me know too! Import it here: http://www.pierrox.net/android/applications/lightning_launcher/wiki/doku.php?id=script_event_bus
]]>
< ![CDATA[
Nice idea!
My tips to improve:
1. You declare all variables global, so they may interfere with other scripts. (especially names like script or event are used often)
-> declare with “var”
2. Instead of using runscript as interface, you could set a script in every load event, which defines functions like subscribe and unsubscribe.
3. If you use semicolons to end your lines the code is easier to read and won’t break when format is lost. (E.g. when copy/pasting from some browsers)
]]>
< ![CDATA[
Thanks for your tips. I actually kinda forgot to polish code before uploading. There was still some debugging code in there and indeed all the “var”‘s and semicolons were missing. I’ll add them in a minute.
What do you mean with “every load”? There is only one load event for each object right?
]]>
< ![CDATA[
The polishing is finally done. Fixed some bugs meanwhile too!
]]>
< ![CDATA[
The getOb function isn’t using the passed parameter. Maybe use two return statements instead of ob variable?
]]>
< ![CDATA[
Oops little derp. It’s fixed now.
]]>