Jump to content
AC Tool Forums
Sign in to follow this  
Lots of sand

No commercial online TV - macro

Recommended Posts

Hello. Last year I've created a macro, which simply turn off the voice, when the commercial go (online TV)

All you need to do, is point with a cursor a logo of tv station once and time and then, point a button to mute the sound.

It's very smooth and work good.

The only problem is when station logo is visible also when commercial, but that is rare...

 

Have fun!

 

Offline AC

https://www.facebook.com/OfflineAC

 

Download:
https://www.filehosting.org/file/details/747419/Offline%20AC.rar

 

script english version:

 

 

 
 
constants
  // While stop the macro
  // All the data are lost
  // However the configuration
  // Takes only a few seconds
  
  
  colour=1
  // 1 - white
  // 2 - red
  // 3 - green
  // 4 - blue
  // 5 - yellow
  tolerance=9
  // 2 - small
  // 4 - medium
  // 6 - big
  // 8 - huge
  // If the station logo is transparent
  // It's recommended to use bigger tolerance
  // The big tollerance is recommended
  // To be used only with white colour
  timer_2_2=150
  // Important thing. The multiplier
  // The bigger value
  // the ad filter bigger
  
  // You do not need those below
  
  rgb1=0 // sum
  rgb2=0
  // The RGB value for the station logo
  
  mute_x=0
  mute_y=0
  
  mute_x_2=0
  mute_y_2=0
  // X Y - sound control button
  // And the second value
  // - quite same
  
  wait=150
  wait2=325
  // NO USE
  timer_1=0
  timer_2=0
  
  
  optional_click=0
  // 1 - WÅ‚Ä…czone 0 - WyÅ‚Ä…czone
  optional_click_xy=378, 64
  // Opcjonalnie kliknij X, Y
  // Gdy wyciszasz dźwiÄ™k
  optional_click_mode=1
  // 1 - lewy przycisk myszy
  // 2 - prawy przycisk myszy
  
  x=0
  y=0
  sum=0
  // NO USE
  mode=2
  
  setup=0
  white=0
  // NO USE
  startup=1000
end
 
 
compute $tolerance = $tolerance * 30
delay $startup
 
 
if $mode = 2
  call setup
end
 
 
procedure ad
  
  ShowMessage setup = Confirmation, OK, Using mouse, point the logo of the TV station. Confirm this action pressing ENTER.
  
  compute $x = {mousex}
  compute $y = {mousey}
  delay 1000
  ShowMessage setup = Confirmation, OK, Using mouse, point the volume button. Confirm this action pressing ENTER.
  
  compute $mute_x = {mousex}
  compute $mute_y = {mousey}
  
  compute $mute_x_2 = {mousex} + 1
  compute $mute_y_2 = {mousey}
  delay $startup
  mousepos 0, 0
  while 1=1
    
    loop 6
      delay $wait
      
      loadrgb $x , $y
      
      if $colour = 1
        compute $rgb2 = {rgbred} + {rgbgreen} + {rgbblue}
      end
      
      if $colour = 2
        compute $rgb2 = {rgbred}
      end
      
      if $colour = 3
        compute $rgb2 = {rgbgreen}
      end
      
      if $colour = 4
        compute $rgb2 = {rgbblue}
      end
      
      if $colour = 5
        compute $rgb2 = {rgbred} + {rgbgreen}
      end
      
      if $rgb2
        compute $white = $white + 1
        if $white > 4
          compute $timer_2 = 1
          call click
          
          leftclick
          
          if $optional_click = 1
            delay $wait2
            mousepos $optional_click_xy
            delay $wait2
            if $optional_click_mode = 1
              leftclick
            end
            if $optional_click_mode = 2
              rightclick
            end
          end
          
          
          
          
          loop 5000
            if $timer_2 = 1
              delay $wait
              
              loadrgb $x , $y
              
              if $colour = 1
                compute $rgb2 = {rgbred} + {rgbgreen} + {rgbblue}
              end
              
              if $colour = 2
                compute $rgb2 = {rgbred}
              end
              
              if $colour = 3
                compute $rgb2 = {rgbgreen}
              end
              
              if $colour = 4
                compute $rgb2 = {rgbblue}
              end
              
              if $colour = 5
                compute $rgb2 = {rgbred} + {rgbgreen}
              end
              
              if $rgb2 > $rgb1
                compute $timer_1 = $timer_1 + 1
                delay $wait
                if $timer_1 > $timer_2_2
                  compute $timer_1 = 0
                  compute $timer_2 = 0
                  call click
                  
                  
                  delay $wait
                  leftclick
                  delay $wait
                  if $optional_click = 1
                    delay $wait2
                    mousepos $optional_click_xy
                    delay $wait2
                    if $optional_click_mode = 1
                      leftclick
                    end
                    if $optional_click_mode = 2
                      rightclick
                    end
                  end
                  
                  
                end
                
              end
              //
              if $rgb2
                compute $timer_1 = 0
              end
            end
            
            
            
          end
          
        end
      end
      compute $white = 0
      
    end
  end
  
  
  procedure click
    loop 5
      mousepos $mute_x , $mute_y
      delay 100
      mousepos $mute_x_2 , $mute_y_2
      delay 100
    end
  end
  
  
  procedure setup
    ShowMessage setup = Confirmation, OK, Using mouse, point the logo of the TV station. Confirm this action pressing ENTER.
    
    compute $x = {mousex}
    compute $y = {mousey}
    
    delay 200
    loadrgb $x , $y
    
    delay 1000
    
    
    if $colour = 1
      compute $sum = {rgbred} + {rgbgreen} + {rgbblue}
      compute $rgb1 = $sum - $tolerance
    end
    
    if $colour = 2
      compute $rgb1 = {rgbred} - $tolerance
    end
    
    if $colour = 3
      compute $rgb1 = {rgbgreen} - $tolerance
    end
    
    if $colour = 4
      compute $rgb1 = {rgbblue} - $tolerance
    end
    
    if $colour = 5
      compute $sum = {rgbred} + {rgbgreen}
      compute $rgb1 = $sum - $tolerance
    end
    
    
    call ad
    
  end

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and to our Privacy Policy.