Flight
2011-07-21 21:20:53
Credits to Huthaifah for the idea, and credit to Awkwardsaw for cleaning it up. :)
Just call "LevelUpEx" in your main loop (or wherever appropriate) so it's always being checked.
This will check if you've lleveled up recently through both the 'Level-up chat display' and the chat messages. It'll click continue if the display is present and then move to your Stats tab, click the skill that leveled up, and close out of that window.
If you're doing a repetitive task (Woodcuting, fishing, cooking, ect…) you'll continue to do that task after this has closed out the level up window. It is, however, a bit slow while on the level up window because it uses 'HoverSkill', which has a 5-14 second wait. :sleeping: Anyways, I tested it multiple times while cooking, it works just fine. :)
{*******************************************************************************
function LevelUpEx : Boolean;
By: Flight
Description: Clicks Continue if you've leveled up, also clicks the given stat
*******************************************************************************}
function LevelUpEx : Boolean;
var
a, X, Y: Integer;
Skills: TStringArray;
begin
if (FindNPCChatText('gratu', Nothing) Or FindBlackChatMessage('just adva')) then
Result:= True;
if Result then
begin
ClickContinue(True, True);
Wait(RandomRange(50,110));
Skills := ['Attack', 'Defence', 'Strength', 'Constitution', 'Mining', 'Smithing',
'Woodcutting', 'Firemaking', 'Magic', 'Fletching', 'Hunting', 'Summoning',
'Fishing', 'Construction', 'Herblore', 'Agility', 'Thieving', 'Crafting',
'Ranged', 'Slayer', 'Farming', 'Prayer', 'Runecrafting', 'Cooking'];
for a:= 0 to High(Skills) do
if IsChatBoxTextBetween(Skills[a], clMessage, 1, 8) then
if IsChatBoxTextBetween('Constitution', clMessage, 1, 8) then
HoverSkill('HitPoints', True)
else
HoverSkill(Skills[a], True);
MMouse(450,50,10,10);
Wait(RandomRange(50,110));
if IsUpText('Close') then
begin
GetMousePos(X,Y);
Mouse(X,Y,0,0,True);
end;
WriteLn(Players[CurrentPlayer].Name + ' leveled up!');
end;
end;
Just call "LevelUpEx" in your main loop (or wherever appropriate) so it's always being checked.
This will check if you've lleveled up recently through both the 'Level-up chat display' and the chat messages. It'll click continue if the display is present and then move to your Stats tab, click the skill that leveled up, and close out of that window.
If you're doing a repetitive task (Woodcuting, fishing, cooking, ect…) you'll continue to do that task after this has closed out the level up window. It is, however, a bit slow while on the level up window because it uses 'HoverSkill', which has a 5-14 second wait. :sleeping: Anyways, I tested it multiple times while cooking, it works just fine. :)