SRL Archive - OSR Help

Home Teleport?


slicedy0u

2012-01-12 03:05:13

I tried using this:

procedure Tele;
begin
Writeln('Teleporting!');
GameTab(tab_Magic);
Wait(200 + Random(50));
if FindDTM(Home, x, y, MIX1, MIY1, MIX2, MIY2) then
Mouse(x, y, 3, 3, True);
Wait(1900 + Random(25));
end;

It clicks the magic tab, but doesn't teleport.. Any ideas? :D

YoHoJo

2012-01-12 03:09:29

Probaly made DTM improperly.
I think magic.Simba has spell casting procedure in it Anywyas, and you can just use a coordinate click (assuming eveyones spells are in the same spot).

Anywyas, try using a bitmap instead of a DTM for this, and use findbitmaptolerance to search for it this will be easier and more successful!

slicedy0u

2012-01-12 03:10:58

From: YoHoJo
Probaly made DTM improperly.
I think magic.Simba has spell casting procedure in it Anywyas, and you can just use a coordinate click (assuming eveyones spells are in the same spot).

Anywyas, try using a bitmap instead of a DTM for this, and use findbitmaptolerance to search for it this will be easier and more successful!


Thank you :D I'll give it another shot :P

Jhangir

2012-01-12 09:29:22

Yea I used a bitmap it works for me 99% of the time

Press Play

2012-01-12 22:56:46

Although it is unlikely, you might not be waiting enough time for the magic tab to appear. So you might want to call something like this:
procedure Tele;
var
t: Integer;
begin
Writeln('Teleporting!');
GameTab(tab_Magic);
MarkTime(t);
Repeat
Wait(200 + Random(50));
if FindDTM(Home, x, y, MIX1, MIY1, MIX2, MIY2) then
Mouse(x, y, 3, 3, True);
Until(TimeFromMark(t) > 3000)
Wait(1900 + Random(25));
end;
In this procedure now, it will keep trying to find the DTM for 3 seconds. If it can't find it, then it will stop.

MarkTime(t) get the time at that position,
TimeFromMark(t) shows how much time has passed since then in milliseconds.