Vowel
2015-03-30 23:21:16
Hi, I've just written up this script. It compiles and everything (using LAPE reflection), however it doesn't perform any of the actions it's supposed to in-game… here's the code:
program combatRing;
{$DEFINE SMART}
{$i Reflection/Reflection.Simba}
var MyPlayer: TReflectLocalPlayer;
function outOfRing(): boolean;
var
outsidePolygon: TPointArray;
begin
outsidePolygon := [[7255, 11604], [7254, 11604], [7253, 11604], [7250, 11604]];
if Reflect.Tiles.InPolygon(outsidePolygon) then
result := true;
end;
function inRing(): boolean;
var
insidePolygon: TPointArray;
begin
insidePolygon := [[7253, 11610], [7252, 11610], [7251, 11610], [7250, 11610];
if Reflect.Tiles.InPolygon(insidePolygon) then
result := true;
end;
procedure enterRing();
var
combatRing: TReflectObject
begin
if combatRing.Find(objGame, 'Combat ring', 40) then
wait(randomrange(43,95));
Reflect.Mouse.Move(combatRing.GetMSPoint, 2, 2);
wait(randomrange(39, 75));
Reflect.Mouse.Click(Mouse_Left);
while MyPlayer.IsMoving do
Wait(randomrange(900,1200));
end;
procedure attackPlayer();
var
Player: TReflectPlayer;
begin
wait(500 + random(1097));
while not MyPlayer.IsUnderAttack do
begin
if Player.Find('luuuke dude') then
Reflect.Mouse.Move(Player.GetMSPoint, 2, 2);
wait(randomrange(50,100));
Reflect.Mouse.Click(Mouse_Left);
wait(randomrange(50,150));
while MyPlayer.IsMoving do
Wait(randomrange(1000,1300));
end;
end;
procedure loop();
begin
if outOfRing() then
begin
enterRing;
end;
if inRing() then
begin
Wait(randomrange (120, 300));
attackPlayer;
end;
end;
begin
Reflect.Setup;
repeat
loop;
until (false);
end.