And for your xp detection, I'd suggest declaring something as GetXpBarTotal
Simba Code:
XpFirst := GetXPBarTotal;
Since GetXPBarTotal - GetXPBarTotal will = 0. You need to GetXPBarTotal from an earlier XP amount and set that to a variable. Then you can continue to call GetXPBarTotal until it has increased
And personally, I'd declare that before you click on your Inv.
Simba Code:
Function Enchant:Boolean;
var
XPFirst, i: Integer;
begin
if InvFull then
begin
for i:= 1 to 28 do
if ExistsItem(i) then
begin
SendKeys('1', 5, 5);
XPFirst := GetXPBarTotal;
InvMouse(i,1);
while (XPFirst = GetXPBarTotal) do
Wait(50);
end;
end;
end;
Try that out
I haven't tested that.
If that doesn't work just play around with it