topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Saturday December 14, 2024, 4:55 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: New FARR plugin : FSubScript enable loading of multiple javascript plugins  (Read 55693 times)

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
FSubScript enable to load multiple javascript plugins in FARR without adding the FScript.dll for each. It should make it easier to write script plugins, share code between them and build a great FARR :)

The latest versions of FSubScript are maintained and improved by CZB. You can get it from the CZB with many plugins.
https://www.donation...ex.php?topic=17153.0
Blog & Projects : Blog | Qatapult | SwiffOut | FScript
« Last Edit: June 06, 2009, 04:20 AM by ecaradec »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
wha?!?!?!?!?!!?!?!?!?!?! ALREADY!!?!?!?!  :o


ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Why do I need to go to sleep now!

FWIW, loads and works here  :Thmbsup:

Oh, I completely forgot ... thank you so much!
« Last Edit: November 11, 2008, 11:02 AM by ewemoa »

Ampa

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 592
  • I am cute ;)
    • View Profile
    • MonkeyDash - 2 Player strategy boardgame
    • Donate to Member
Wow - wow - wow!

This was unexpected - I thought that you might take a look over the weekend, and report back to us that the task was monsterously difficult, but that you might give it a go in the new year.

But no! Instead you whip up a complete solution and drop it on us like a 100 ton bomb of javascripting goodness :)

Congratulations on a supreme effort!

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
I think it needs a better name than "Scripter"..

Maybe EMSF (ecaradec's mutiscripter for farr)?
or FMS (farr multi-scripter)?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Couldn't get it to quite work here ...
i put Scripter and Colors both in a new parent directory.
Scripter was loaded by FARR, and it seems to have found the Colors script -- since if i typed scipter it listed "Colors"

but typing: colors

had no effect (just showed files with the word colors in them).

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
Sub-plugins are exposed as modifiers. You have to type : "scripter +colors". It also complete with tab.
I agree that scripter is a very bad name. I didn't change it because I hardcode it in many places.

I'll let everybody propose names for the plugins. FMS is nice by the way.
Blog & Projects : Blog | Qatapult | SwiffOut | FScript

czb

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 336
    • View Profile
    • My open-source online piano game
    • Donate to Member
Hi,
first of all, thank you for your share :Thmbsup: .I have also been thinking of providing similar solution, but I was waiting if you are going to solve it on dll basis, since such a solution is javascript limited.

I am not familiar with how the plugin system works, but I guess dll basis might involve direct modifications of FARR as well, which might be long run development.

Another semi-solution which comes into my mind as non C++ programmer might be to create a dll file which would just point to a real fscript.dll. So the pointer would take fscript.dll as some kind of library. Then under any modification of fscript.dll, the pointer would remain unchanged.
My open-source online piano game: https://github.com/musicope/game

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
This is a FScript based plugin. Sub-plugins are in fact plugins for the scripter plugin, not directly FARR plugins. There isn't any support for regex based search, and I'm not sure that I could add it.

The nice thing is that it will allow to develop a librairies around the scripter plugin to help developpement of future sub-plugins.
The not the good is that all scripts are loaded in the same script engine (this is what will allow the first point ) and that means that plugins can interfer each others. It is relatively pointless to create plugins that would break the system so I hope that future plugins writers will take care of not breaking their environment. Currently plugins could remove others plugins, break them but also add them dynamically.
Blog & Projects : Blog | Qatapult | SwiffOut | FScript

czb

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 336
    • View Profile
    • My open-source online piano game
    • Donate to Member
Yes you are right that it brings quite significant advantages and can faster development of JS plugins.

For example I guess FARR update system will not work for it, but I can imagine script plugin to be used for new JS plugin installations, maintanace etc.

Well if you do not mind I can make my new goal to make kind of sofisticated JS plugin portal, or we can make it a colaborative work together with other JS coders (ewemoa etc) :)
My open-source online piano game: https://github.com/musicope/game

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
This is a FScript based plugin. Sub-plugins are in fact plugins for the scripter plugin, not directly FARR plugins. There isn't any support for regex based search, and I'm not sure that I could add it.

