EDIT: Ignore all this, was able to get it working after looking through the surfaces include in the OP. My new question is how I could check within the drawn object repeatedly for when it no longer has a color. In other words: When I start siphoning an esshound, how do I get it to recheck the box periodically for the esshound colors and if it doesn't find them, find another esshound to siphon?
Hey!
I'm attempting to get this working currently for a runespan script, but I'm having uptext issues (I think) that I'm finding hard to troubleshoot. Here's the relevant bits of my code:
Simba Code:
//Cosmic Esshound
with surface_cosmic_essling do begin
c := 8441417;
hm := 0.95;
sm := 1.45;
t := 26;
minw := 20;
maxw := 50;
minh := 20;
maxh := 50;
step := 16;
max_distance := 200;
end;
CreateSurfaceParts(obj_cosmic_essling, 3);
with obj_cosmic_essling do begin
parts[0] := CopySurfacePart(surface_cosmic_essling);
parts[1].c := 9229402;
parts[1].hm := 1.37;
parts[1].sm := 2.13;
parts[1].t := 18;
parts[1].filter := @SurfaceFilterClosest;
parts[1].minw := 4;
parts[1].maxw := parts[0].maxw;
parts[1].minh := 4;
parts[1].maxh := parts[0].maxh;
parts[1].step := 16;
parts[1].max_distance := parts[0].max_distance;
parts[2].c := 7519801;
parts[2].hm := 1.30;
parts[2].sm := 2.19;
parts[2].t := 19;
parts[2].filter := @SurfaceFilterClosest;
parts[2].minw := 4;
parts[2].maxw := parts[0].maxw;
parts[2].minh := 4;
parts[2].maxh := parts[0].maxh;
parts[2].step := 16;
parts[2].max_distance := parts[0].max_distance;
name := 'Cosmic Esshound';
uptext := 'Cosmic';
filter := @SurfaceFilterClosest;
end;
And:
Simba Code:
procedure Harvestessence;
begin
begin
SMART_ClearMS();
if FindSurfaceObject(obj_cosmic_essling, MSX1, MSY1, MSX2, MSY2) then
begin
with obj_cosmic_essling do
Mouse(p.x, p.y, 2, 2, mouse_left);
wait(5000+random(7042));
end else
begin
RotateMap;
Harvestessence;
end;
end;
Harvestessence;
end;
I've tried both the FindSurfaceObject and the ClickSurfaceObject approaches. The first finds the esshounds near flawlessly, but also is finding the vine platforms and chaos esshounds due to the yellow color. It's completely ignoring the uptext string I enter when creating the surface object initially and I'm not really sure why. I attempted to put in some other manual uptext detection stuff as a secondary "if" statement to force it to find the surface, then verify the uptext before clicking with no luck. It would find the wraith perfectly, but wouldn't find the uptext and thus never clicked.
Using ClickSurfaceObject was acting strangely in that it opened the menu for everything it did and would then check for the text in the right click options. So it was effective (I guess) in not clicking the platforms, but would still end up repeatedly right clicking the platform and then not selecting anything.
It's late here and I'm tired so I hope that covers it well enough. Any help would be very much appreciated as I feel like I've hit something of a brick wall. Thanks in advance.