Interface constructor


  • administrators

    During last month I'm working on the interface constructor.
    For today, the functionality is ready for 80% and a new version of BAS will be released in a week, in which premium users will be able to completely change the interface of compiled bots.

    Here is the link to the interface generated by the constructor(all fields and controls are clickable).
    https://bablosoft.com/test-interface/index.html
    After the next update, you can make any bot look the same as on previous link.

    And here is a link to interface constructor, where you can edit bot appearance using the visual design components and change the logic with the help of javascript.
    https://bablosoft.com/interface-builder/index.html
    By following this link you can also check how your bot will look with the new interface.

    Below is a detailed description of the next update as a list of the main features:

    With the new version you will be able to run bots right in the browser.
    When a bot starts, it will not open the BAS interface, as before, instead it will open default browser installed in your system.
    And will display the interface created by the bot developer.
    BAS will run in background and will be controlled from this browser.
    This approach offers many advantages.

    Bot interface can be changed as much you like.
    When creating bot interface you are not limited to anything and can do everything that is possible in a browser.
    You can add third-party libraries, styles, etc., not only make minor changes, but completely change the appearance of the bot.
    For example, there were requests to change the interface in this way,
    so that the input parameters are always displayed, and not only on the first window.
    Now it's possible, and only you decide how your bot will look like.

    The logic of the bot interface can also be changed.
    Bot interface logic is codded with javascript and you can change it.
    For example, it's easy enough to add a check so that the input field contains exactly the mail in correct format
    and output your error message. Or, to output not all messages to the log, but only messages about successful registration.
    Or even remove the log, and display information through notifications in the browser.

    Bot interface can be generated automatically from the BAS project.
    You do not need to write interface from scratch. The interface designer will do this for you.
    But unlike the interface that is generated now, you will have the opportunity to change it.

    Simple changes do not require knowledge of programming language.
    This changes can be implemented directly with the interface designer(without updating code).
    Here are examples of such changes: change the text of the button, change the color of any element, and any other parameters,
    hide the elements that are responsible for displaying the browser, move them to another location (through dragging),
    change the name of the tab, add your logo and link to your site.

    Complex changes require knowledge of html / javascript / css
    Despite simple changes do not require additional knowledge from the user, they may be required for complex tasks.
    For example, to add a new graph to a bot page, you need to read library documentation and edit the bot code yourself.
    To help you with this task, interface designer provides a convenient editor with a preview(like jsfiddle).

    Interaction of the bot interface and BAS.
    You can communicate with BAS by means of a special api, its description will soon appear in the wiki.
    Here is an example of calling a method that returns a screenshot of a browser from the BAS, and updates the picture on the page.

    Api.ViewBrowser(BrowserId).then((Res)=>{
    	$("#BrowserScreen").attr("src","data:image/png;base64," + Res["image"])
    })
    

    Communication with BAS can be done also by other methods, so the bot interface can:
    read / write global variables, gain access to the database, be able to call functions of BAS and get the result(planning for future versions),
    and BAS scripts can execute arbitrary javascript in the context of the user interface.

    Running bots remotely(planning for future versions).
    Separation of the bot interface and BAS makes it possible in the future to run the bot remotely, including on mobile platforms.
    Of course, to run the BAS you still need a Windows server, but you can control the bot from any device that has access to the network and browser.

    Schedule.
    I'm plannin to release a version with UI support on May 21st. New functionality will be available only to premium users and only for private scripts or scripts located in the store. Later, new features will be available for scripts created by premium users without protection.

    Screens.

    Resources input
    alt text

    Main bot screen
    alt text

    File input
    alt text

    Interface editor
    alt text

    Code editor
    alt text