Having looked at the code.. it really doesn't seem that hard to add all of these things:
1) regex support for each plugin
2) custom icons for each plugin
3) ability to disable and enable individual scripts

Because in essence you've showed how to make a set of functions as an array element that can be iterated through.
For example instead of using plugins["colors"]={..code..}
It could be done like plugins["colors"]["regex"]= "color .*" and then plugins["colors"]["icon"]="coloricon.ico" and plugins["colors"]["code"]={ .. code..}

Am i wrong?

And as for update support -- that's not a problem at all -- the updater doesnt care if it finds 20 different .dcupdate files in a plugin directory, so each little script can have its own update file.


mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
One downside.. this only works for javascript not the other fscript supported languages.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
ecaradec has gotten us started with this and shown us the way to multiscripts.. now we need a javascript coder to pick up the ball and run with this.. to extend the concept to allow:
  • each script to have its own regex pattern matching
  • each script to have its own icon, description, help
  • each script to be able to implement custom trigger handling
  • some sort of script management to allow scripts to be enabled and disabled

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
I'm willing to start taking a look.  To be frank though, I'm not clear currently on how all of the points you mention might be carried out.  Perhaps some of the details can be discussed here?

Below is an attempt at following up on some of the points mentioned so far.

  • The per-script icon, description, help, and .dcupdate seem straightforward as you have already described.
  • Do you think script management would be a matter of tracking an enabled/disabled value per script?  Is there an issue with asynchronous processing?  How might enabling/disabling a script be affected by this?
  • As far as UI is concerned, a simple starting point might be a dialog box appearing via Scripter's "Configure Advanced Plugin Options" button.  However, does it seem doable to achieve per-script configuration via the Plugin Manager dialog box (at least eventually)?
  • I'm in the dark about regex pattern matching for each script.  Storing and referencing a regular expression string per-script seems straightforward, but how the resulting regex is used by Scripter to work with FARR is not clear to me.  If someone already has a clear idea of what to do, I'd be happy to hear it :)
  • I didn't understand what you meant by "custom trigger handling" -- does this refer to onProcessTrigger(), onReceiveKey(), and the like?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
I didn't understand what you meant by "custom trigger handling" -- does this refer to onProcessTrigger(), onReceiveKey(), and the like?

Yep.  Basically the parent script has to iterate through each of the multiscripts and see if any want to handle each call.


I'm in the dark about regex pattern matching for each script.  Storing and referencing a regular expression string per-script seems straightforward, but how the resulting regex is used by Scripter to work with FARR is not clear to me.  If someone already has a clear idea of what to do, I'd be happy to hear it

Again basically the parent script needs to take each RAW search, and iterate through each of the multiscripts and see if any of them should handle it based on their own regex match.


As far as UI is concerned, a simple starting point might be a dialog box appearing via Scripter's "Configure Advanced Plugin Options" button.  However, does it seem doable to achieve per-script configuration via the Plugin Manager dialog box (at least eventually)?

I think we are on the same page.. basically when user says to do advanced config of the parent manager script, it should show a page of options.  this page might look like a checklist box of each multiscript plugin found, where individual scripts could be enabled or disabled.

If individual plugins wanted to have their own options.. there would be a few choices.. you could have a button next to each multiscript to show *ITS* options, or maybe a simpler method would involve each mutliscript providing some html text with some form inputs that would be for that scripts options, and the multiscripter would present all form htmls on one page.  And then let the multiscript save all the variables using the new UserVars option in FARR.

This is the most confusing and advanced part of multiscripts and i think for now these options ideas can just be ignored for version 1.


Do you think script management would be a matter of tracking an enabled/disabled value per script?  Is there an issue with asynchronous processing?  How might enabling/disabling a script be affected by this?

