Gala
2012-02-23 10:22:46
How Long have You Played Runescape?
4 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
PHP, JavaScript, a dialect of JavaScript for Unity3D
Are you a member of any other communities?
No
Tell us about yourself…
Please show us one (or multiple) of your scripts.
Edit: Here is the link to the thread: YewSmasher 0.3
4 Year(s)
Are you affilated in anyway with Jagex LTD?
No
Were you Referred to SRL?
What is your general programming knowledge?
PHP, JavaScript, a dialect of JavaScript for Unity3D
Are you a member of any other communities?
No
Tell us about yourself…
From: Gala
I played RuneScape for years and then I joined in 2007 srl-forums.com. However, I am not interested in playing RuneScape at all, because I haven't played for 2 or 3 years now and it isn't interesting anymore. Recently I read about the bot-nuke day and suddenly thought: 'Omg wow. I wonder if this affected the srl-forums? So I visited to the community a month ago and started to script again. (I already made a simple ChickenKiller 4 years ago).
I study GameDesign in Switzerland and have to script a lot.
My script for the application is my YewSmasher. It has around 800 lines of code and works well.
Script information:
Probably you guys think I should improve my standards, but I do it always like this. :)
I didn't use any Bitmaps, because I didn't need any.
I think I understood a lot of the tutorials in the tutorial island section, except some multi-dimensional TPAs.
However I am still learning and I would be glad if I had access to some member tutorials :)
Thanks, Gala
Please show us one (or multiple) of your scripts.
program YewSmasher; // by Gala
{$DEFINE SMART}
{$i SRL/SRL/misc/smart.simba}
{$i SRL/SRL.simba}
{$i SRL/SRL/skill/woodcutting.simba}
{$i SRL/SRL/misc/debug.simba}
{$i SRL/SRL/misc/online.simba}
{$i sps/sps.simba}
var
LagWait, PlayerBreakTime, BreakTime, YewColor1, RedColor, WalkColorOld, YewTolerance1, YewPrice, YewTotal, LogCycles, NewWCXP, YewDetectionFail, YewChoose, CTS, x, y, i, WCXP: Integer;
ControlYewDTM, BankPath1, BankPath2, BankLocation, YewLocation, YewTreeNLocation, YewTreeSLocation, YewMiddleLocation, YewPath1, YewPath2, YewPath3: Integer;
hue1, sat1, Angle, NewCompassDegree, CurrentCompassDegree: Extended;
NeutralFind: Boolean;
const
ScriptVersion = 0.3;
//-----------------------------------------------------------------------//
//-------------------- FILL IN THE INFORMATIONS -------------------------//
//-----------------------------------------------------------------------//
SRLStats_User = ''; // Your SRL Stats ID (If you dont have one then just leave it as it is)
SRLStats_Password = ''; // Your SRL stats password (If you dont have one then just leave it as it is)
procedure DeclarePlayers;
begin
HowManyPlayers := 1; // Number of players
NumberOfPlayers(HowManyPlayers); // Don't touch!
CurrentPlayer := 0; // This is the player to start with; the first player will always be 0 (you'll find out when you learn all about arrays)
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
PlayerBreakTime := 0; // Set time until break in minutes (+/- 5 min) (set 0 for no breaks) (it will break for 12-25 min)
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
end;
//-----------------------------------------------------------------------//
//-------------------- FILL IN THE INFORMATIONS -------------------------//
//-----------------------------------------------------------------------//
procedure SetBreakTimer;
begin
BreakTime := GetSystemTime + PlayerBreakTime*60000 - 5*60000 + Random(5*60000);
if (BreakTime < 0) then
begin
BreakTime := 5*60000;
end;
end;
procedure TakeBreak;
var
H, M, S, T, BreakFor: Integer;
begin
if (GetSystemTime >= BreakTime) and not (PlayerBreakTime = 0) then
begin
Logout;
BreakFor := RandomRange(12 * 60000, 25 * 60000);
ConvertTime(BreakFor, H, M, S);
Writeln('Break for: ' + IntToStr(M)+ 'm:' + IntToStr(S)+ 's');
MarkTime(T);
Repeat
Wait(1000);
until (BreakFor < TimeFromMark(T))
LoginPlayer;
SetBreakTimer;
Wait(1000);
end;
end;
procedure AntiBanOwn;
begin
if not LoggedIn then Exit;
case Random(260) Of
1: HoverSkill('woodcutting', False);
2: HoverSkill('random', False);
3: Boredhuman;
4: Wait(3200 + random(4500));
6: PickUpMouse;
7: RandomMovement;
8: RandomRClick;
9:
begin
CurrentCompassDegree := rs_GetCompassAngleDegrees;
SetScreenMouse(Random(360), '');
Wait(400+Random(500));
SetScreenMouse(CurrentCompassDegree, '');
end;
end;
end;
procedure NaturalBreaker; // thanks to Solidone40 for this procedure
begin
if not LoggedIn then Exit;
case Random (40) Of
1: Wait(10000 + random(6000));
2: Wait(5000 + random(2500));
3: Wait(1000 + random(1500));
4: Wait(1000 + random(250));
end;
end;
procedure CheckSRLStats;
begin
if ((SRLStats_User= '') and (SRLStats_Password = '')) then
begin
case MessageBox('No Stats account entered, would you like to register?','SRL Stats',mbYesNoCancel) of
mrYes:
begin
OpenWebPage('http://stats.villavu.com/register');
TerminateScript;
end;
mrNo:
begin
SetupSRLStats(787, 'Anonymous', 'anon1337');
Exit;
end;
mrCancel: TerminateScript;
end;
end else
SetupSRLStats(787, SRLStats_User, SRLStats_Password);
end;
procedure SRLCommit;
begin
stats_IncVariable('Yew Logs Chopped', 27);
stats_IncVariable('Woodcutting EXP (Gained)', 4725);
stats_IncVariable('Profit Made', 27*YewPrice);
SRLRandomsReport;
Stats_Commit;
Writeln('-----------------')
Writeln('Updated SRL Stats')
Writeln('-----------------')
end;
procedure SetAllVars;
begin
YewTotal := 0;
if (GetGEPrice(1515) = -1) then
begin
YewPrice := 550;
end else
begin
YewPrice := GetGEPrice(1515);
end;
LogCycles := 0;
WCXP := GetXP(Skill_WoodCutting);
NewWCXP := WCXP;
YewDetectionFail := 0;
NeutralFind := False;
WalkColorOld := 3756376;
RedColor := 266606;
YewColor1 := 4279124;
YewTolerance1 := 7;
hue1 := 0.07;
sat1 := 0.10;
LagWait := 40;
end;
procedure SetupImp;
begin
Smart_Server := 134;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
ClearDebug;
CheckSRLStats;
SetBreakTimer;
end;
procedure SetupLogin;
begin
MouseSpeed := 16+random(4);
if (Players[0].Name = '') then
begin
WriteLn('Please fill in the player informations!');
TerminateScript;
end;
if not LoggedIn then
begin
LoginPlayer;
end;
SRLCommit;
GameTab(tab_Inv);
SetAngle(SRL_ANGLE_HIGH);
MakeCompass(5-Random(10));
SetAngle(SRL_ANGLE_HIGH);
SetAllVars;
ToggleXPBar(False);
Wait(Random(60));
Writeln('');
Writeln('----------------------');
Writeln('YewSmasher ' + ToStr(ScriptVersion) + ' by Gala');
Writeln('----------------------');
Writeln('Will break in ' + IntToStr(PlayerBreakTime) + ' minutes for a about 20 minutes.');
FindNormalRandoms;
end;
function GetTotalPlayers: Integer;
var
PlayersTPA: TPointArray;
begin
if not LoggedIn then Exit;
YewMiddleLocation := DTMFromString('mrAAAAHic42BgYPjBzMBwAohFWBgYBIBYjAXCZwfSZ4C0NiMDgwwQ8wCxAhAbArE5ENsCsR4QB/nZMDjoiYNpGE53EAbTjd68DP+BdvDjwYwEMAwAAHgeDNw=');
if not FindDTMRotated(YewMiddleLocation, x, y, MMX1, MMY1, MMX2, MMY2, 0, 2*Pi, Pi/60, angle) then
begin
Result := -1;
end else
begin
PlayersTPA := GetMiniMapDots('player');
PlayersTPA := RemoveDistTPointArray(x, y, 35, PlayersTPA, True);
Result := Length(PlayersTPA);
end;
FreeDTM(YewMiddleLocation);
end;
procedure PaintOnSmart(TP: TStringArray; Placement: TPoint; Colour: integer);
var
mx, my, Pic, I, B, H, TPH, Numb: Integer;
TTP: TPointArray;
CanvasNew: TCanvas;
begin
SmartSetDebug(True);
GetClientDimensions(mx, my);
Pic := BitmapFromString(mx, my, '');
TPH := High(TP);
for I := 0 to TPH do
begin
TTP := LoadTextTPA(TP[i], SmallChars, H);
for B := 0 to High(TTP) do
begin
Numb := ((I + 1) * 13);
FastSetPixel(Pic, TTP[b].x + 1, TTP[b].y + Numb + 1,8388736);
FastSetPixel(Pic, TTP[b].x, TTP[b].y + Numb, Colour);
end;
end;
CanvasNew := TCANVAS.Create;
CanvasNew.Handle := SmartGetDebugDC;
DrawBitmap(Pic, CanvasNew, Placement.x, Placement.y);
FreeBitmap(Pic);
end;
procedure PaintReport;
var
UntilBreak, ProfitPerHour, XPGained, AmountOfPlayers: Integer;
begin
if ((GetTimeRunning/60000) > 0) then
ProfitPerHour := Round((YewTotal*YewPrice*60)/(GetTimeRunning/60000)/1000)
else
ProfitPerHour := -1;
XPGained := YewTotal*175;
AmountOfPlayers := GetTotalPlayers;
PaintOnSmart(['XP Gained: ' + IntToStr(XPGained/1000) + ' K' ,'Yew logs chopped: ' + IntToStr(YewTotal),
'Profit total: ' + IntToStr(Round((YewTotal*YewPrice)/1000)) + ' K', 'Profit per hour: ' + IntToStr(ProfitPerHour) + ' K'], Point(14, 267), 16777215);
PaintOnSmart(['Current yew log price: ' + IntToStr(YewPrice), 'Number of players at yews: ' + IntToStr(AmountOfPlayers)], Point(340, 6), 101617);
PaintOnSmart([MsToTime(GetTimeRunning, Time_Abbrev), 'YewSmasher 0.3 by Gala'], Point(360, 291), 16777215);
end;
procedure RandomYew;
begin
if not LoggedIn then Exit;
YewTreeNLocation := DTMFromString('mggAAAHicY2NgYJjCxMCwEYjXAPE1IJ4BxJlAnAqUiwbiLCDOBuLZQJwCxMHeNnDc2juPwdpUh0ExVJSBHyiHDTPiwBAAACn6DDQ=');
YewTreeSLocation := DTMFromString('mggAAAHicY2NgYJjOxMCQAcSbgXg3EOcD8Qog7gPKNQJxAxCXAXE6EHsAsZenKkOGnTBDsLcNGDvqiDMEBgYy8APlsGFGHBgCAOCtC0c=');
if not LoggedIn then Exit;
if (Random(10) <= 5) then
begin
if FindDTMRotated(YewTreeNLocation, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, angle) then
begin
Mouse(x, y, 0, 0, True);
FFlag(6);
MakeCompass(5-Random(10));
SetAngle(SRL_ANGLE_HIGH);
Wait(30);
YewChoose := 1;
end;
end else
begin
if FindDTMRotated(YewTreeSLocation, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, angle) then
begin
Mouse(x, y, 0, 0, True);
FFlag(6);
MakeCompass(175+Random(10));
SetAngle(SRL_ANGLE_HIGH);
Wait(20);
YewChoose := 2;
end;
end;
FreeDTM(YewTreeNLocation);
FreeDTM(YewTreeSLocation);
end;
function GetSoulPoint(var SoulPoint: TPoint): Boolean;
var
SoulTPA: TPointArray;
FoundSoul: Boolean;
begin
if not LoggedIn then Exit;
CTS := GetColorToleranceSpeed;
if not CTS = 2 then ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 1.45);
if FindColorsSpiralTolerance(MSCX, MSCY, SoulTPA, 2273469, MSX1, MSY1, MSX2, MSY2, 20) then
begin
SoulPoint := MiddleTPA(SoulTPA);
Result := True;
end;
ColorToleranceSpeed(CTS);
end;
function RecognizeYew(var x, y: Integer): Boolean; // YewColorRecognizer
var
UseMax, x1, y1, x2, y2: Integer;
SoulPoint, RedPoint: TPoint;
ATPA: Array of TPointArray;
YewTPA: TPointArray;
begin
if not LoggedIn then Exit;
CTS := GetColorToleranceSpeed;
if not CTS = 2 then ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(hue1, sat1);
FindColorsSpiralTolerance(MSCX, MSCY, YewTPA, YewColor1, MSX1, MSY1, MSX2, MSY2, YewTolerance1);
ColorToleranceSpeed(CTS);
if FindColorSpiralTolerance(x1, y1, RedColor, MSX1, MSY1, MSX2, MSY2, 18) then
begin
RedPoint := Point(x1, y1);
SortTPAFrom(YewTPA, RedPoint);
end;
if GetSoulPoint(SoulPoint) then
begin
YewTPA := RemoveDistTPointArray(SoulPoint.x, SoulPoint.y, 80, YewTPA, false);
//SortTPAFrom(YewTPA, SoulPoint); (in test phase)
//InvertTPA(YewTPA);
end;
ATPA := TPAToATPAEx(YewTPA, 15, 15);
//DebugATPABounds(ATPA);
if Length(ATPA) > 0 then
begin
if Length(ATPA) <= 4 then
begin
UseMax := High(ATPA);
end else
begin
UseMax := 3;
end;
for I := 0 to UseMax do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 1, 1);
Wait(110);
if (IsUpTextMultiCustom(['ew', 'own Yew'])) then
begin
Result := True;
GetMousePos(x, y);
Break;
end else
begin
Result := False;
end;
end;
end else
begin
Result := False;
end;
end;
function WalkToYew: Boolean;
var myPath: TPointArray;
begin
if not LoggedIn then Exit;
SetScreenMouse(0, '');
SetRun(True);
SPS_Setup(RUNESCAPE_SURFACE,['10_6','10_7','11_7','11_6','9_6']);
myPath := [Point(4212, 2661), Point(4211, 2668), Point(4211, 2674), Point(4211, 2678), Point(4209, 2681), Point(4205, 2683), Point(4199, 2683), Point(4193, 2684), Point(4191, 2690), Point(4191, 2694), Point(4195, 2702), Point(4198, 2705), Point(4200, 2709), Point(4204, 2712), Point(4208, 2714), Point(4208, 2719), Point(4210, 2724), Point(4210, 2728), Point(4209, 2732), Point(4208, 2739), Point(4209, 2744), Point(4210, 2746), Point(4211, 2749), Point(4212, 2752), Point(4213, 2755), Point(4210, 2758), Point(4207, 2761), Point(4206, 2766), Point(4202, 2769), Point(4194, 2769), Point(4191, 2767), Point(4188, 2764), Point(4184, 2760), Point(4183, 2756), Point(4183, 2751), Point(4183, 2748), Point(4097, 2919), Point(4427, 2904), Point(4418, 2576), Point(4099, 2494), Point(3926, 2783), Point(4070, 2783)];
SPS_WalkPath(myPath);
Result := True;
end;
procedure BankYews;
var
MarkedTime: Integer;
begin
if not LoggedIn then Exit;
SRLCommit;
if not GetGEPrice(1515) = -1 then
begin
YewPrice := GetGEPrice(1515);
end;
MarkTime(MarkedTime);
repeat
OpenBankNPC;
Wait(100+Random(500));
if PinScreen then
begin
InPin(Players[0].Pin)
end;
Deposit(2, 28, True);
until (BankScreen or not (TimeFromMark(MarkedTime) > 120000+Random(10000)));
if (TimeFromMark(MarkedTime) > 120000+Random(10000)) then
begin
Exit;
end;
CloseBank;
wait(Random(100));
if not invFull then
begin
AntiBanOwn;
LogCycles := LogCycles + 1;
PaintReport;
TakeBreak;
WalkToYew;
end else
begin
BankYews;
end;
end;
function WalkToBank: Boolean;
var myPath: TPointArray;
begin
if not LoggedIn then Exit;
SetScreenMouse(0, '');
SetRun(True);
SPS_Setup(RUNESCAPE_SURFACE,['10_6','10_7','11_6','9_6']);
myPath := [Point(4182, 2733), Point(4182, 2739), Point(4180, 2745), Point(4180, 2751), Point(4183, 2756), Point(4184, 2761), Point(4189, 2766), Point(4193, 2768), Point(4198, 2768), Point(4202, 2768), Point(4206, 2766), Point(4209, 2764), Point(4210, 2760), Point(4212, 2758), Point(4213, 2752), Point(4212, 2741), Point(4213, 2736), Point(4211, 2731), Point(4209, 2726), Point(4208, 2722), Point(4207, 2717), Point(4206, 2711), Point(4201, 2710), Point(4196, 2706), Point(4194, 2703), Point(4189, 2701), Point(4189, 2696), Point(4189, 2690), Point(4190, 2686), Point(4194, 2684), Point(4199, 2684), Point(4205, 2684), Point(4213, 2680), Point(4211, 2674), Point(4039, 2916), Point(4383, 2942), Point(4444, 2616), Point(4174, 2480), Point(3952, 2750), Point(4022, 2777), Point(4040, 2788)];
SPS_WalkPath(myPath);
Result := True;
wait(Random(200));
BankYews;
end;
procedure WalkToNorthYew;
begin
if not LoggedIn then Exit;
YewTreeNLocation := DTMFromString('mggAAAHicY2NgYJjHxMCQDcQFQLwQiB8A8Q4gbgDKZQHxDCBeCMT5QBwJxP///2ew1xMGY0tzDYbmCbMYAv0sGP4D5fixYEYcGAIA7EAPGQ==');
if FindDTMRotated(YewTreeNLocation, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, angle) then
begin
Mouse(x, y, 0, 0, True);
FFlag(6);
MakeCompass(5-Random(10));
YewChoose := 1;
end;
FreeDTM(YewTreeNLocation);
end;
procedure WalkToSouthYew;
begin
if not LoggedIn then Exit;
YewTreeSLocation := DTMFromString('mggAAAHicY2NgYJjOxMCQAcSbgXg3EOcD8Qog7gPKNQJxAxCXAXE6EHsAsZenKkOGnTBDsLcNGDvqiDMEBgYy8APlsGFGHBgCAOCtC0c=');
if FindDTMRotated(YewTreeSLocation, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, angle) then
begin
Mouse(x, y, 0, 0, True);
FFlag(6);
MakeCompass(175+Random(10));
YewChoose := 2;
end;
FreeDTM(YewTreeSLocation);
end;
procedure GetColorOfYew; // AutoColorFunction (later)
begin
end;
function IsChopping: boolean;
begin
if not LoggedIn then Exit;
if IsXPBarOpen then
begin
Result := True;
end else
begin
if (IsUpTextMultiCustom(['ew', 'own Yew'])) then
begin
Result := True;
end else
begin
if (RecognizeYew(x, y)) then
begin
Result := True;
end else
begin
Wait(200+Random(300));
CurrentCompassDegree := rs_GetCompassAngleDegrees;
MakeCompass(CurrentCompassDegree-15+Random(30));
if (RecognizeYew(x, y)) then
begin
Result := True;
end else
begin
Wait(200+Random(300));
CurrentCompassDegree := rs_GetCompassAngleDegrees;
MakeCompass(CurrentCompassDegree-15+Random(30));
if (RecognizeYew(x, y)) then
begin
Wait(200+Random(300));
CurrentCompassDegree := rs_GetCompassAngleDegrees;
MakeCompass(CurrentCompassDegree-15+Random(30));
if (RecognizeYew(x, y)) then
begin
Result := True;
end else
begin
Result := False;
end;
end;
end;
end;
end;
end;
end;
function LookForYew(var internYew: Integer): Boolean;
begin
if not LoggedIn then Exit;
SetRun(True);
if InvFull then
begin
WalkToBank;
end;
if (YewDetectionFail >= 2) then
YewChoose := 3;
case internYew of
1:
begin
WalkToSouthYew;
end;
2:
begin
WalkToNorthYew;
end;
3:
begin
NeutralFind := True;
end;
end;
end;
procedure ChopYew;
var
YewChange, MarkedTime, iter: Integer;
begin
if not LoggedIn then Exit;
ToggleXPBar(False);
ToggleMoneyPouch(False);
CurrentCompassDegree := rs_GetCompassAngleDegrees;
iter := 0;
repeat
iter := iter + 1;
NewCompassDegree := rs_GetCompassAngleDegrees;
MakeCompass(CurrentCompassDegree-20+Random(40));
wait(Random(60));
until (RecognizeYew(x , y)) or (iter > 1);
if (RecognizeYew(x, y)) then
begin
YewDetectionFail := 0;
Mouse(x, y, 0, 0, false);
ChooseOption('hop');
if not DidRedClick then
begin
wait(40);
Mouse(x, y, 0, 0, true);
end;
MarkTime(MarkedTime);
YewChange := InvCount - 1;
repeat
wait(500+Random(600));
FindNormalRandoms;
AntiBanOwn;
NaturalBreaker;
YewTotal := YewTotal + (InvCount - 1 - YewChange);
YewChange := InvCount - 1;
PaintReport;
until not isChopping or InvFull or (TimeFromMark(MarkedTime) > (480000+Random(10000)));
LookForYew(YewChoose); //Looking for yew
if InvFull then
begin
WalkToBank;
end;
end else
begin
YewDetectionFail := YewDetectionFail + 1;
LookForYew(YewChoose);
end;
end;
procedure FindYew;
var
MarkedTime, iter: Integer;
colorEnergy: String;
begin
if not LoggedIn then Exit;
YewMiddleLocation := DTMFromString('mrAAAAHic42BgYPjBzMBwAohFWBgYBIBYjAXCZwfSZ4C0NiMDgwwQ8wCxAhAbArE5ENsCsR4QB/nZMDjoiYNpGE53EAbTjd68DP+BdvDjwYwEMAwAAHgeDNw=');
if FindDTMRotated(YewMiddleLocation, x, y, MMX1, MMY1, MMX2, MMY2, 0, 360, Pi/60, angle) then
begin
Mouse(x, y, 0, 0, True);
FFlag(6);
end;
SetScreenMouse('', 2);
if (Random(10) <= 5) then
begin
YewChoose := 1;
end else
begin
YewChoose := 2;
end;
MarkTime(MarkedTime);
repeat
FindNormalRandoms;
if (YewChoose = 1) then
begin
iter := 0;
repeat
iter := iter + 1;
SetScreenMouse(25-Random(50), Random(2));
Wait(300+Random(200));
if RecognizeYew(x, y) then
begin
ChopYew;
Break;
end;
until (RecognizeYew(x , y)) or (iter > Random(2));
YewChoose := 2;
NeutralFind := False;
end else
begin
iter := 0;
repeat
iter := iter + 1;
SetScreenMouse(145+Random(35), Random(2));
Wait(300+Random(200));
if RecognizeYew(x, y) then
begin
ChopYew;
Break;
end;
until (RecognizeYew(x , y)) or (iter > Random(2));
YewChoose := 1;
NeutralFind := False;
end;
if (GetMMLevels('energy', colorEnergy) <= 90) then
begin
if (Random(500) < 400) then
begin
SetRest;
end;
end;
PaintReport;
Wait(600+Random(400));
NaturalBreaker;
FindNormalRandoms;
if Random(200) < 70 then
begin
YewMiddleLocation := DTMFromString('mrAAAAHic42BgYPjBzMBwAohFWBgYBIBYjAXCZwfSZ4C0NiMDgwwQ8wCxAhAbArE5ENsCsR4QB/nZMDjoiYNpGE53EAbTjd68DP+BdvDjwYwEMAwAAHgeDNw=');
if FindDTMRotated(YewMiddleLocation, x, y, MMX1, MMY1, MMX2, MMY2, 0, 360, Pi/60, angle) then
begin
Mouse(x, y, 0, 0, True);
FFlag(6);
end;
end;
until (TimeFromMark(MarkedTime) > 15*60000);
if (TimeFromMark(MarkedTime) > 15*60000) then
begin
Exit;
end;
if (YewMiddleLocation = DTMFromString('mrAAAAHic42BgYPjBzMBwAohFWBgYBIBYjAXCZwfSZ4C0NiMDgwwQ8wCxAhAbArE5ENsCsR4QB/nZMDjoiYNpGE53EAbTjd68DP+BdvDjwYwEMAwAAHgeDNw=')) then
begin
FreeDTM(YewMiddleLocation);
end;
end;
procedure AtYews;
begin
if not LoggedIn then Exit;
repeat
SetAngle(SRL_ANGLE_HIGH);
ChopYew;
if NeutralFind then
begin
FindYew;
end;
until InvFull;
if InvFull then
begin
SetScreenMouse(3-Random(6), 10);
WalkToBank;
end;
end;
procedure PrintReport;
var
ProfitPerHour, XPGained: Integer;
begin
if ((GetTimeRunning/60000) > 0) then
ProfitPerHour := Round((YewTotal*YewPrice*60)/(GetTimeRunning/60000)/1000)
else
ProfitPerHour := -1;
XPGained := YewTotal*175;
Writeln('------------------------------------------------');
Writeln('Ran for: ' + MsToTime(GetTimeRunning, Time_Abbrev));
Writeln('Woodcutting XP Gained: ' + IntToStr(XPGained/1000) + ' K');
Writeln('Yew logs chopped: ' + IntToStr(YewTotal));
Writeln('Profit total: ' + IntToStr(Round((YewTotal*YewPrice)/1000)) + ' K');
Writeln('Profit per hour: ' + IntToStr(ProfitPerHour) + ' K');
Writeln('------------------------------------------------');
Writeln('Thanks for using Gala´s YewSmasher!');
end;
procedure ScriptTerminate;
begin
PrintReport;
end;
procedure MainLoop;
begin
WalkToYew;
RandomYew;
AtYews;
end;
begin
AddOnTerminate('ScriptTerminate');
SetupImp;
SetupLogin;
PaintReport;
MainLoop;
end.Edit: Here is the link to the thread: YewSmasher 0.3