SRL Archive - SRL Archives

InGE fix


Awkwardsaw

2009-08-16 07:13:09

although J_Pizz made a fix too, i might as well post mine :)

it uses dtms of the bankers, and the other is for the walls.

i cant time how long it takes to find it because my cpu sucks, and it would be slow no matter what i use :p

Function InGeEx: boolean;
var inge : array [0..1] of integer; x, y, i : integer;
begin
InGe[0] := DTMFromString('78DA63CC64666060646440067FFE308169982' +
'86311500D0B01357940353C04D4A401D570E2570300CB1109CA');
InGe[1] := DTMFromString('78DA63AC606660B8CB8002BE7D7CC5C005A41' +
'981F83F10304E05AAF9895B0D08304E07AA1166C450C3005503C6' +
'2E4035FF18F0AB4901AA31C06F0E009CF317A7');
for i:= 0 to 1 do
begin
if dtmrotated(inge[i], x, y, mmx1, mmy1, mmx2, mmy2) then
begin
result := true;
break;
end;
end;
freedtm(inge[0]);
freedtm(inge[1]);
end;

Baked0420

2009-08-16 09:58:23

I'm lazy right now, but make me something to run to test how long it takes and I'll run it for you. Good job with a fix though

EDIT: This function is just to find out if you are at the g/e? not in it, like the exchange screen open?

EvilChicken!

2009-08-16 10:10:42

Akward, use DTMRotated instead of FindDTMRotated.

And, those DTMs look pretty big, are you sure there's no way to make the points fewer, or have each of them cover a smaller area? (That is, if you have the points to different areasizes than 0.)

JPHamlett

2009-08-16 10:38:01

From: Baked0420
I'm lazy right now, but make me something to run to test how long it takes and I'll run it for you. Good job with a fix though

EDIT: This function is just to find out if you are at the g/e? not in it, like the exchange screen open?


mine works for the open screen thingy

Awkwardsaw

2009-08-16 18:22:10

From: EvilChicken!
Akward, use DTMRotated instead of FindDTMRotated.

And, those DTMs look pretty big, are you sure there's no way to make the points fewer, or have each of them cover a smaller area? (That is, if you have the points to different areasizes than 0.)


yes, i can make them smaller. i just made it so big to make sure(they are about 6-8 points each), :p

and yes baked, this is just to find if you are at the place, not in the screen

edit: i edited the function, like EC! said :)

Awkwardsaw

2009-08-19 01:56:03