I really don't see any issue here -- all you are doing is telling the mutliscript supervisor to ignore certain scripts and not even bother to call them with a chance to match search or trigger result.. shouldnt be a big deal.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
One thing we should keep in mind -- i know ecaradec is doing a bit more work on this as we speak -- so it might make sense to hold off messing with the code until ecaradec is ready to pass the torch to someone else -- just to avoid duplication of effort.

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
I'm broke :)

I improved the now renamed FSubScript. There was some bugs in icons, results triggering, that should be now fixed. I also added a system to handle settings using ahk plugins. I made some improvement to make the scripts look like more like normal plugins. There might be bugs. There are centainly bugs.
However FSubScript begin to be usable. I'll let the dc community write all those wonderful plugins for farr that I hope FSubScript will help.

Tips :
- The new alias is fssc : for FarrSubSCript. Type fssc +colors to try the useless sample plugin.
- Don't define an alias for the plugins. It doesn't work currently. I need to use the groupname to identify subplugins and groupname is overwritten when an alias is defined.

See the links in the first post for downloading the last version.   :-*
Blog & Projects : Blog | Qatapult | SwiffOut | FScript

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Thanks for your continued efforts!

I had some fun pasting RGB triples  ;)

Hope to have something more substantial to add before too long.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Thanks ecaradec for:

function onProcessTrigger(path, title, groupname, pluginid, thispluginid, score, entrytype, args)

I am having more luck experimenting with file associations being handled by FARR (overriding / ignoring registry-based settings)  :Thmbsup:

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
I put together a FSubScript plugin - Akete.

Briefly, this allows one to customize launching of files via FARR.  A user can specify a file-extension -> executable association [1] via FARR's User Variable support.  The archive contains a README.txt with details.


[1] Live free of the registry -- long live portable apps :)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
FSubScript: i like the new name.  And great progress!! The one thing i think is really key is being able to have the subscripts run using their own independent keywords and regexes.

ewe:  going to try Akete right now.  What is especially cool is that your script might be first plugin to actually take over launching of normal files, which would serve as a great example for others wanting to know how to do it.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Where do we put the scripts? in a subdirectory of FSubScript?

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
The one thing i think is really key is being able to have the subscripts run using their own independent keywords and regexes.
Do you mean configuring them ? or using them ?
I tried to use aliases for the independent keywords but it does not work right now because the alias replace the group name. This is why I needed to use the void parameters but it does not seem to work right now as I said. This would be nicer because it would allow the subplugins to look more like ordinary plugins

I put together a FSubScript plugin - Akete.
Felicitation you are a pionner of a new era :)
For your question in the plugin about the settings : One way to create options is to send a autohotkey executable, however you can do it the way you like. You need to send a message WM_USER+1 to the window name FScript/FSubScript. Autohotkey program can do this. However an IE with a registered custom protocol could do it to. UI in javascript is a bit tricky. I think I like the autohotkey solution the more.

I don't know if it is better to set script plugins in a subdirectory of fsubscript, or in a subdirectory of plugins or directly with other plugins. I like the solution 3 because it mean that it is a normal plugin. However, they are not normal plugin. It may not be a good idea. I'm not sure what's best.




Blog & Projects : Blog | Qatapult | SwiffOut | FScript

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
i guess i dont know how to have a script actually be discovered by fsubscript..
it worked with early versions of multi script but not with current one.. when i bring up advanced options i just get empty list box.

i think it makes sense to have scripts be in subdirectory of fsubscript.

also i dont understand what you are saying about sending a windows message to fsubscript.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
ok i see why it wasnt finding the subscripts -- you have it looking in one directory deep inside the parent directory.
moving the scripts to the main Plugins directory makes it work.

i'll note that if you make it search arbitrarily deep in the parent Plugins\ directory, it would find subscripts whether they are in their own top level plugin directory, OR subdir of FSubScript, which would be nice and handle all cases.