Or Operator (||)

Posts 31–45 of 46 · Page 3 of 4
well, i know how to do that, the problem is, what if i don't want to do yew trees anymore. Is there a way i can code it so that i can set a range of pixels like 20 pixel range for the variable? That was my problem since the beginning. Btw, thanks why06 and hd.
What I did was take a picture or 3 of the same tree in different angles, then cut out only the tree(no floor etc visible) and save them as 24bit BMP, then load it in a C# application that would determine the lowest RGB code used, highest RGB code used, and it gave me the average difference in colors between every pixel next to eachother(continuing from the last picture I loaded). I had those saved to a text file in the format lr_lg_lb_hr_hg_hb_ar_ag_ab

Then I started another application for which I took 100 pics(of which 40 contained the tree I wanted, and 60 contained random locations in runescape that could seem similar to the tree i wanted to cut). With these 100 pictures I further trained the bot to recognize only trees by clicking the yes or no button, yes if the drawn rectangle was around a tree, no if it had it wrong, then it would increase lowRGB, decrease highRGB, or decrease averagediff. Once that was done it would determine the lowest amount of recognized pixels left and the average distance between them(with 25% lower or higher allowed).

Finally I used a 3rd app that would use the results of app 1 and 2 but in a live enviroment just walk around and watch it tag all the trees. if it got one wrong I just clicked edit then click on the rectangle that was wrong and it'd adjust the formulas in such a way it wouldnt detect that object anymore.

It was a gigantic project but fun to do, over a year ago tho before I upgraded to win7 so no longer have the code
Quote Originally Posted by 258456 View Post
Idk y but this part of my code isn't working. I spent a while trying to figure this out but never did. I want it to check the color of coordinate one and nine. It will then compare the colors of those coordinates to screen_now which is the color of the spot right now. If it does not match the colors then i want it to start rs_event_alert.exe. The problem is that it starts rs_event_alert.exe anyway, even if the statement is true. Here is the code:

Code:
COLORREF tree = RGB(r_pixel_one, g_pixel_one, b_pixel_one);
		COLORREF background = RGB(r_pixel_two, g_pixel_two, b_pixel_two);
		
		int r_2,g_2,b_2;
		int r_3, g_3, b_3;
		int r_4, g_4, b_4;
		pixel3 = GetPixel(hdc, one.x, one.y);
		r_3 = GetRValue(pixel3);
		g_3 = GetGValue(pixel3);
		b_3 = GetBValue(pixel3);
		COLORREF screen_now = RGB(r_3, g_3, b_3);
		if(screen_now != tree || background){system("START rs_event_alert.exe"); system("PAUSE");}
		pixel2 = GetPixel(hdc, eight.x, eight.y);
		r_2 = GetRValue(pixel2);
		g_2 = GetGValue(pixel2);
		b_2 = GetBValue(pixel2);
		if(r_2 == r_targetpix && g_2 == g_targetpix && b_2 == b_targetpix){ autodump();   } 
		Sleep(1500);
never seen uglier code, darn winapi
Damn . :/
i just threw it together really fast, lol, ya it's extremely messy.
Original pic:


What to train from:


After it adjusted its filters a few time it gave me this result(autoadjusted filters by checking if there were more then x white pixels directly against eachother, if there were it would adjust the maximum or minimum):


Which I manually narrowed down to:


Final values:
Max: 75,77,40
Min: 50,60,30

Now I can do some loops and determine how wide and long it would be on screen based on maximum distance from previous pixels that it detected and draw a rectangle around it or something.
More epicness, HD. What values did your bot adjust to identify a tree. was it like avg color, density of color, etc?
Quote Originally Posted by why06 View Post
More epicness, HD. What values did your bot adjust to identify a tree. was it like avg color, density of color, etc?
Converted RGB to HSL(Hue/Saturation/Luminance), then compared Luminance of the avg color at white solid parts to Luminance of (min+max)/2, then adjust min or max based on that
HOLY CRAP. I would probably never figure that out. Do you guys have any ideas on a method that i could use to detect if i am still in my right place, other than my failed method in this thread. Thanks. Btw crazy logic HD.
ok, nevermind the last post guys i have another idea. I will test it and report back if it works and i will reveal the method.
Ok I solved the problem using the same method. Instead of gettin the color of the tree and the background I found that it was just necessary to get the background color and then I set up an if statement sorta like this:

Code:
 if(! (r_3 >= r_pixel_two - 20 ............)){}
So thx so much for ur guys' help cuz now my bot runs while I m at skool and I receive status updates via txt messages from the bot. It is so legit, lol.
Quote Originally Posted by 258456 View Post
So thx so much for ur guys' help cuz now my bot runs while I m at skool and I receive status updates via txt messages from the bot. It is so legit, lol.
Next on the list: Have it send an MMS with a screenshot of what it's currently doing :P
Quote Originally Posted by Hell_Demon View Post
Next on the list: Have it send an MMS with a screenshot of what it's currently doing :P
LOL. I wonder how you'd do that.
Quote Originally Posted by master131 View Post
LOL. I wonder how you'd do that.
easy to get it as bitmap, all thats left to figure out is how to attach the bitmap to the MMS(which if its like emailing, shouldnt be too hard)
Quote Originally Posted by Hell_Demon View Post
easy to get it as bitmap, all thats left to figure out is how to attach the bitmap to the MMS(which if its like emailing, shouldnt be too hard)
Get a free online MMS service.
Posts 31–45 of 46 · Page 3 of 4

Post a Reply

Tags for this Thread

None

Talk with us