Cazax
2008-06-10 10:31:04
Magic.scar got outdated. Why? Jagex changed the colors, etc and they dont work. So i made functions to avoid outdated bitmaps:
Now we just need a checker if the spell exists…
Or more tolerance.
PS: I made those functions for more randomness while clicking :) SpellBox covers all the spell :rolleyes:
Test them!
Function SpellBox(Spell : Integer): TBox;
Var
SpellX : Integer;
Begin
If Not InRange(Spell, 1, 67) Then
Begin
srl_Warn('SpellBox', 'Invalid Spell', Warn_AllVersions);
Exit;
End;
SpellX := Spell;
While SpellX > 7 Do
DecEx(SpellX, 7);
Result.X1 := 540 + (SpellX * 21);
Result.Y1 := 205 + (Ceil(SpellX / 7.0) * 25);
Result.X2 := 560 + (SpellX * 21);
Result.Y2 := 221 + (Ceil(SpellX / 7.0) * 25);
End;Function SpellCoords(Spell : Integer): TPoint;
Var
Box : TBox;
Begin
If Not InRange(Spell, 1, 67) Then
Begin
srl_Warn('SpellCoords', 'Invalid Spell', Warn_AllVersions);
Exit;
End;
Box := SpellBox(Spell);
Result.X := (Box.X1 + Box.X2) Shr 1;
Result.Y := (Box.Y1 + Box.Y2) Shr 1;
End;Usage: Procedure CastLumby;
Var
Box : TBox;
Begin
Box := SpellBox(1);
Gametab(7);
//If SpellExists(1) Then
MouseBox(Box.X1, Box.Y1, Box.X2, Box.Y2);
End;Or:Procedure CastLumby;
Var
TP : TPoint;
Begin
TP := SpellCoords(1);
Gametab(7);
//If SpellExists(1) Then
Mouse(TP.X, TP.Y, 4, 4, True);Now we just need a checker if the spell exists…
Or more tolerance.
PS: I made those functions for more randomness while clicking :) SpellBox covers all the spell :rolleyes:
Test them!
