If the flag is on top of everything else, a FindBitmapTolerance should also work, no? (With 0 as transparent colour)
If the flag is on top of everything else, a FindBitmapTolerance should also work, no? (With 0 as transparent colour)
The best way to contact me is by email, which you can find on my website: http://wizzup.org
I also get email notifications of private messages, though.
Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
Documentation | Source | Simba Bug Tracker on Github and Villavu )
My (Blog | Website)
"Sometimes User's don't need the Answer spelled out with Code. Sometimes all they need is guidance and explanation of the logic to get where they are going."
I've looked at it more and come to a conclusion of sorts.
The flag changes color after an initial click. When you first click it its a lighter color very subtle and then shortly after stays a more darker color.
Our current methods just aren't fast enough from grabbing from the screen. Freeze should work but doesn't fully (no clue why). Currently the best FindFlag is mormonman's which I'm going to commit for now.
Edit:
Maybe not, I'm not getting delays with it. /sigh
Last edited by Narcle; 12-11-2011 at 05:43 AM.
(Scripts outdated until I update for new SRL changes)
AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
Summer = me busy, won't be around much.
Has anyone tried a simple findColors with tolerance and some split/sort TPA work? I don't see why that wouldn't work. I'm still convinced that the major change in colour of the flag is a bug in RS (the same with the pink dots on the MM).
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
I've been trying some things via TPA to findflag. But don't have the correct TPA sort/find functions in Simba to make it faster.
I've even been trying something like this which works in theory but the speed/functions aren't there. Also this errors if it doesn't find colors /sigh
Simba Code:Function FindFlag(var X, Y: Integer): Boolean;
var
i: integer;
TPA1, TPA2, FlagTPA, TempTPA, MTPA: TPointArray;
begin
FlagTPA := [Point(5, 0), Point(4, 1), Point(4, 2), Point(3, 3), Point(4, 3),
Point(2, 4), Point(3, 4), Point(4, 4), Point(1, 5), Point(2, 5),
Point(3, 5), Point(4, 5), Point(0, 6), Point(1, 6), Point(2, 6)];
FindColorsSpiralTolerance(MMCX, MMCY, TPA1, 65536, MMX1, MMY1, MMX2, MMY2, 0);
FindColorsSpiralTolerance(MMCX, MMCY, TPA2, 14333, MMX1, MMY1, MMX2, MMY2, 40);
H := High(TPA1);
for i := 0 to H do
begin
TempTPA := CopyTPA(FlagTPA);
OffsetTPA(TempTPA, Point(TPA[i].x-6, TPA[i].y-14));
GetSamePointsATPA([TPA2, TempTPA], MTPA);
if Length(MTPA) = Length(FlagTPA) then
begin
Result := true;
X := TPA[i].x;
Y := TPA[i].y;
Exit;
end;
end;
end;
(Scripts outdated until I update for new SRL changes)
AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
Summer = me busy, won't be around much.
Hmm, I feel like we might be over thinking it. What method did we use previously?
SRL's F.A.Q. (Error fixes) | How to Convert SRL-5 Scripts to SRL-6 | Draynor Chop N' Bank (RS3)| AIO Superheater (RS3)
T - E - A - MTogether Everyone Achieves More
This should work better.
Simba Code:function GetMiniMapDotsIn(WhatDot: String; x1, y1, x2, y2: Integer): TPointArray;
var
MapB, KMTarget, ITarget, W, H,
I, Dif, Radius, Hi, C: Integer;
TPA: TPointArray;
P1, P2: TPoint;
begin
case LowerCase(WhatDot) of
'npc', 'n', 'yellow', 'y': Dif := 4369;
'item', 'i', 'red', 'r': Dif := 23;
'player', 'p', 'white', 'w': Dif := 1907997;
'friend', 'f', 'green', 'g': Dif := 5376;
'team', 't', 'blue', 'b', 'cape': Dif := 2171941;
{'clan', 'c', 'orange', 'o': Dif := -1;}
else
srl_Warn('GetMiniMapDotsIn', '"' + WhatDot + '" is not a valid dot type', warn_AllVersions);
end;
MapB := BitmapFromClient(x1, y1, x2, y2);
KMTarget := GetKeyMouseTarget;
ITarget := GetImageTarget;
SetTargetBitmap(MapB);
GetBitmapSize(MapB, W, H);
C := 0;
if FindColors(TPA, 65536, 0, 0, W - 1, H - 1) then
begin
Hi := High(TPA);
SetLength(Result, Hi + 1);
for I := 0 to Hi do
begin
P1 := Point(TPA[i].x + 1, TPA[i].y);
P2 := Point(TPA[i].x + 2, TPA[i].y);
if PointInBox(P1, IntToBox(0, 0, W - 1, H - 1))
and PointInBox(P2, IntToBox(0, 0, W - 1, H - 1)) then
if ((FastGetPixel(MapB, P1.x, P1.y)
- FastGetPixel(MapB, P2.x, P2.y)) = Dif) then
begin
Result[C] := Point(TPA[I].x + x1 + 2, TPA[i].y + y1 - 1);
Inc(C);
end;
end;
end;
FreeTarget(GetImageTarget);
FreeBitmap(MapB);
SetKeyMouseTarget(KMTarget);
SetImageTarget(ITarget);
SetLength(Result, C);
RAaSTPA(TPA, 3);
end;
I don't know if this was never fix.. but I think it may be broken AGAIN..
I noticed: When the bot clicks the minimap, flag is bright red.. When character starts moving, flag is dark red.. The same goes for the flag stick.. Is this just happening to me alone? or anyone else?
Character doesn't know that it reached the flag.. I have to use while (ismoving) do wait(1);
I am Ggzz..
Hackintosher
(Scripts outdated until I update for new SRL changes)
AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
Summer = me busy, won't be around much.
Narcle can you commit my last function? It is incredibly more stable.
Yes I will. There's other stuff I need to commit later tonight as well will do it then.
Edit: Success!
Fixed FindFlag!!!! Added bmpFlag to global call
Fixed FindNPCChatText will now search for more then one word at a time (its not the best fix though)
Added mormonman's GetMiniMapDotsIn
Removed unneeded call in SRL for text shadow
Last edited by Narcle; 12-19-2011 at 03:36 AM.
(Scripts outdated until I update for new SRL changes)
AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
Summer = me busy, won't be around much.
Fastest and most accurate Flag.
Simba Code:function FindFlag(var X, Y: Integer): Boolean;
var
KMTarget, ITarget, I, Hi, Map, W, H: Integer;
TPA: TPointArray;
begin
Result := False;
Map := BitmapFromString(MMX2 - MMX1, MMY2 - MMY1, '');
CopyClientToBitmap(Map, MMX1, MMY1, MMX2, MMY2);
KMTarget := GetKeyMouseTarget;
ITarget := GetImageTarget;
SetTargetBitmap(Map);
GetBitmapSize(Map, W, H);
FindColors(TPA, 65536, 0, 0, W - 1, H -1);
FilterPointsDist(TPA, 0, 75.5, W / 2, H / 2);
Hi := Length(TPA);
for I := 0 to Hi - 1 do
if ((FastGetPixel(Map, TPA[I].X - 1, TPA[I].Y - 1) - FastGetPixel(Map, TPA[I].X, TPA[I].Y - 1)) = 6381921) then
begin
Result := True;
X := TPA[I].X + MMX1;
Y := TPA[I].Y + MMY1;
Break;
end;
FreeTarget(GetImageTarget);
FreeBitmap(Map);
SetKeyMouseTarget(KMTarget);
SetImageTarget(ITarget);
end;
~Home
Testing it atm.. I have to say it finds the flag much faster than before.. Problemo though:
Every time it reaches the flag, it will wait till a complete stop even if I have FFlag(10); Using SPS_WalkPath(TPointArray);
Edit:
What is with the Simba tags.. I've noticed sometimes when editing a post or quoting one, the simba tags get sooo messed up :S
I am Ggzz..
Hackintosher
I figured it out. Its not FindFlag making it wrong. In fact because that function is slower it makes it higher chance to detect it. They make the flag disappear randomly for 100-250ms so fast you don't even see it do it (most of the time).
Tricky little bastards.
(Scripts outdated until I update for new SRL changes)
AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
Summer = me busy, won't be around much.
I have it resolved in SRL5.
(Scripts outdated until I update for new SRL changes)
AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
Summer = me busy, won't be around much.
Flag; Is now not working for me, but only in certain locations.
At Yanille it worked, Now I am trying to use it near Seers, and its not working at all. I used the same procedure in both places, just different colors and positions.
Simba Code:Procedure WalkToSpinner;
Begin
if not LoggedIn then Exit;
FindNormalRandoms;
ClickNorth(True);
Walking(2717036, 20, Point(576, 59));
Flag;
Walking(733019, 20, Point(611, 35));
Flag;
Walking(5405324, 20, Point(601, 65));
Flag;
End;
My Scripts:[HardRockin] Iron Miner (Best mining exp/hr on this site, that I have found)
No it doesn't?
Simba Code:program FlagTracker;
{$i SRL\SRL.scar}
var
x, y: Integer;
Found: Boolean;
begin
ActivateClient;
Writeln('You now have 2 seconds to place a flag');
Sleep(2000);
repeat
Found := FindColor(x, y, 17378, MMX1, MMY1, MMX2, MMY2);
MoveMouse(x, y);
Writeln(Found);
Until(IsKeyDown(VK_F4));
end.
Always was spewing out True until I personally saw the flag disappear, which was when it was spewing out False. It is incredibly fast (since it is a static colour with no tolerance comparison), and I deliberately placed the flag in the top-left corner (which is the area first to be found by FindColor).
You may contact me with any concerns you have.
Are you a victim of harassment? Please notify me or any other staff member.
| SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |
(Scripts outdated until I update for new SRL changes)
AK Smelter & Crafter [SRL-Stats] - Fast Fighter [TUT] [SRL-Stats]
If you PM me with a stupid question or one listed in FAQ I will NOT respond. -Narcle
Summer = me busy, won't be around much.
You may contact me with any concerns you have.
Are you a victim of harassment? Please notify me or any other staff member.
| SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |
There are currently 1 users browsing this thread. (0 members and 1 guests)