Vowel
2015-04-01 14:53:58
Hi there, I've been trying to write this for like a week now, and I'm unable to finish it or have it actually do what it's supposed to do. I've been trying to get help on the forums and the IRC and while some people have tried to help me (mayor, elfyyy, tls, thank you) doesn't seem like anyone really wants to spend their time helping a noob, which sucks because there isn't much resources on the LAPE include.. when it runs it goes through the whole loop which it shouldn't be cause each function checks where my character is currently located and shouldn't move to the next function unless my character is in a new polygon.. Also, it doesn't click the combat ring like it should, I've tried 5-6 different functions and none work…
enterMainRing() and the rest of the enter functions are the two different functions i've tried using to click on the combat ring to enter are the most recent i've tried to no avail
SOMEONE PLEASE SAVE ME,
skype : vowelmachine
enterMainRing() and the rest of the enter functions are the two different functions i've tried using to click on the combat ring to enter are the most recent i've tried to no avail
SOMEONE PLEASE SAVE ME,
skype : vowelmachine
program combatRing;
{$DEFINE SMART}
{$i Reflection/Reflection.Simba}
var MyPlayer: TReflectLocalPlayer;
function mainOfRing(): boolean;
var
outsidePolygon: TPointArray;
begin
outsidePolygon := [[11856, 10836], [11863, 10836], [11863, 10841], [11856, 10841]];
result := Reflect.Tiles.InPolygon(outsidePolygon); // can shorten this to result :=
end;
function leftOfRing(): boolean;
var
outsidePolygon: TPointArray;
begin
outsidePolygon := [[11856, 10842], [11857, 10842], [11857, 10845], [11856, 10845]];
result := Reflect.Tiles.InPolygon(outsidePolygon); // can shorten this to result :=
end;
function rightOfRing(): boolean;
var
outsidePolygon: TPointArray;
begin
outsidePolygon := [[11856, 10846], [11856, 10847], [11863, 10847], [11863, 10846]];
result := Reflect.Tiles.InPolygon(outsidePolygon); // can shorten this to result :=
end;
function topOfRing(): boolean;
var
outsidePolygon: TPointArray;
begin
outsidePolygon := [[11856, 10846], [11856, 10847], [11863, 10847], [11863, 10846]];
result := Reflect.Tiles.InPolygon(outsidePolygon); // can shorten this to result :=
end;
function inRing(): boolean;
var
insidePolygon: TPointArray;
begin
insidePolygon := [[7447, 11802], [7447, 11802], [7447, 11802], [7447, 11802]];
result := Reflect.Tiles.InPolygon(insidePolygon);
end;
procedure enterMainRing();
var
combatRing: TReflectObject;
var tile : TTile;
var point : TPoint;
begin
writeLn('left ring');
begin // I added a begin..end here
tile := [7447, 11802];
wait(randomrange(43,95));
point := Reflect.Tiles.TileToMS(tile, 0, 0, 0);
Reflect.Mouse.Move(point, 3, 3, MOUSE_LEFT); // Can click at same time
while MyPlayer.IsMoving do
Wait(randomrange(900,1200));
end;
end;
procedure enterLeftRing();
var
combatRing: TReflectObject;
begin
writeLn('left ring');
if combatRing.Find(objGame, '13138', 40) then
begin // I added a begin..end here
wait(randomrange(43,95));
Reflect.Mouse.Move(combatRing.GetMSPoint, 2, 2, MOUSE_LEFT); // Can click at same time
while MyPlayer.IsMoving do
Wait(randomrange(900,1200));
end;
end;
procedure enterRightRing();
var
combatRing: TReflectObject;
begin
writeLn('right ring');
if combatRing.Find(objGame, '13140', 40) then
begin // I added a begin..end here
wait(randomrange(43,95));
Reflect.Mouse.Move(combatRing.GetMSPoint, 2, 2, MOUSE_LEFT); // Can click at same time
while MyPlayer.IsMoving do
Wait(randomrange(900,1200));
end;
end;
procedure enterTopRing();
var
combatRing: TReflectObject;
begin
writeLn('top ring');
if combatRing.Find(objGame, '13139', 40) then
begin // I added a begin..end here
wait(randomrange(43,95));
Reflect.Mouse.Move(combatRing.GetMSPoint, 2, 2, MOUSE_LEFT); // Can click at same time
while MyPlayer.IsMoving do
Wait(randomrange(900,1200));
end;
end;
procedure attackPlayer();
var
Player: TReflectPlayer;
begin
wait(500 + random(1097));
while not MyPlayer.IsUnderAttack do
begin
if Player.Find('removed') then
begin // added this begin here
Reflect.Mouse.Move(Player.GetMSPoint, 2, 2, MOUSE_LEFT);
wait(randomrange(50,150));
while MyPlayer.IsMoving do
Wait(randomrange(1000,1300));
end;
end;
end;
procedure loop();
begin
if mainOfRing() := true then
begin
enterMainRing;
end;
if leftOfRing() := true then
begin
enterLeftRing;
end;
if topOfRing() := true then
begin
enterTopRing;
end;
if rightOfRing() := true then
begin
enterRightRing;
end;
if inRing() := true then
begin
Wait(randomrange (120, 300));
attackPlayer;
end;
end;
begin
Reflect.Setup;
repeat
loop;
until(false);
end.