SRL Archive - RS3 Help

findObject


Battousai

2015-02-17 18:12:33

So basically, i am attempting to make a woodcutting bot, The problem i am running into is that it is detecting the stumps after the tree is chopped, So i figured i would add an objWidth, objHeight and all that onto the command


If mainScreen.findObject(x, y, 1714727, 2, colorSetting(2, 0.69, 1.51), mainScreen.playerPoint, 30, 90000, 30, ['illow'], MOUSE_LEFT) Then

Correct me if i am wrong as the number that is 90000 Should be the objects height that it finds, There should be nothing in the game of that height, yet it is still detecting stubs and the tree's and all that stuff.

Camel

2015-02-17 18:21:11

You need to do some filtering to do it. So mainscreen.findObject will not work (unless its evergreens). The mayor made a really nice post about this at some point, I'll see if I can find it.

I couldn't find it (I didn't look that hard).

I'll explain it briefly, you first find the dark brown bottom trunk color (The way you described it, it sounds like you've already done that) and split it into an ATPA so each tree trunk has its own TPA. Then you search the bounds of each of those TPAs for the color of the inside of the tree.

If you look at KeepBotting's Oak script, he filters out tree stumps in that.

3Garrett3

2015-02-17 18:37:22

From: Battousai
So basically, i am attempting to make a woodcutting bot, The problem i am running into is that it is detecting the stumps after the tree is chopped, So i figured i would add an objWidth, objHeight and all that onto the command


If mainScreen.findObject(x, y, 1714727, 2, colorSetting(2, 0.69, 1.51), mainScreen.playerPoint, 30, 90000, 30, ['illow'], MOUSE_LEFT) Then

Correct me if i am wrong as the number that is 90000 Should be the objects height that it finds, There should be nothing in the game of that height, yet it is still detecting stubs and the tree's and all that stuff.


I'm going to cut to the point (get it, cut? haha). If you're cutting normal trees, the fastest way is to determine when you get a log because that means the tree is gone. You do that with some tabBackpack.waitInventorySlot(waitTime) or something like that (type tabBackpack. to get the code hints and you'll find it).

If you're cutting oaks, etc, the most used way around here is typically to use player animation to determine if your character is still swinging at the tree. I can't remember the function for that, but if you look for pixelshift stuff around here you'll probably find it easily. I don't think that checking to see if the tree is not found is the best way about it, I would highly recommend one of these two ways.

Battousai

2015-02-17 19:47:15

From: Camel
You need to do some filtering to do it. So mainscreen.findObject will not work (unless its evergreens). The mayor made a really nice post about this at some point, I'll see if I can find it.

I couldn't find it (I didn't look that hard).

I'll explain it briefly, you first find the dark brown bottom trunk color (The way you described it, it sounds like you've already done that) and split it into an ATPA so each tree trunk has its own TPA. Then you search the bounds of each of those TPAs for the color of the inside of the tree.

If you look at KeepBotting's Oak script, he filters out tree stumps in that.


Probably not the greatest way of doing it, But i did manage to sort something out, It seems the filtering all starts at the closest one to you, atleast the way i done it, which would be a stump, so i just made it not use the first closest and go to the second closest