xujnea
2015-05-16 19:02:26
Hello, I'm trying to create function which would do things,based on xp increases. Here some code :
I get stuck at " run2 ". Maybe someone has ideas,how can I fix it?
program new;
//{$DEFINE SMART}
//{$DEFINE WALKER}
{$i AeroLib/AeroLib.Simba}
{$i Reflection/Reflection.Simba}
var
xpB, xpA, runs : Integer; // xpB - xp before, xpA - xp after
function XpBefore : Integer;
begin
xpB := TReflectLocalPlayer.GetSkillExp(12); // This function to mark xp
Result := xpB;
end;
function XpAfter : Integer;
begin
xpA := TReflectLocalPlayer.GetSkillExp(12); // This function for comparison
Result := xpA;
end;
function XpCompare : Boolean;
begin
if (xpB < xpA) then // Function to check if xp increased
Result := true;
end;
procedure run1
begin
XpBefore; // Marking xp
//do stuff;
end;
procedure run2
begin
XpAfter; // Trying to find xp for comparison
if not XpCompare then
Sleep(RandomRange(800, 2500));
if XpCompare then
//do stuff;
end;
begin
ClearDebug;
InitAL;
Reflect.Setup;
repeat
begin
Inc(runs);
run1;
run2; // <---- here I got stuck
end;
until(runs > 20);
end;I get stuck at " run2 ". Maybe someone has ideas,how can I fix it?