SRL Archive - Help and Support

MM Dtm, Help me PLEASE !


Avaphi

2006-06-25 21:39:29

Hello there. I am currently working on a BIG script, It deals with mapwalking. I am doing a FANTASTIC job so far. Yet I come to one big problem, Map Angle. It seems that my walking only triggers and works correctly if my map is near enough to a certain angle. Now I am in dire need of help, So me and dark_sniper were discussing ways to do this and found dtms were the most viable. So, he and I are both attempting to make it so, I can call the certain procedure that makes my minimap go to the exact angle(Now, you cant use the Compass, Why you ask, because Post-Update, the MM dynamically goes left and right every so often) So I am going to have to find a STABLE Dtm function that I will be able to call upon, and it will correct my map angle to the specified point…every…single…time. Any help will be greatly appreciated, And if you help enough I will DEFINIETLY Let you test the private script your procedure will go on :cool:

Dark_Sniper

2006-06-25 21:54:28

[PHP]Procedure FindDTMRotate(DTM, X, Y, X1, Y1, X2, Y2, StartAngle, EndAngle, DistAngle : Integer);
Var
E : Extended;
begin
StartAngle:= round(StartAngle * 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609)
EndAngle:= round(EndAngle * 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609)
FindDTMRotated(DTM, X, Y, X1, Y1, X2, Y2, StartAngle, EndAngle, DistAngle, E)
end;

Function StraightFally : Boolean;
var
FailSafe : Integer;
Fally : Integer;
begin

Fally:='dtm here'

if findDTMrotate(Fally, x, y, MMX1, MMY1, MMX2, MMY2, 357, 3) then
begin
Result:=True;
Exit;
end;
SendArrowSilentWait(3, 200)
repeat
wait(1000+random(100))
SendArrowSilentWait(1, 10)
FailSafe:=FailSafe + 1;
until(FindDTMRotate(Fally, x, y, MMX1, MMY1, MMX2, MMY2, 357, 3)) or (FailSafe =< 160)
if failSafe =< 160 then
Result:= false;
if FindDTMRotate(Fally, x, y, MMX1, MMY1, MMX2, MMY2, 357, 3) then
Result:= true;
end;[/PHP]

basic for rotating the map to right angle :p.

Avaphi

2006-06-25 22:16:25

compilation error man :\

driger1592

2006-06-25 22:43:45

Ya, you're supposed to replace

Fally:='dtm here'

With a DTM ;) But if I were doing this, I'd probably use the Bitmap of the N on the compass (if it's usable - I'm not sure about the color =\).

Dark_Sniper

2006-06-25 22:55:01

sorry i wrote that pretty quickly some erros are in there.

Roberty Bob

2006-06-26 00:58:58

I made this today with you in mind db… although I'm using it in my scripts too.
I don't know the exact angle you are hoping for… but i can use this for any set angle i want… here are simple steps.. just to avoid confusion with my weird code :P
the boolean argument you pass in is just whether the mouse is already active within your RS window.

STEP 1: rotate your RS MM to the angle you want always…
STEP 2: take a screenie.
STEP 3: make a small BMP out of the current location of the "north" - N … I use the right hand stem of the N.
STEP 4: get the MM coordinates surrounding the little BMP you have taken…
STEP 5: modify the below code with your new BMP and z1,z2,z3,z4.

I'm proud of it though it might not be considered super great!! It always works for me.


[PHP]function RBobCompassNorth(MouseActive:boolean) : Boolean;
var z1, z2, z3, z4, RotDur,Count,BMPtol, bx,by, RNumber,North: Integer;
var ArrowByte: Byte;
begin
RotDur:=50;
ArrowByte:=1;
BMPtol:=15;
RNumber:=100;
z1:= 567 ;
z2:= 7;
z3:= 571;
z4:= 12;
North := BitmapFromString(2, 3, 'z78DA337633000263BC240088' +
'CE0757');

if not(MouseActive) then
mouse(533,44,15,15,True);

SendArrowSilentWait(3, 150+random(100));
repeat
Count:= Count + 1
SendArrowSilentWait(ArrowByte, RotDur+random(20));
until(FindBitmapSpiralTolerance(North,bx, by, z1, z2, z3, z4,BMPtol)) or (Count >= RNumber)
Result:= True
end;[/PHP]

Avaphi

2006-06-26 03:52:56

If this works… I have an offer for you. Get on msn..