SRL Archive - OSR Help

Cannot... FindColor?


Infantry001

2011-11-03 23:19:19

So… I'm not a noobie - I scripted a long time ago. I just wanted to create a little script for old times sake, but I quickly ran into a problem…

Installed Simba (Revision 973), enabled srl.sex, updated to SRL version 803 (I think… that's what it says in the console).

I CANNOT FIND A COLOR.

Using this code (and no compilation errors, I've setup SRL, etc.):

  x := MSCX;
y := MSCY;
if FindColorSpiralTolerance(x,y,4600188,MSX1, MSY1, MSX2, MSY2, 20) then
MMouse(x,y,0,0)
else
MMouse(-1, -1, 0, 0);

Simba NEVER finds the color! (Ok, one time, out of a good 8 tries, it moved the mouse to a crate. But I put in a BLUE color!)

Every time, the mouse moves to (-1, -1). Regardless of what color I put in.

What's going on? Help an old guy, please :)

Coh3n

2011-11-03 23:27:59

For that function, the x, y return the point the color is found so you don't need to set them as MSCX, MSCY. That's not your issue, though.

I'm really not sure what your issue is. :unsure:

Infantry001

2011-11-03 23:29:49

Well, the x and y points are set to MSCX and MSCY so that FindColorSpiralTolerance starts its spiral search from the center of the Main Screen (at least, that's what it does if I remember it correctly).

Yeah, I'm stumped :(

Kyle Undefined

2011-11-03 23:31:24

This was happening to me earlier. I couldn't login to RS with/without SMART. I couldn't get my TPA function working, then all of a sudden it started working again. I don't know what happened.

Coh3n

2011-11-03 23:32:03

From: Infantry001
Well, the x and y points are set to MSCX and MSCY so that FindColorSpiralTolerance starts its spiral search from the center of the Main Screen (at least, that's what it does if I remember it correctly).

Yeah, I'm stumped :(
That's what it does in FindColorsSpiral. Are you using SMART or the browser? If browser, some clients refresh a lot causing Simba to lose focus and Simba's client is reset back to the desktop.

Infantry001

2011-11-03 23:33:27

Hmm. I've been using the browser (Chrome, specifically). Let me try with SMART.

Coh3n

2011-11-03 23:34:37

From: Infantry001
Hmm. I've been using the browser (Chrome, specifically). Let me try with SMART.
Chrome is what didn't work for me (RS client refreshed or flickered every couple seconds). As soon as I switched to Firefox it worked again.

Infantry001

2011-11-03 23:40:47

Uhh… what happened to the red dot in SMART?

Edit: NVM, it magically appeared! O_O

Kyle Undefined

2011-11-03 23:41:17

You have to update to V6.9.

Infantry001

2011-11-03 23:50:58

Ok, thanks for that.

EDIT: Oh, and it works. Thanks, guys! :)