SRL Archive - General

Coverd Symbols?


BobboHobbo

2007-08-14 06:54:27

Hmm, i been looking and searching around and couldnt find anything about coverd symbols. Anyone please post a link somewhere or post something which can find covered symbols like a bank symbol.

Thanks.

Wizzup?

2007-08-14 08:25:52

From: bobbohobbo
Hmm, i been looking and searching around and couldnt find anything about coverd symbols. Anyone please post a link somewhere or post something which can find covered symbols like a bank symbol.

Thanks.


PM Boreas, he might be able to help you out.

ZephyrsFury

2007-08-14 10:07:43

I suppose you could try to decreasing the symbol accuracy by assigning a value between 0 and 1 to SymbolAccuracy. 0.8 is the default so something lower than that might help. The thing is though if you set it too low then it might confuse two different symbols. Like when I set SymbolAccuracy to 0.5, SRL confuses the water fountain symbol with the quest symbol. Also make sure to change SymbolAccuracy back to 0.8 after you set it.

Boreas

2007-08-14 11:05:26

program New;
{.include srl/srl.scar}

function InIntArray(TheInt:integer;TheArray:array of integer):boolean;
var i:integer;
begin
repeat
if TheArray[i]=TheInt then
result:=true;
i:=i+1;
until ((i=getarraylength(TheArray)) or (result));
end;

procedure RemoveFromTPA(Index:integer; var TPA:array of tpoint);
var swapTP:tpoint;
AL:integer;
begin
AL:=getarraylength(TPA);
swapTP:=TPA[AL-1];
TPA[AL-1]:=TPA[Index];
TPA[Index]:=swapTP;
setarraylength(TPA,AL-1);
end;
procedure CrowdedWait;
var tmpx1,tmpy1,i:integer;
begin
case random(2) of
1: begin
gametab(2);
i:=random(23);
Tmpx1:=547+(((((i)+2)mod 3))*(611-547));
Tmpy1:=207+(((((i)-1)/3))*(238-207));
MMouse(Tmpx1+random(63),Tmpy1+random(30),0,0);
end;
0:
begin
gametab(5);
Mouse(592,415,random(32),random(32),true);
end;
end;
end;

function EYCScreen:boolean;
var EYCDTM,tmpx,tmpy:integer;
begin
EYCDTM := DTMFromString('78DA635464606050664001FF67C8836946289' +
'F518648353A04D42812A1C69908BBDC8830C783B03900F9410E64' +
'');
result:= FindDTM(EYCDTM,tmpx,tmpy,26,34,184,50);
end;
procedure CloseEYC;
begin
if EYCScreen then
Mouse(478+random(15),34+random(15),0,0,true);
end;

type ColorTPA = record
color:integer;
tpa: array of tpoint;
end;
function FindCrowdedSymbol(var mx, my:integer; Symbol:string;Tries:integer):boolean;
var
PlayerDotCTPA:array of ColorTPA;
client,Tried,tab,parray,parray2,tx,ty,t,tmpcolor,mmbmp,dropdot,AL,PointsLeft:integer;
ColorArray: array of integer;
tmpbool:boolean;

begin
tab:= GetCurrentTab;
MMbmp:=BitmapFromString(mmx2-mmx1,mmy2-mmy1,'');
setarraylength(colorarray,6);
ColorArray[0]:=16711422;
ColorArray[1]:=15527148;
ColorArray[2]:=13816530;
ColorArray[3]:=14869218;
ColorArray[4]:=12961221;
ColorArray[5]:=65536;

repeat
t:=getsystemtime;
result := FindSymbol(mx,my,Symbol);
if result then
exit;
dropdot:= DTMFromString('78DA6354666060606340012FA134238C56021' +
'2ECA86A3EA2AB5104121CA86A6EA2AB51C634E71C921A66200600' +
'386A0432');
setarraylength(colorarray,6);
if FindDTM(dropdot,tx,ty,mmx1,mmy1,mmx2,mmy2)then
begin
setarraylength(colorarray,18);
ColorArray[6]:=getcolor(tx,ty);
ColorArray[7]:=getcolor(tx,ty+1);
ColorArray[8]:=getcolor(tx-1,ty-1);
ColorArray[9]:=getcolor(tx-1,ty);
ColorArray[10]:=getcolor(tx-1,ty+1);
ColorArray[11]:=getcolor(tx-1,ty+2);
ColorArray[12]:=getcolor(tx-2,ty-1);
ColorArray[13]:=getcolor(tx-2,ty);
ColorArray[14]:=getcolor(tx-2,ty+1);
ColorArray[15]:=getcolor(tx-2,ty+2);
ColorArray[16]:=getcolor(tx-3,ty);
ColorArray[17]:=getcolor(tx-3,ty+1);
end;
freedtm(dropdot);
CopyClientToBitmap(MMbmp,mmx1,mmy1,mmx2,mmy2);
AL:=getarraylength(colorarray);
setarraylength(PlayerDotCTPA,AL);
for parray:=0 to AL-1 do
begin
PlayerDotCTPA[parray].color:=colorarray[parray];
FindColorsSpiralTolerance(mmcx,mmcy,PlayerDotCTPA[parray].tpa,
PlayerDotCTPA[parray].color,mmx1,mmy1,mmx2,mmy2,0);
end;
CrowdedWait;
repeat
for parray:=0 to AL-1 do
begin
for parray2:=0 to getarraylength(PlayerDotCTPA[parray].tpa)-1 do
begin
tmpcolor:=getcolor(PlayerDotCTPA[parray].tpa[parray2].x,PlayerDotCTPA[parray].tpa[parray2].y);
if not(InIntArray(tmpcolor,ColorArray)) then
begin
FastSetPixel(mmbmp,PlayerDotCTPA[parray].tpa[parray2].x-mmx1,PlayerDotCTPA[parray].tpa[parray2].y-mmy1,tmpcolor);
RemoveFromTPA(parray2,PlayerDotCTPA[parray].tpa);
end;
end;
end;
PointsLeft:=0;
for parray:=0 to AL-1 do
begin
PointsLeft:=PointsLeft+getarraylength(PlayerDotCTPA[parray].tpa);
end;

