SRL Archive - OSR Help

Finding Color


BinaryHero

2013-04-26 23:13:27

Hey I'm decently new at this and I'm trying to write a script, but I can't get past this one part so hopefully one of you guys knows how to do this.

How would you have the bot log out if it can't find a specific color on the screen?

Sk1nyNerd

2013-04-26 23:33:05

post youre code, with code tags, and ill show you what it looks like

The Mayor

2013-04-27 00:07:23

From: BinaryHero
Hey I'm decently new at this and I'm trying to write a script, but I can't get past this one part so hopefully one of you guys knows how to do this.

How would you have the bot log out if it can't find a specific color on the screen?


You could use something like:


if not FindColorTolerance(x, y, 169454, MIX1, MIY1, MIX2, MIY2, 35) then
Logout;

You can modify that depending on where you want to look for the colour. The MI in MIX1, MIY1 stands for Main Intentory, so this will search for the colour in the inventory.

If you wanted to look on the main screen you would use MSX1, MSY1. If you wanted to look on the Mini Map you would use MMX1, MMY1 etc.

Hope this helps :)