• Christian Davis

    I guess it's somewhat of a fix, the only problem is that you need to open the console then :D But I suppouse I might have to try it out at some point

    posted in Q&A read more
  • Christian Davis

    I tried but I can't get either to work. The code should work but I need a way to enter it directly into the console

    posted in Q&A read more
  • Christian Davis

    I want to input the following script to firefox's console

         var nextButton = document.getElementsByClassName("button-next")[0];
    nextButton.click();
    end
    

    The script is tested in the firefox console (Gotten by inspecting element and choosing console). How do I get unified remote to send the piece of into the browser and execute it?

    It's not lua and the code written as lua doesn't function correctly either, so I assume I need to add something.

    I've been toying with the https functions as a solution but I get an error now:

    2016-03-26 21:53:06 LuaInstance: could not run action:
       target: 
       name: closeTab
       error: Exception: Unknown scheme for HTTP: 
    

    This is the piece of code

    [email protected] Command 4
    actions.closeTab = function ()
    
    local close = "close();"
        http.post(close, function(err, resp)
        if (err) then return; end
        print(resp)
        end);```

    posted in Q&A read more
  • Christian Davis

    You might be right about something. Looking on the log (Thanks for info) and it gives this error(At the bottom)

    
    Unified Remote
    
        Status
        Remotes
        Log
        Settings
        About
    
    © 2016
    Log
    # lines
    Pause
    Filter
    Level
    2016-03-26 17:04:15 Manager: 192.168.0.230:42912: disconnected
    2016-03-26 17:04:15 Manager: 192.168.0.230:42912: connected
    2016-03-26 17:04:15 Manager: 192.168.0.230:44286: disconnected
    2016-03-26 16:58:32 Session: android-b2e84b372df79d12: unloading (Examples.CustomScripts)
    2016-03-26 16:58:29 Session: android-b2e84b372df79d12: updating (Examples.CustomScripts)
    2016-03-26 16:58:29 Agent: loading: Examples.CustomScripts
    2016-03-26 16:58:29 Session: android-b2e84b372df79d12: loading (Examples.CustomScripts)
    2016-03-26 16:58:29 Connection: android-b2e84b372df79d12: starting new session
    2016-03-26 16:58:29 Connection: android-b2e84b372df79d12: updating fast capability (true)
    2016-03-26 16:58:29 Connection: android-b2e84b372df79d12: syncing hash (-2019421561)
    2016-03-26 16:58:29 Connection: android-b2e84b372df79d12: ignoring authentication
    2016-03-26 16:58:29 Connection: android-b2e84b372df79d12: supports client nonce
    2016-03-26 16:58:29 Connection: android-b2e84b372df79d12: received valid handshake
    2016-03-26 16:58:29 Manager: 192.168.0.230:44286: connected
    2016-03-26 15:00:34 Manager: 192.168.0.230:56068: disconnected
    2016-03-26 14:55:33 Session: android-b2e84b372df79d12: unloading (Examples.CustomScripts)
    2016-03-26 14:55:24 Session: android-b2e84b372df79d12: updating (Examples.CustomScripts)
    2016-03-26 14:55:24 Agent: loading: Examples.CustomScripts
    2016-03-26 14:55:24 Session: android-b2e84b372df79d12: loading (Examples.CustomScripts)
    2016-03-26 14:53:11 Loader: loading remote: C:\ProgramData\Unified Remote\Remotes\Bundled\Unified\Examples\Scripts\meta.prop
    2016-03-26 14:53:11 Loader: loading remote: C:\ProgramData\Unified Remote\Remotes\Bundled\Unified\Examples\Scripts\meta.prop
    2016-03-26 14:52:59 Session: android-b2e84b372df79d12: unloading (Examples.CustomScripts)
    2016-03-26 14:52:43 LuaInstance: no handler found for action:
       target: 
       name: command1
    2016-03-26 14:52:42 LuaInstance: no handler found for action:
       target: 
       name: command1
    2016-03-26 14:52:42 LuaInstance: no handler found for action:
       target: 
       name: command3
    2016-03-26 14:52:42 LuaInstance: no handler found for action:
       target: 
       name: command1
    2016-03-26 14:52:41 LuaInstance: no handler found for action:
       target: 
       name: command2
    2016-03-26 14:52:41 LuaInstance: no handler found for action:
       target: 
       name: command3
    2016-03-26 14:52:41 LuaInstance: no handler found for action:
       target: 
       name: command1
    2016-03-26 14:52:40 LuaInstance: no handler found for action:
       target: 
       name: command2
    

    Gonna take a look at it and try your suggestion

    the "-" before row was bc it was copy-pasted from xml browser reading the code looks like this

    <?xml version="1.0" encoding="utf-8"?>
    <layout>
        <row>
            <button text="Next" ontap="Command1" />
        </row>
        <row>
            <button text="Previous" ontap="Command2" />
        </row>
        <row>
            <button text="Episode" ontap="Command3" />
        </row>
    <row>
            <button text="Close" ontap="Command4" />
        </row>
    </layout>
    

    Could it be that it's because the scripts is javascripts that is intended to be input'ed into the firefox console? That his is giving me the error? And I need to add some code to tell the remote how to run the scripts? and what code would that be?

    posted in Q&A read more
  • Christian Davis

    Custom remote not showing up.
    This is the meta text

    meta.name: Watchseries
    meta.author: Christian Davis
    meta.description:Next and Previous on WatchSeries
    meta.tags: example
    
    

    This is the layout text

    <?xml version="1.0" encoding="UTF-8"?>
    
    -<layout>
    
    
    -<row>
    
    <button ontap="Command1" text="Next"/>
    
    </row>
    
    
    -<row>
    
    <button ontap="Command2" text="Previous"/>
    
    </row>
    
    
    -<row>
    
    <button ontap="Command3" text="Episode"/>
    
    </row>
    
    
    -<row>
    
    <button ontap="Command4" text="Close"/>
    
    </row>
    
    </layout>
    

    This is the remote text

    -- Documentation
    -- http://www.unifiedremote.com/api
    
    -- Keyboard Library
    -- http://www.unifiedremote.com/api/libs/keyboard
    
    
    [email protected] Command 1
    actions.command1 = function ()
         var nextButton = document.getElementsByClassName("button-next")[0];
    nextButton.click();
    end
    
    
    [email protected] Command 2
    actions.command2 = function ()
    var previousButton = document.getElementsByClassName("button-previous")[0];
    previousButton.click();
    end
    
    
    [email protected] Command 3
    actions.command3 = function ()
    
    var Episode = document.getElementsByClassName("buttonlink")[2];
    Episode.click();
    
    end
    
    [email protected] Command 4
    actions.command4 = function ()
        close();
    end
    

    Why isn't my remote showing up anywhere? I've had it put in numerous folders on the path: C:\ProgramData\Unified Remote\Remotes

    posted in Q&A read more
  • Christian Davis

    Would this then work?

    local kb = libs.keyboard;
    
    
    -- Documentation
    -- http://www.unifiedremote.com/api
    
    -- Keyboard Library
    -- http://www.unifiedremote.com/api/libs/keyboard
    
    
    [email protected] Command 1
    actions.command1 = function ()
         var nextButton = document.getElementsByClassName("button-next")[0];
    nextButton.click();
    end
    
    
    [email protected] Command 2
    actions.command2 = function ()
    var previousButton = document.getElementsByClassName("button-previous")[0];
    previousButton.click();
    end
    
    
    [email protected] Command 3
    actions.command3 = function ()
        kb.stroke("esc");
    end
    
    

    as the remote code?

    posted in Q&A read more
  • Christian Davis

    So I have gotten closer from the help of a friend. With the following javascripts which can do what I want.
    For next episode:

    var nextButton = document.getElementsByClassName("button-next")[0];
    nextButton.click();
    

    For previous episode:

    var previousButton = document.getElementsByClassName("button-previous")[0];
    previousButton.click();
    

    posted in Q&A read more
  • Christian Davis

    I need help creating a script that can either input a command which will press the next or previous episode on this webiste: http://thewatchseries.to/episode/supernatural_s3_e1.html

    or use the same funktion the website uses to input the next or previous episode. Which I can see it does by inspecting element.
    I just don't have enough knowlegde to put the pieces together.

    But for the first it seems like the website is using something like this:

    $('#desktop-version').on('click', function(e){
                e.preventDefault();
                $.cookie('showDesktop','true',{path: '/' });
    
                location.reload();
            });
    

    To determine what to do on click and if you clicked, but it's the same code for both previous and next episode.
    and something like this to determine the url of the next episode:

    
    function submitLink(showId) {
        $.post(
            '/submit-link',
            {
                'submit_form': 1,
                'show_id' : SHOW_ID_TO_ADD,
                'season' : $('#submit-link-form > input[name="season"]').val(),
                'episode' : $('#submit-link-form > input[name="episode"]').val(),
                'link' : $('#submit-link-form > textarea[name="link"]').val(),
            },
            function (data) {
                $('#addLinkModal').find('.modal-body').html(data);
            }
        );
    }
    

    I just don't know how to use this.

    Using the functions should give us the ability to use it as a universal remote on the website.

    posted in Q&A read more

Internal error.

Oops! Looks like something went wrong!