User Tag List

Results 1 to 10 of 10

Thread: Compare Multiple Values?

  1. #1
    No Products Registered

    Join Date
    Feb 2007
    Location
    Sydney, Australia
    Posts
    1,654
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Compare Multiple Values?

    Hello

    I'm using the compare 2 general values condition...to compare 2 of my values.

    But for the top box in the expression, I need to compare multiple values. Here is what I have now:

    Code:
    Compare 2 general values: 
    
    Pixel( "Screen pixel object", 600, 460)
    
    -Equal to -
    
    GetRGB(0, 0, 0)
    600 is the X position and 460 is the Y position. For the X position (600) Instead of having an EXACT position, how do I have something like the numbers between 550 and 650?

    "Pixel( "Screen pixel object", 550-650, 460)" doesn't work...

    Can anyone help me?

    Thank you!

  2. #2
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jun 2006
    Posts
    888
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Compare Multiple Values?

    I think you cannot test a range of variables in one event, because it could retrieve both true and false results within one condition.

    Instead of that, you would need to test if "position" is in the range and then, in second condition, test it for RGB.

    -Position > 500 and < than 650

    Pixel( "Screen pixel object", position, 460)

    -Equal to -

    GetRGB(0, 0, 0)


  3. #3
    No Products Registered

    Join Date
    Feb 2007
    Location
    Sydney, Australia
    Posts
    1,654
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Compare Multiple Values?

    I'm confused? Can you repeat that in a simpler way?
    I got lost when you said

    "-Position > 500 and < than 650"

  4. #4
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jun 2006
    Posts
    888
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Compare Multiple Values?

    You need to test RGB everytime when position is between 500 and 650, right?
    So put this as a first condition:
    If position is greater than 500 and smaller than 650.
    Then, in second condition of this same event), just test if "position" (which passed through the first condition also its surely between 500 and 650) is equal to RGB(0,0,0).

  5. #5
    No Products Registered

    Join Date
    Feb 2007
    Location
    Sydney, Australia
    Posts
    1,654
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Compare Multiple Values?

    This wouldn't work. The object I'm using only has 1 expression. And that expression is

    "Pixel( "Screen pixel object", >X<, >Y<)"

    This is because I asked Jam to make a very simple extension for me. It only detects the position of the pixels...not the position of the object.

  6. #6
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jun 2006
    Posts
    888
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Compare Multiple Values?

    Instead of harcoded value of X you can use variable.
    Its up to you how the variable is retrieved. So the workaround could be using an object which X would be between 500 and 650.

  7. #7
    Clicker Multimedia Fusion 2
    Algul's Avatar
    Join Date
    Feb 2008
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Compare Multiple Values?

    So you need to test if specific pixel is in defined zone. Like "Is pixel 0,0,0 present in zone 550,460,650,460". If so then you will probably need to loop through all pixels one by one.

  8. #8
    No Products Registered

    Join Date
    Feb 2007
    Location
    Sydney, Australia
    Posts
    1,654
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Compare Multiple Values?

    Yeah, I had to do like 20 events with each pixel. Kinda a waste of time though.

  9. #9
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Compare Multiple Values?

    Use a loop.

  10. #10
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Compare Multiple Values?

    You loop through the range usinga fastloop. If you want to test every pixel in that range, start a loop like this

    +Always
    - Start loop 'x' 101 times (to get range from pixel 550 - 650)

    +On loop 'x'
    +Pixel( "Screen pixel object", 550+LoopIndex("x"), 460) = GetRGB (0,0,0)
    - DO EVENTS

Similar Threads

  1. Fastest way to compare values?
    By StingRay in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 13th December 2013, 04:51 PM
  2. Trying to use OR in a condition to compare more than two values at once...
    By alxmrg in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 25th January 2012, 06:47 PM
  3. 'Compare to one of the alterable values' VS 'Compare two general values'
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 1st January 2012, 07:26 PM
  4. For each and compare two general values
    By Popcorn in forum Multimedia Fusion 2 - Technical Support
    Replies: 13
    Last Post: 29th April 2010, 06:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •