TravisV10
2008-09-13 21:08:11
Position your player near the WCing Instructor and Run. It chops trees and sells them.
Updates:
-First Release: Worked.
-V0.1: Added DDTM for walk back to trees
Updates:
-First Release: Worked.
-V0.1: Added DDTM for walk back to trees
{******************************************************************************
LumbyNewbie V0.1
What does it do?
It chops trees near the Lumby WCing Guide and sells them.
Updates
-First Release: Worked.
-V0.1: Added DDTM for walk back to trees
*******************************************************************************}
program LumbyNewbie;
{.Include SRL\SRL\Misc\Smart.Scar}
{.Include SRL\SRL.Scar}
var
x, y, LogDTM, CloseDTM: integer;
levelsgained, loadsdone: integer;
var DTMSubPoints: array[0..3] of TDTMPointDef;
var CGMainPoint: TDTMPointDef;
var GrassTDTM: TDTM;
var GrassDTM: Integer;
const Tolerance = 5;
const AreaSize = 5;
const AreaShape = 1;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active := True;
end;
procedure LoadDTMs;
begin
LogDTM := DTMFromString('78DA63B4666260B8C380061819B8C02403C37' +
'F2060B405AAF988A9064102E940A09AE704D4B801D5BCC3AF0600' +
'501208CC');
CloseDTM := DTMFromString('78DA637CC6C8C0A0C58002B45464C1342394C' +
'FF808C8524355232A2C88AAE625116A40E6E8A2AA31D4524255F3' +
'820835F7802C25026ADE0259CAA86AB8B8B850D5DC07B20C09A87' +
'943580D0097AA0C52');
end;
procedure AntiBan;
begin
case random(20) of
0: RandomRClick;
1: PickUpMouse;
2: HoverSkill('woodcutting', false);
3: BoredHuman;
4: RandomMovement;
5: SetRun(True);
6: SetRun(False);
7: HoverSkill('attack', false);
8: HoverSkill('mining', false);
9: GameTab(2+random(5));
end;
end;
procedure SetGrassDTM;
begin
CGMainPoint.x:=415;
CGMainPoint.y:=209;
CGMainPoint.areasize:=AreaSize;
CGMainPoint.areashape:=AreaShape;
CGMainPoint.color:=FindLumbyRoadColor;
CGMainPoint.tolerance:=Tolerance;
DTMSubPoints[0].x:=392;
DTMSubPoints[0].y:=186;
DTMSubPoints[0].areasize:=AreaSize;
DTMSubPoints[0].areashape:=AreaShape;
DTMSubPoints[0].color:=FindLumbyRoadColor;
DTMSubPoints[0].tolerance:=Tolerance;
DTMSubPoints[1].x:=436;
DTMSubPoints[1].y:=181;
DTMSubPoints[1].areasize:=AreaSize;
DTMSubPoints[1].areashape:=AreaShape;
DTMSubPoints[1].color:=FindLumbyRoadColor;
DTMSubPoints[1].tolerance:=Tolerance;
DTMSubPoints[2].x:=414;
DTMSubPoints[2].y:=181;
DTMSubPoints[2].areasize:=AreaSize;
DTMSubPoints[2].areashape:=AreaShape;
DTMSubPoints[2].color:=FindLumbyRoadColor;
DTMSubPoints[2].tolerance:=Tolerance;
DTMSubPoints[3].x:=424;
DTMSubPoints[3].y:=235;
DTMSubPoints[3].areasize:=AreaSize;
DTMSubPoints[3].areashape:=AreaShape;
DTMSubPoints[3].color:=FindLumbyRoadColor;
DTMSubPoints[3].tolerance:=Tolerance;
GrassTDTM.MainPoint := CGMainPoint;
GrassTDTM.SubPoints := DTMSubPoints;
GrassDTM := AddDTM(GrassTDTM);
end;
procedure WalkToTrees;
var
DontGoTooLong: integer;
FoundIt: integer;
begin
SetGrassDTM;
MarkTime(DontGoTooLong);
FoundIt := 0;
repeat
Wait(1000);
if (DTMRotated(GrassDTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
begin
Mouse(x + 50, y, 2, 2, true);
Wait(250 + random(50));
Flag;
FoundIt := 1;
end;
until (FoundIt = 1) or
(TimeFromMark(DontGoTooLong) >= 15000 + random(5550));
FreeDTM(GrassDTM);
FoundIt := 0;
end;
procedure LevelUp;
begin
if (FindNPCChatText('ongratulations', nothing)) then
begin
FindNPCChatText('lick here', ClickLeft);
levelsgained := levelsgained + 1;
end;
end;
procedure Chop;
var
Tries: integer;
begin
if (FindObjTPA(x, y, 1060136, 4, -1, 5, 5, 6, ['ree'])) then
begin
Mouse(x, y, 2, 2, true);
Flag;
Wait(4500 + random(1550));
FindNormalRandoms;
AntiBan;
LevelUp;
end else
begin
Wait(3000 + random(1550));
FindNormalRandoms;
AntiBan;
LevelUp;
Tries := Tries + 1;
if (Tries >= 2) then
begin
WalkToTrees;
Tries := 0;
end;
end;
end;
procedure WalkToStore;
var
Tries: integer;
begin
if (not(FindSymbol(x, y, 'store'))) then
begin
Tries := 0;
repeat
Wait(500 + random(500));
if (Tries = 30) then
begin
WriteLn('Could not find store!');
end;
Tries := Tries + 1;
until (FindSymbol(x, y, 'store'));
end;
Mouse(x, y, 2, 2, True);
Flag;
Wait(550 + random(250));
FindNormalRandoms;
end;
procedure FindShopTrader;
begin
repeat
if (FindObjTPA(x, y, 3750974, 4, -1, 5, 5, 6, ['hop'])) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('rade');
Flag;
Wait(1550 + random(550));
end;
until (FindDTM(CloseDTM, x, y, MSX1, MSY1, MSX2, MSY2));
end;
procedure Sell;
begin
repeat
if (FindDTM(LogDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Mouse(x, y, 2, 2, false);
Wait(200 + random(95));
case random(3) of
0: ChooseOption('Sell 10');
1: ChooseOption('Sell 5');
2: ChooseOption('Sell 1');
end;
Wait(800 + random(550));
end;
until (not(FindDTM(LogDTM, x, y, MIX1, MIY1, MIX2, MIY2)));
repeat
if (FindDTM(CloseDTM, x, y, MSX1, MSY1, MSX2, MSY2)) then
begin
Mouse(x, y, 1, 1, True);
end;
until (not(FindDTM(CloseDTM, x, y, MSX1, MSY1, MSX2, MSY2)));
loadsdone := loadsdone + 1;
end;
procedure Proggy;
begin
ClearDebug;
WriteLn('Loads done: ' + IntToStr(loadsdone));
WriteLn('Levels gained: ' + IntToStr(levelsgained));
end;
begin
SetupSRL;
SmartSetup('world14', False, True, False);
Wait(1000);
SetTargetDC(SmartGetDC);
SymbolAccuracy := 0.4;
DeclarePlayers;
LoginPlayer;
LoadDTMs;
repeat
SetAngle(True);
MakeCompass('N');
repeat
Chop;
until (InvFull);
WalkToStore;
FindShopTrader;
Sell;
WalkToTrees;
Proggy;
until (false);
end.