Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ColorPicker problem

Featured Replies

Hi fellow forum members,

Im a rookie scripter and im trying to get the ColorPicker to work. I don't quite understand how it works. Before you say google it- I've spent hours on this as of now, even tried searching in open source scripts :/ 

here's the api
https://osbot.org/api/org/osbot/rs07/api/ColorPicker.html#isColorAt-int-int-java.awt.Color-
 

1)

public boolean isColorAt(int x, int y, java.awt.Color color)

  • x - x coord
  • y - y coord
  • color - the color to look for

I understand this is to check if specified colour exists at specified coords.

I tried isColorAt(120,200,rgb(123,123,123)) for example, Also I tried isColorAt(120,200,Color.RED), nothing works

 

2)

public java.awt.Color colorAt(int x, int y)

  • x - x coord
  • y - y coord

This should be used to get the colour at the specified coords. I dont understand how to retrieve this data. Also, does it get the color data as RGB?



I want my code to trigger a method when "Color at mouse = R: x G: y B: z" changes Would any of you be able to help me understand this via an example.

I appreciate the help :)

Edited by Panason9c

I have tried using the colour picker on osbot before and it didn't seem to work for me so I gave up quickly and switched to traditional methods of just checking states 

The only help I can give, is to create a BufferedImage object and then check the colours there using isColorAt(x,y,z)

Just make sure to give your loop ample amounts of time 

Edited by Protoprize

  • Author
11 hours ago, Protoprize said:

I have tried using the colour picker on osbot before and it didn't seem to work for me so I gave up quickly and switched to traditional methods of just checking states 

The only help I can give, is to create a BufferedImage object and then check the colours there using isColorAt(x,y,z)

Just make sure to give your loop ample amounts of time 

Thank you for your answer!

11 hours ago, dreameo said:

1. there are 256^3 (~16 million) possible colors. Of course the one you pick (even if it's closely resembles) will not match. It must be exact!

2. Color color = getColorPicker().colorAt(yourX, yourY);

You must import java.awt.color; https://docs.oracle.com/javase/7/docs/api/java/awt/Color.html

This example is exactly what I was looking for! Mucho gracias!

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.