begin
client:= GetClientWindowHandle;
SetTargetBitmap(mmbmp);
tmpbool:=FindSymbolIn(tx,ty,'bank',0,0,mmx2-mmx1,mmy2-mmy1);
SetClientWindowHandle(client);
end;
// writeln('points '+inttostr(pointsleft));
until (tmpbool or ((getsystemtime-t)>60000) or (PointsLeft<10));
if tmpbool then
begin
//writeln('symbol found on try '+inttostr(Tried)+' in '+inttostr(getsystemtime-t)+'ms');
result:=true;
mx:=tx+mmx1;
my:=ty+mmy1;
gametab(tab);
Freebitmap(mmbmp);
exit;
end;
Tried:=Tried+1;
//writeln('trying again try '+inttostr(Tried));
CloseEYC;
logout;
loginplayer;
until Tried>Tries;
result:=false;
mx:=0;
my:=0;
gametab(tab);
Freebitmap(mmbmp);
end;

var myx,myy:integer;
begin
setupsrl;
setarraylength(players,1);
Players[0].name:='';
Players[0].pass:='';
Players[0].nick:='';
Players[0].active:=true;
loginplayer
FindCrowdedSymbol(myx,myy,'bank',3);
writeln(inttostr(myx)+' '+inttostr(myy));
end.

R0b0t1

2007-08-14 11:14:02

Well, they answered your question, I think, but you could try to search next time :D, It would save some time.

Also, since I gotta help you if I report you, you could always try to find a deformed bitmap… I just don't know how deformed…


[BANANA]NOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOB
[LEFT]You, Bobbohobbo, have been reported for being a NOOB.
Your
Current violations include
  1. Not Searching for
This brings you to a new total of (3) Noob Points!

For more information on Bobbohobbo please go Here.

For more information from This database please go Here.

For more information on The Noob Points System please go Here.

For more information on Noobs please go Here.

[/LEFT]
NOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOB[/BANANA]

ZephyrsFury

2007-08-14 11:16:31

From: r0b0t1
Well, they answered your question, I think, but you could try to search next time :D, It would save some time.



He did say he searched and couldn't find it….

From: bobbohobbo
i been looking and searching around and couldnt find anything about coverd symbols.

R0b0t1

2007-08-14 11:27:36

Oh… Geez. Well, bobo, if you're mad or anything, pm lordgreggreg to get them removed… *caugh*

Tim0suprem0

2007-08-14 13:01:27

EDIT: Justice.

LordGregGreg

2007-08-14 14:10:25

done, robot, please be more careful next time. it is better to not report 10 noobs, than to report one person wrongly. :) cheers.

BobboHobbo

2007-08-14 17:43:53

Thanks everyone.

R0bot you should get a noob point for not reading the post *nah jokes all good*

Thanks Boreas for the functions/procedures.

The Element

2007-08-14 20:07:52

Nice one Boreas,

How do those functions work though?

Boreas

2007-08-14 23:29:56

The idea behind it is that even if a symbol is partially covered (too much to be identified without lowering accuracy so much so that it could be incorrect) the whole time, parts of it will be uncovered, although not all the parts will be uncovered at the same time.

So, it copies the minimap to bitmap, and makes a list of all white and red dots, specifically the points and colors within them. Then it looks at the real minimap (by this time some players have moved) and looks at the spots on the list. If a spot on the list doesn't have the color anymore (meaning a player that was there intitially moved away), it updates the bitmap to what is there now. Eventually, the bitmap gets less and less covered.

During this time, it tries to find the symbol on the bitmap, and stops when it finds it. If it is really covered, after about a minute (not doing anything for 1.5 minutes will log you out), it will log out and log in and try again, as this makes the symbol move. It will try this the number of times specified in the parameters (Tries). After that many tries, it will give up and return 0,0 and false. Also, it tries normally finding the symbol first, and it does a little antiban for an excuse for not doing anything for up to a minute.

If you have any other questions about it please ask.

Pyro

2007-08-15 04:20:13

Although lowering accuracy is easier :p ahaha. But nice boreas non the less. Aslong as the symbols arent to similar to other stuff around the map and you dont go to low. I never had problem with bank symbol or yew symbols being covered and just lowering tolerance.

Killerdou

2007-08-15 04:49:31

meh symbol finding wont be a problem with the new srl:)

n3ss3s

2007-08-15 07:43:37

I might be blind, but I think that in the symbol.scar it says something about that FindSymbol does find symbols partially covered by players.

ZephyrsFury

2007-08-15 08:28:44

From: n3ss3s
I might be blind, but I think that in the symbol.scar it says something about that FindSymbol does find symbols partially covered by players.


It does but sometimes the symbol is covered too much for it to pick up like the bank symbol when there are a lot of people playing.