soo.. nothing is going to be done about InGE? :(

NCDS

2009-08-19 01:58:26

From: Awkwardsaw
soo.. nothing is going to be done about InGE? :(


That tends to happen with the majority of fix's that get posted…

Awkwardsaw

2009-08-19 02:11:08

From: NCDS
That tends to happen with the majority of fix's that get posted…


i'm not to worried about this particular procedure to be added, or if its mine at all. its just that its used in this script, a lot haha. and in every GE procedure

EvilChicken!

2009-08-19 09:21:54

I'll commit this if you test it in five different worlds and it works every time.

BobboHobbo

2009-08-19 10:44:29

From: EvilChicken!
Akward, use DTMRotated instead of FindDTMRotated.

And, those DTMs look pretty big, are you sure there's no way to make the points fewer, or have each of them cover a smaller area? (That is, if you have the points to different areasizes than 0.)


May I ask whats the difference between FindDTMRotated and DTMRotated?

Naum

2009-08-19 18:34:12

From: BobboHobbo
May I ask whats the difference between FindDTMRotated and DTMRotated?


DTMRotated does exactly what FindDTMRotated does, except you do not have to specify the angle. DTMRotated will keep incrementing the angle until the DTM is found or if the angle is above 'Pi / 3'. DTMRotated is in SRL whilst FindDTMRotated is in SCAR.

I'm sure the code can explain it better:

{*******************************************************************************
function DTMRotated(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Boolean;
By: Yakman
Description: First looks for a DTM without rotation, then increases the amount
of rotation around 0 gradually until it finds the DTM. A bit like the
ProgressiveTol Bitmap Engines.
*******************************************************************************}

function DTMRotated(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Boolean;
var
t, s, AngleFound: Extended;
begin
if (FindDTM(DTM, x, y, x1, y1, x2, y2)) then
begin
Result := True;
Exit;
end;
repeat
s := 0.3;
repeat
if (FindDTMRotated(DTM, x, y, x1, y1, x2, y2, 0 - t, 0 + t, s, AngleFound)) then
begin
Result := True;
Exit;
end;
s := s - 0.1;
until (s <= 0.1);
t := t + (Pi / 20);
until (t >= Pi / 3);
end;

Awkwardsaw

2009-08-20 01:55:11

From: EvilChicken!
I'll commit this if you test it in five different worlds and it works every time.


mkay :p

JPHamlett

2009-08-20 02:08:22

im sorry i dont mean to drag on your function or anything but y would we need this at all?

it checks if u are standing in the GE


and if it needed u could shorten it big time if i recall there are some very unique symbols in the ge y not make a dtm of them

Awkwardsaw

2009-08-20 02:37:17

because they are used in every function in grandexchange.scar, tbh i think it should just be removed :p but if not it needs a fix

and yes there are very unique symbols, which is what this dtm covers. :) they are not player accessable, unlike the symbols on the minimap, like the bitmap that the current one has

and edit: i tested in 5 different worlds, 5 times each with different compass angles, and they all worked :p

JPHamlett

2009-08-20 06:07:00

well the current in ge checks if u are in the menu to actaully do the exchanging

edit the words in the description could go either way

noidea

2009-08-20 06:08:34

From: EvilChicken!
I'll commit this if you test it in five different worlds and it works every time.


Moar :D

Remember those freak worlds :p

I was testing FindTreeColour for 20 HOURS straight, and I got two freak worlds :p

Awkwardsaw

2009-08-20 06:15:43

From: J_Pizzle
well the current in ge checks if u are in the menu to actaully do the exchanging


:o the bitmap showed the symbol on the minimap.

is it on the screen too? if it is, i might cry lol

JPHamlett

2009-08-20 06:25:58

From: Awkwardsaw
:o the bitmap showed the symbol on the minimap.

is it on the screen too? if it is, i might cry lol


are you talking about the hang holding the coins if so yes it is in the screen

Awkwardsaw

2009-08-20 06:28:27

From: J_Pizzle
are you talking about the hang holding the coins if so yes it is in the screen


:( [spam]OAIFB0U3QG40E8GF80Q3BIPJNRGFCLX;uaw97653y4o2geuwhdb0fuq3y0WYRGTFPBGPCNQEW0UGYR0BFPOVCABPWEYGR5Q03847YG0HBFCQAUGEWRFNCAPAIEUBHFVPCQAEIJHBTG[/spam]

i dont think i deserve to script for a while.. lol

JPHamlett

2009-08-20 06:50:47

its ok man id be honored to do a script with u any time

Awkwardsaw

2009-08-20 06:55:31

From: J_Pizzle
its ok man id be honored to do a script with u any time


:) thanks

JPHamlett

2009-08-20 07:05:57

From: Awkwardsaw
:) thanks


yup anytime

Sir R. M8gic1an

2009-08-24 13:09:28

InGE is for the GE screen, not for the "place".

~RM

Awkwardsaw

2009-08-28 01:51:03

From: Rasta Magician
InGE is for the GE screen, not for the "place".

~RM


[spam]OAIFB0U3QG40E8GF80Q3BIPJNRGFCLX;uaw97653y4o2geuwhd b0fuq3y0WYRGTFPBGPCNQEW0UGYR0BFPOVCABPWEYGR5Q03847 YG0HBFCQAUGEWRFNCAPAIEUBHFVPCQAEIJHBTG[/spam]

i dont think i deserve to script for a while.. lol


:( i know