AutoInput Multiple x,y coordinate search , same screen cap

Discussion in 'AutoApps' started by Exilereven, Aug 15, 2016.

  1. Exilereven

    Exilereven New Member

    Joined:
    Aug 15, 2016
    Messages:
    23
    Likes Received:
    0
    Worked perfect. I didn't even realize that was in the UG. I added +1 to the priority variable within the perform task when I'm calling it.

    So, now that you guys have helped me a ton. The pixel color problem is fixed. Thank you very much. Next goal is to figure out how to parse the screen cap function so I can have it go ahead and check multiple areas of the screen cap for the same hex color as to not have to re screencap over and over and save time.
     
  2. easiuser

    easiuser Member

    Joined:
    Mar 7, 2015
    Messages:
    50
    Likes Received:
    4
    I don't think your reading it wrong. I have never had a problem setting the priority of both the same, but maybe I have just been lucky. What I do know is if you run a routine from the Tasker UI, it has the highest priority available to the user.

    This is what I read from http://tasker.dinglisch.net/userguide/en/help/ah_index.html

    Perform Task
    Run the selected Tasker task.

    You can 'nest' as many tasks as you wish.

    When this action is used as part of an Enter task, the settings it contains are *not* restored when the profile exits.

    When a task is started from an existing task, the existing task continues unless the Stop parameter is set.

    If you set the priority lower than the current task, the current task will finish before the new one starts.

    If you set the priority the same or higher than the current task (a good way to do this is to specify '%priority+1'), the new task will completely execute before the current one resumes.

    Values assigned to %par1 and %par2 are available in the child task as normal variables.

    If the child does a Return action, the Return Value Variable in the parent task is set to the Value specified in that Return action, however note that the value will not be returned if the Perform Task is the last action of the parent.

    See Flow Control in the Userguide for more info.


    It can't hurt to set the priority to %priority+1 so go ahead and do it. See what happens.
    Have you looked at the run log? Here is mine.
    20160817 19.02.30 E Start ID0:0.0 TaskService
    20160817 19.02.32 T Running ID488 TestPixel
    20160817 19.02.32 T Running ID397:2 Pixel By Color
    20160817 19.02.32 A OK ID488.1 TestPixel.Perform Task, Pixel By Color
    20160817 19.02.32 A OK ID397:2.1 Pixel By Color.Var Set, %devicewidth=1440
    20160817 19.02.32 A IfFail ID397:2.2 Pixel By Color.Var Set, %par1=120
    20160817 19.02.32 A IfFail ID397:2.3 Pixel By Color.Var Set, %par2qqqq=%par2qqqq
    20160817 19.02.32 A OK ID397:2.4 Pixel By Color.Var Set, %offset=288123
    20160817 19.02.32 A OK ID397:2.5 Pixel By Color.Run Shell, %final=%final
    20160817 19.02.32 A OK ID397:2.6 Pixel By Color.Flash
    20160817 19.02.32 A OK ID397:2.7 Pixel By Color.Return
    20160817 19.02.32 T ExitOK ID397:2 Pixel By Color
    20160817 19.02.32 A OK ID488.2 TestPixel.Flash
    20160817 19.02.32 T ExitOK ID488 TestPixel
    20160817 19.02.44 E Stop ID0:0.0 TaskService

    As you can see all Pixel By Color actions complete between the Perform Task and Flash.

    Is the Perform Task the last action of the parent?
     
  3. Exilereven

    Exilereven New Member

    Joined:
    Aug 15, 2016
    Messages:
    23
    Likes Received:
    0
    You were talking about using the screen cap code with a loop. So I can have it check different coords with same color check. Did you mean like try doing and if statement and using for? Or what would be a good start to doing what I'm trying to accomplish?
     
  4. easiuser

    easiuser Member

    Joined:
    Mar 7, 2015
    Messages:
    50
    Likes Received:
    4
    I would create two tasks.
    1. Perform a screen capture with the first part of the shell command
    2. Perform the file parsing with the second part of the shell command

    Call the first task to capture the screen
    In a loop call the second task to get multiple color values from the same screen capture

    The issue you may run into is that each shell command has some overhead an may not be any faster than repeated AutoInput requests. You will have to test.

    Alternatively, you could pass a list of offsets and chain multiple shell commands together (only one shell command overhead) and return a list of values (ie ff1257,a459f2,...).

    Another option is to do all the parsing (and possibly the screen capture) using JavaScript (not Java). Tasker has built in JavaScript capabilities that can easily populate Tasker variables. Extremely powerful and easy if you have any programming background at all. The only problem is debugging JavaScript in Tasker is limited.
     
  5. Exilereven

    Exilereven New Member

    Joined:
    Aug 15, 2016
    Messages:
    23
    Likes Received:
    0
    So I'm having a couple issues. One being, when I run the pixel color code I'm getting an offset, but I can't tell which is off, cause Pixolor is telling me a different offset when I put it on the same pixel. The code always seems just a little off from what it should be. Like ffaa00, but in pixolor it's like ffaa04. So I don't know which to trust.
     

Share This Page