never mind
Printable View
never mind
I've been trying to get this script to work on simba, but every time I run it I get
"Error downloading "http://yagoscripts.netii.net/TCEProg.png".", and then
"Exception: Error while reading stream: File "C:\Users\Gwynn\AppData\Local\Temp\/TCEProg.png" does not exist at line 117
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]"
I really want to be able to use this script. How can I fix this problem?
Now I'm getting that same problem. How do we fix it??
mine does not start it says
Exception in Script: Unable to find file 'ObjectDTM/ObjDTMInclude.simba' used from ''
what does this mean
i got another error message saying this..
0.6
Version Checking Failed. You Might Be Outdated.
Please Check For The Latest Version Online.
Paint File Check.
anyone help?
it also says i dont have the latest update but im using the latest version
Getting the "Invalid number of parameters at line ..." bug when I try to run. Is there a way to fix it, or is the script outdated?
Its outdated, but I may fix it if I have the spare time. There are scripts that fix this script for you though.
Would you care if I posted the altered version that I got to work on here?
Code:Program TheCutingEdge;
{$DEFINE SMART}
{$i SRL/SRL.simba}
{$i ObjectDTM/ObjDTMInclude.simba}
const
{----SMART Setup Constants----}
WORLD = 99; // Choose What Server To Load. Set As 0 For Random Sever.
{-----------------------------}
Stats_UserID = ''; // SRL Stats ID (Leave Blank If None).
Stats_Password = ''; // SRL Stats Password (Leave Blank If None).
Debug_Script = False; // Set To True To Debug The Script.
Auto_Update = True; // Check For And Download The Newest Script Version.
AntiBanAmount = 1; // 0 = 0% Chance. 100 = 100%.
ReportWait = 60; // How Often In Seconds To Print A Text Report
PaintWait = 50; // How Often In Miliseconds To Print On Screen. Set To 0 For No Paint
Type
MyPlayer = Record
Name, Pass, Pin: string;
Member, Active, AxeWielded: Boolean;
Logs, Exp, LogH, ExpH, LampSkill: Integer;
BoxRewards: TStringArray;
End;
MyColor = Record
Color, Tol, CTS, Accuracy: Integer;
Sat, Hue: Extended;
Uptexts: TStringArray;
End;
var MyPlayers: Array of MyPlayer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
CurrentPlayer := 0;
NumberOfPlayers(HowManyPlayers);
setlength(MyPlayers, HowManyPlayers);
With MyPlayers[0] do
begin
Name := ''; //Character Name
Pass := ''; //Character Pass
Pin := ''; //Pin for bank
Member := True; //True = Members Account & False = Non-Members Account.
Active := True; //Use player in script?
AxeWielded := True; //Is You Axe Wielded? Yes = True and No = False. If No then place axe in first slot.
BoxRewards := ['XP','Lamp'];
LampSkill := SKILL_WOODCUTTING;
end;
end;
{Do Not Touch Below Unless Instructed To!!!}
const
//Version And Paths
Version = '0.6'; //Script Version;
ThePath = ScriptPath + '/TCEProg.png'; // Image Path;
//Script-Function Wait Times
MaxWait = 100000; //How much time to wait for a tree after checking the previous tree.
MaxWaits = 10; //How many times to go from tree to tree without success before logging out.
MaxWalks = 4; //Maximum Attempts To Repeat Walking If Failed
MaxIdle = 60000; //Failsafe Time To Idle While Chopping
MaxRetry = 4; //Max Number of times to retry chopping script while idle
//Color-Related Constants
DHue = 0.2;
DSat = 0.2; //Default Hue And Sat
//Axe Constants
Dragon_Axe = 0;
Rune_Axe = 1;
Addy_Axe = 2;
Mith_Axe = 3;
Steel_Axe = 4;
Black_Axe = 5;
Iron_Axe = 6;
Bronze_Axe = 7;
//Other
YewLogExp = 175;
TLoggedIn = 4000;
//Object Constats
OBJ_Banker = 0;
OBJ_TreeTrunk = 1;
OBJ_TreeLeaves = 2;
//OBJDTM Points
ObjDTM_Bank = '81:80:7:1:7:121:67:1:7:92:32:10:7:91:66:10:7:87:71:10:7:87:79:10:7:87:88:3:7:127:84';
ObjDTM_Middle = '79:125:7:1:7:121:67:1:7:92:32:10:7:91:66:10:7:87:71:10:7:87:79:10:7:87:88:3:7:127:84';
var
Event: string;
ReportTimer, PaintTimer, Prog: Integer;
PaintArray: TStringArray;
Procedure DebugIt(Text: string);
begin
if Debug_Script then
Writeln(Text);
end;
Procedure Init;
begin
{Paint}
if (PaintWait <> 0) then
begin
Prog := LoadBitmap(ThePath);
SMART_DrawBitmap(True,Prog,Point(MCX1,MCY1));
SetLength(PaintArray,6);
end;
end;
Function LoadObject(Which: Integer): MyColor;
begin
case Which of
OBJ_Banker:
with Result do
begin
Color := 3678760;
Hue := 0.06;
Sat := 0.45;
Tol := 10;
CTS := 2;
Accuracy := 100;
Uptexts := ['Bank B', 'nk B'];
end;
OBJ_TreeTrunk:
with Result do
begin
Color := 1120536;
Tol := 1;
CTS := 1;
Uptexts := ['Chop','down','Yew','hop d','wn Y'];
end;
OBJ_TreeLeaves:
with Result do
begin
Color := 2113332;
Tol := 3;
CTS := 0;
Accuracy := 200;
end;
end;
end;
{*******************************************************************************
function DownloadToFile(const URL, Filename: string): boolean;
By: Dgby714. Editted By Yago.
Description: Downloading file from URL to Filename.
*******************************************************************************}
Function DownloadToFile(const URL, Filename: string): boolean;
var
FileI: LongInt;
FileC, FileH: string;
begin
Writeln('Paint File Check.');
Result := False;
FileI := InitializeHTTPClient(False,False);
try
FileC := GetHTTPPage(FileI, URL);
FileH := GetRawHeaders(FileI);
if ((FileC = '') or (FileH = '')) then
begin
WriteLn('Error downloading "' + URL + '".');
Exit;
end;
FileH := Copy(GetRawHeaders(FileI), 10, Pos(#13, FileH) - 10); //Error Code
if (FileH <> '200 OK') then
begin
WriteLn('Couldn''t download "' + URL + '", Error Code: ' + FileH + '.');
Exit;
end;
finally
FreeHTTPClient(FileI);
end;
try
if not FileExists(Filename) then
FileI := CreateFile(Filename)
else
FileI := OpenFile(Filename, False);
CloseFile(FileI);
FileI := RewriteFile(Filename, False);
Result := WriteFileString(FileI, FileC);
finally
CloseFile(FileI);
end;
end;
{*******************************************************************************
Procedure ScriptUpdate;
Description: Checks For Newer Versions Of The Script And Updates The Script If
The User Sets The Update Constant;
Authors: Harry. Eddited By Me.
*******************************************************************************}
Procedure ScriptUpdate;
var ClientUp, Neifile:integer;
OnlineVersion, NewScript, NeiFeilNennen:string;
begin
if Auto_Update then
begin
Writeln('Checking For An Updated Script Version.');
OnlineVersion := GetPage('http://yagoscripts.netii.net/TCEVersion.html');
Writeln(onlineversion);
Writeln(Version);
if (Length(trim(OnlineVersion)) = 3) and (trim(OnlineVersion) > Version) then
begin
WriteLn('Newer Version Found Online. Will AutoUpdate.');
ClientUp := InitializeHTTPClient(False,False);
SetHTTPUserAgent(ClientUp,'Simba');
NewScript := GetHTTPPage(ClientUp,'http://yagoscripts.netii.net/TCE-Current.simba');
FreeHTTPClient(ClientUp);
NeiFeilNennen := ScriptPath + 'TheCuttingEdge v'+trim(OnlineVersion)+'.simba';
Neifile := Rewritefile(NeiFeilNennen, true);
try
WriteFileString(Neifile, NewScript);
except
begin
WriteLn('Fatal Error Writing To '+NeiFeilNennen+'!');
TerminateScript;
end;
end;
CloseFile(Neifile);
WriteLn('New Script Downloaded And Saved To '+NeiFeilNennen+' !! Please Use This!');
TerminateScript;
end else
begin
if (Length(trim(OnlineVersion)) <> 3) then
begin
WriteLn('Version Checking Failed. You Might Be Outdated.');
Writeln('Please Check For The Latest Version Online.');
end else
WriteLn('You Have The Latest Version Of The Script!');
Exit;
end;
end else
WriteLn('!!!!! Not Checking For The Latest Version Of This Script. You Might Be Outdated!');
end;
Procedure SetPlayers;
var
I: Integer;
begin
for I := 0 to High(MyPlayers) do
begin
Players[i].Name := MyPlayers[i].Name;
Players[i].Pass := MyPlayers[i].Pass;
Players[i].Pin := MyPlayers[i].Pin;
Players[i].Active := MyPlayers[i].Active;
Players[i].Member := MyPlayers[i].Member;
Players[i].WorldInfo := [MyPlayers[i].Member, -1, False];
Players[I].BoxRewards := MyPlayers[i].BoxRewards;
Players[i].LampSkill := MyPlayers[i].LampSkill;
MyPlayers[i].Exp := 0;
MyPlayers[i].Logs := 0;
MyPlayers[i].ExpH := 0;
MyPlayers[i].LogH := 0;
end;
end;
Procedure AntiRandoms;
begin
FindNormalRandoms;
DebugIt('Ran Procedure AntiRandoms.');
end;
function IsLoggedIn: boolean;
var
Timer: Integer;
begin
//Failsafe for the onFocus bug with SMART. The screen goes black for a few ms when focusing on SMART.
AntiRandoms;
Result := (PercentBlackMM <> 100) and LoggedIn;
MarkTime(Timer);
while (not Result) and (TimeFromMark(Timer) <= TLoggedIn) do
begin
AntiRandoms;
Result := (PercentBlackMM <> 100) and LoggedIn;
end;
DebugIt('IsLoggedIn: ' + ToStr(Result));
end;
{*******************************************************************************
procedure SetAngle(Highest : Boolean);
By: Raymond, edit by NaumanAkhlaQ. Editted By me
Description: Sets the mainscreen at highest\lowest angle (Depends on the boolean)
Taken From SRL Include.
*******************************************************************************}
Procedure SetCustomAngle(Highest: Boolean);
begin
if (not IsLoggedIn) then exit;
KeyDown((Integer(not Highest) * 2) + 38);
Sleep(1000 + Random(300));
KeyUp((Integer(not Highest) * 2) + 38);
end;
Procedure Maintenance(Angle: string);
begin
if not (IsLoggedIn) then
Exit;
DebugIt('Running Procedure Maintenance(' + Angle +').');
SetCustomAngle(True);
MakeCompass(Angle);
end;
Procedure AntiBan;
var
I, AB: Integer;
begin
if (AntiBanAmount <> 0) then
begin
if (AntiBanAmount > 100) then
AB := 1000
else
AB := AntiBanAmount * 10;
I := Random(90 * (Ceil(1000/AB))) + 1;
case I of
1: RandomRClick;
2,3:
begin
HoverSkill('woodcutting', False);
SleepAndMoveMouse(100);
end;
4: PickUpMouse;
5: RandomAngle(True);
6: RandomMovement;
7: BoredHuman;
8..10: SleepAndMoveMouse(500);
end;
if (I <= 10) then
begin
DebugIt('Ran AntiBan Procedure.');
Maintenance('W');
end;
end;
end;
Procedure AssignStatus(Assignment: string);
begin
Event := Assignment;
end;
Procedure PrintOnSMART(Force: boolean);//Not Mine, Just Editted
var
Log, Exp, Logsh, Exph, Portion, I: Integer;
ThePoint: TPoint;
V: string;
begin
if (PaintWait = 0) or ((not Force) and (TimeFromMark(PaintTimer) < PaintWait)) then
Exit;
Log := MyPlayers[CurrentPlayer].Logs;
Exp := Round(175 * Log);
LogsH := Ceil((Log * 60.0 * 60.0 * 1000.0) / PlayerWorked(CurrentPlayer));
ExpH := Ceil((Exp * 60.0 * 60.0 * 1000.0) / PlayerWorked(CurrentPlayer));
for I := 0 to 5 do
begin
case I of
0:
begin
V := tostr(Log) + ' Logs';
ThePoint := Point(267,62);
end;
1:
begin
V := tostr(Exp) + ' Exp';
ThePoint := Point(267,79);
end;
2:
begin
V := tostr(ExpH);
ThePoint := Point(267,96);
end;
3:
begin
V := tostr(LogsH) + ' Logs';
ThePoint := Point(267,113);
end;
4:
begin
V := Event;
ThePoint := Point(382,64);
end;
5:
begin
V := MsToTime(GetTimeRunning, Time_Short);
ThePoint := Point(421,94);
end;
end;
if V = PaintArray[I] then
Continue;
Portion := GetMufasaBitmap(Prog).Copy(ThePoint.x, ThePoint.y, ThePoint.x + 76, ThePoint.y + 17).Index;
SMART_DrawBitmap(False,Portion,Point(MCX1 + ThePoint.x, MCY1 + ThePoint.y));
FreeBitmap(Portion);
SMART_DrawTextEx(False,MCX1 + ThePoint.x, MCY1 + ThePoint.y, SmallChars, V, clGreen);
end;
PaintArray := [tostr(Log) + ' Logs',tostr(Exp) + ' Exp',tostr(ExpH),tostr(LogsH) + ' Logs',Event,MsToTime(GetTimeRunning, Time_Short)];
MarkTime(PaintTimer);
end;
Procedure DrawPoint(Clear: Boolean; P: TPoint; S: Integer);
begin
if Clear then
SMART_ClearCanvasArea(IntToBox(MMX1, MMY1, MMX2, MMY2));
SMART_DrawLine(False,Point(P.x-S,P.y-S),Point(P.x+S+1,P.y+S+1),clBlue);
SMART_DrawLine(False,Point(P.x-S,P.y-S-1),Point(P.x+S,P.y+S+1),clBlue);
SMART_DrawLine(False,Point(P.x-S-1,P.y-S),Point(P.x+S+1,P.y+S),clBlue);
SMART_DrawLine(False,Point(P.x-S,P.y+S),Point(P.x+S+1,P.y-S-1),clBlue);
SMART_DrawLine(False,Point(P.x-S-1,P.y+S),Point(P.x+S+1,P.y-S),clBlue);
SMART_DrawLine(False,Point(P.x-S,P.y+S+1),Point(P.x+S,P.y-S-1),clBlue);
end;
Procedure RemoveATPAByAccuracy(var ATPA: T2DPointArray; Accuracy, Color: Integer);
var
I: Integer;
begin
for I := 0 to High(ATPA) do
if (Length(ATPA) = 0) or (High(ATPA) < I) then
else if Length(ATPA[I]) < Accuracy then
begin
DeleteValueInATPA(ATPA, I);
I := I - 1;
end else if (Color <> 0) then
begin
DebugIt(ToStr(Length(ATPA[I])));
SMART_DrawDotsEx(False, ATPA[I], Color + I * 100);
end;
end;
Function LoadAxeDTM(Which: Integer): integer;
begin
DebugIt('LoadAxeDTM: ' + ToStr(Which));
case Which of
Dragon_Axe: Result := DTMFromString('mbQAAAHicY2VgYLjKwsBwAIhvAPEdID4BxF+B4hyMDAz/gPQnIP4GxJ78XECSCQUDlWAARiwYDADXZQh/');
Rune_Axe: Result := DTMFromString('mbQAAAHicY2VgYOACYn4gFgZiFgYIYAJiDiS2JBDbevpDeQgMU48MGLFgMAAAV5oBQQ==');
Addy_Axe: Result := DTMFromString('mbQAAAHicY2VgYOBigAAWIBYGYn4gZgJiSSgNAhxAbO1iDRVBYBYGBGCG0oxYMBgAAFEzASk=');
Mith_Axe: Result := DTMFromString('mbQAAAHicY2VgYOBigAAWIBYGYn4gZgJiSSgNAhxAbGYWABVBYBYGBGCG0oxYMBgAAFGZASs=');
Steel_Axe: Result := DTMFromString('mbQAAAHicY2VgYOBigAAWIBYGYn4gZgJiSSgNAhxAnJuZCRVBYBYGBGCG0oxYMBgAAHJ3Aa4=');
Black_Axe: Result := DTMFromString('mbQAAAHicY2VgYOBigAAWIBYGYn4gZgJiSSgNAhxAzMfLCxVBYBYGBGCG0oxYMBgAACy0AJc=');
Iron_Axe: Result := DTMFromString('mbQAAAHicY2VgYOACYn4gFgZiFgYIYAJiDiS2JBC7ODpCeQjMCFXDzIAAjFgwGAAAU9cBMg==');
Bronze_Axe: Result := DTMFromString('mbQAAAHicY2VgYOBigAAWIBYGYn4gZgJiSSgNAhxAbG8gAxVBYBYGBGCG0oxYMBgAAEWWAPo=');
end;
end;
Function PlayerStartUp: boolean;
var
Level,AxeDTM, x, y, I: integer;
begin
DebugIt('Function PlayerStartUp.');
Result := False;
if not IsLoggedIn then
Exit;
CloseBank;
ClosePinScreen;
SetCustomAngle(True);
Level := GetSkillLevel(Skill_WoodCutting);
DebugIt('WC Level Is ' + ToStr(Level));
case Level of
61..100: I := Dragon_Axe;
41..60: I := Rune_Axe;
31..40: I := Addy_Axe;
21..30: I := Mith_Axe;
6..20: I := Steel_Axe;
else
I := Bronze_Axe;
end;
if MyPlayers[CurrentPlayer].AxeWielded then
Gametab(tab_Equip)
else
GameTab(tab_Inv);
for I := I to Bronze_Axe do
begin
AxeDTM := LoadAxeDTM(I);
Result := FindDTM(AxeDTM, x, y, MIX1, MIY1, MIX2, MIY2);
FreeDTM(AxeDTM);
if Result then
Break;
end;
if Result then
if InvFull then
AssignStatus('Banking')
else
AssignStatus('Trees');
DebugIt('Player['+ ToStr(CurrentPlayer) + '] StartUp: ' + ToStr(Result));
end;
Procedure Report(Final: boolean);
Var
Log, TotalLogs, Exp, TotalExp, I: Integer;
LogsH, ExpH: LongInt;
begin
if (stats_Commit) then
Writeln('Stats Committed.');
if Final or ((TimeFromMark(ReportTimer) >= (ReportWait * 1000)) and IsLoggedIn) then
begin
for I := 0 to (High(Players)) do
begin
IncEx(TotalLogs, MyPlayers[I].Logs);
IncEx(TotalEXP, Round(YewLogExp * MyPlayers[I].Logs));
//IncEx(TotalLevels, Players[I].Integers[9]);
end;
Writeln('');
Progress Report:
');
SRLRandomsReport;
WriteLn('*----------------------------------------------------------------*');
WriteLn('| The Cutting Edge ' + Padr(ToStr(Version), 23) + '|');
WriteLn('| By: Yago |');
WriteLn('|----------------------------------------------------------------|');
WriteLn('| Overall Progress Report |');
WriteLn('| |');
WriteLn('| ' + Padr('Total Players : ' + ToStr(HowManyPlayers), 53) + '|');
WriteLn('| ' + Padr('Total Time Running : ' + MsToTime(GetTimeRunning, Time_Abbrev), 53) + '|');
WriteLn('| ' + Padr('Total Logs Chopped : ' + ToStr(TotalLogs), 53) + '|');
WriteLn('| ' + Padr('Total Experience Gained : ' + ToStr(TotalEXP), 53) + '|');
//WriteLn('| ' + Padr('Total Smithing Levels Gained : ' + ToStr(TotalLevels), 53) + '|');
WriteLn('| |');
WriteLn('|----------------------------------------------------------------|');
end;
if (Final) then
for I := 0 to (High(Players)) do
begin
Log := MyPlayers[I].Logs;
Exp := Round(YewLogExp * Log);
LogsH := Ceil((Log * 60.0 * 60.0 * 1000.0) / PlayerWorked(I));
ExpH := Ceil((Exp * 60.0 * 60.0 * 1000.0) / PlayerWorked(I));
WriteLn('| Individual Report: |');
WriteLn('| |');
WriteLn('| ' + Padr('Player[' + ToStr(I) + ']: ' + Players[I].Name, 60) + '|');
WriteLn('| |');
//WriteLn('| ' + Padr('Reason : ' + Players[I].Strings[0], 60) + '|');
WriteLn('| ' + Padr('Time Active : ' + MsToTime(PlayerWorked(I), Time_Abbrev), 60) + '|');
//if TakeBreaks then
//Writeln('| ' + Padr('Breaks Taken : ' + ToStr(Players[I].Integers[10]) + ' Break(s)', 58) + '|');
WriteLn('| ' + Padr('Logs Chopped : ' + ToStr(Log), 60) + '|');
WriteLn('| ' + Padr('Logs Per Hour : ' + ToStr(LogsH), 60) + '|');
WriteLn('| ' + Padr('Experience Gained : ' + ToStr(Exp), 60) + '|');
WriteLn('| ' + Padr('Experience Per Hour : ' + ToStr(ExpH), 60) + '|');
//WriteLn('| ' + Padr('Smithing Level : ' + ToStr(Players[I].Integers[11]) + '(+' + ToStr(Players[I].Integers[9]) +')', 60) + '|');
WriteLn('| |');
WriteLn('*----------------------------------------------------------------*');
end
else if (TimeFromMark(ReportTimer) >= (ReportWait * 1000)) and IsLoggedIn then
begin
Log := MyPlayers[CurrentPlayer].Logs;
Exp := Round(YewLogExp * Log);
LogsH := Ceil((Log * 60.0 * 60.0 * 1000.0) / PlayerWorked(CurrentPlayer));
ExpH := Ceil((Exp * 60.0 * 60.0 * 1000.0) / PlayerWorked(CurrentPlayer));
WriteLn('| Individual Report: |');
WriteLn('| |');
WriteLn('| ' + Padr('Player[' + ToStr(CurrentPlayer) + ']: ' + MyPlayers[CurrentPlayer].Name, 60) + '|');
WriteLn('| |');
WriteLn('| ' + Padr('Status : ' + Event, 60) + '|');
WriteLn('| ' + Padr('Time Active : ' + MsToTime(PlayerWorked(CurrentPlayer), Time_Abbrev), 60) + '|');
//if TakeBreaks then
//Writeln('| ' + Padr('Breaks Taken : ' + ToStr(Players[CurrentPlayer].Integers[10]) + ' Break(s)', 58) + '|');
WriteLn('| ' + Padr('Logs Chopped : ' + ToStr(Log), 60) + '|');
WriteLn('| ' + Padr('Logs Per Hour : ' + ToStr(LogsH), 60) + '|');
WriteLn('| ' + Padr('Experience Gained : ' + ToStr(Exp), 60) + '|');
WriteLn('| ' + Padr('Experience Per Hour : ' + ToStr(ExpH), 60) + '|');
//WriteLn('| ' + Padr('Smithing Level : ' + ToStr(Players[CurrentPlayer].Integers[11]) + '(+' + ToStr(Players[CurrentPlayer].Integers[9]) +')', 60) + '|');
WriteLn('| |');
WriteLn('*----------------------------------------------------------------*');
Writeln('
MarkTime(ReportTimer);
end;
PrintOnSMART(Final);
if Final then
Writeln('[/Report]');
end;
Function BankOpen: boolean;
begin
Result := BankScreen or PinScreen;
end;
Function OpenEdgeBankNPC: boolean;
var
Banker: MyColor;
DCTS: Integer; //Defaults
Bankers: T2DPointArray;
Colors: TPointArray;
MousePoint: TPoint;
x, y, I: Integer;
begin
Result := False;
DCTS := GetColorToleranceSpeed;
Banker := LoadObject(OBJ_Banker);
try
ColorToleranceSpeed(Banker.CTS);
SetColorspeed2Modifiers(Banker.Hue, Banker.Sat);
if FindColorsSpiralTolerance(x, y, Colors, Banker.Color, MSX1, MSY1, MSX2, MSY2, Banker.Tol) then
begin
Bankers := TPAToATPA(Colors, 25);
SMART_ClearMS;
RemoveATPAByAccuracy(Bankers, Banker.Accuracy, clLime);
SortATPAFrom(Bankers,Point(MSCX,MSCY));
SortATPAFromFirstPoint(Bankers,Point(MSCX,MSCY));
for I := 0 to High(Bankers) do
begin
MousePoint := Bankers[I][Random(High(Bankers[I]))];
MMouse(MousePoint.x,MousePoint.y,0,0);
if WaitUpTextMulti(['anke','anker','nker'], 500) then
begin
ClickMouse2(False);
if WaitOptionMulti(Banker.Uptexts, 600) then
Result := WaitFunc(@BankOpen,50,4000);
end;
if Result then
Break;
end;
end;
SMART_ClearMS;
finally
ColorToleranceSpeed(DCTS);
SetColorspeed2Modifiers(DHue, DSat);
end;
end;
Function BankIt: boolean;
var
FailSafe: Integer;
begin
Result := False;
if not IsLoggedIn then
Exit;
Report(False);
for FailSafe := 0 to 4 do
if OpenEdgeBankNPC then
break;
if (FailSafe <= 4) then
begin
FailSafe := 0;
if PinScreen then
repeat
Inc(FailSafe);
InPin(Players[CurrentPlayer].Pin);
until WaitFunc(@BankScreen, 100, 1000) or (FailSafe >= 4);
if (FailSafe < 4) then
begin
FailSafe := 0;
repeat
Report(False);
Inc(FailSafe);
if MyPlayers[CurrentPlayer].AxeWielded then
Result := DepositAll
else
begin
Deposit(2,28,True);
Result := (InvCount = 1);
end;
until Result or (Failsafe >= 4);
if not Result then
DebugIt('Unable To DepositAll Items In The Inventory.');
end else
DebugIt('Unable To Open The Bank.');
end else
DebugIt('Unable To Open The Bank.');
DebugIt('BankIt: ' + ToStr(Result));
end;
function InTreeArea(out SPoints: TPointArray): boolean;
var
Check: Integer;
begin
AntiRandoms;
Check := 0;
repeat
Inc(Check);
FindSymbols(SPoints,'tree');
Result := (Length(SPoints) = 2);
until Result or (Check > 10);
DebugIt('InTreeArea: ' + ToStr(Result));
end;
function AtNorthTree(P: TPointArray): boolean;
begin
AntiRandoms;
Result := ((Distance(MMCX,MMCY,P[0].x,P[0].y) < Distance(MMCX,MMCY,P[1].x,P[1].y)) xor (P[0].x < P[1].x));
end;
Function GetTreePoint(North: Boolean; SPoints: TPointArray): TPoint;
begin
if not (North xor (SPoints[0].x < SPoints[1].x)) then
tSwap(SPoints[0], SPoints[1]);
SPoints := MidPoints(SPoints,9);
SMART_ClearCanvasArea(IntToBox(MMX1,MMY1,MMX2,MMY2));
SMART_DrawDotsEx(False, SPoints, clRed);
DrawPoint(False,SPoints[1],6);
Result := SPoints[1];
end;
Function Null_Point: TPoint;
begin
Result := Point(-1, -1);
end;
Function FindWalkPoint(Location: string): TPoint;
var
P: TPointArray;
Pt, NewPt, Offset: TPoint;
RotateRad: Extended;
begin
Result := Null_Point;
if not (IsLoggedIn and InTreeArea(P)) then
Exit;
case lowercase(Location) of
'bank': Offset := Point(35, -64);
'middle': Offset := Point(31, -20);
end;
if P[0].x < P[1].x then
tSwap(P[0],P[1]);
Pt := MiddleTPA(P);
RotateRad := Arctan2(P[0].x - Pt.x, Pt.y - P[0].y);
DebugIt('Degrees = ' + tostr(Degrees(RotateRad)));
NewPt := Point(Pt.x + Offset.x, Pt.y + Offset.y);
NewPt := RotatePoint(NewPt, RotateRad, Pt.x, Pt.y);
if rs_OnMiniMap(NewPt.x, NewPt.y) then
Result := NewPt;
end;
Function AngleWalkTo(Where: string; Rand, Dist: Integer): boolean;
var
WalkPt: TPoint;
FailSafe: Integer;
begin
WalkPt := FindWalkPoint(Where);
if (WalkPt = Null_Point) then
Exit;
DrawPoint(False, WalkPt, 10);
Result := Distance(MMCX, MMCY, WalkPt.x, WalkPt.y) < Dist;
if not Result then
begin
Mouse(WalkPt.x, WalkPt.y, Rand, Rand, mouse_Left);
Report(False);
if WaitFunc(@IsMoving, 1, 3000 + random(500)) then
begin
MarkTime(FailSafe);
while (TimeFromMark(FailSafe) < 30000) do
begin
WalkPt := FindWalkPoint(Where);
DrawPoint(True, WalkPt, 10);
if (Distance(MMCX, MMCY, WalkPt.x, WalkPt.y) < Dist) or (WalkPt = Null_Point) then
Break;
Wait(RandomRange(33,55));
Report(False);
end;
end;
DebugIt(ToStr(TimeFromMark(FailSafe)));
Result := (TimeFromMark(FailSafe) < 30000) and (WalkPt <> Null_Point);
end;
DebugIt('AngleWalkTo(' + ToStr(Where) + ', ' + ToStr(Rand) + ', ' + ToStr(Dist) + '): ' + ToStr(Result));
end;
Function InBankBox(X, Y: Integer): Boolean;
var
BankBox: TBox;
begin
BankBox := IntToBox(x - 12, y - 10, x + 16, y + 10);
Result := PointInBox(Point(MMCX, MMCY), BankBox);
if Result then
DebugIt('InBankBox(' + ToStr(X) + ', ' + ToStr(Y) + '): ' + ToStr(Result));
end;
Function WalkTo(Location: string): boolean;
var
Attempt, FailSafe, X, Y: Integer;
SP: TPointArray;
WPoint: TPoint;
begin
if not IsLoggedIn then
Exit;
Attempt := 0;
repeat
SMART_ClearCanvasArea(IntToBox(MMX1, MMY1, MMX2, MMY2));
Report(False);
if not IsLoggedIn then
Exit;
Inc(Attempt);
RunEnergy(20);
Maintenance('W');
DebugIt('Walking To ' + ToStr(Location) + ' -- Attempt: ' + ToStr(Attempt));
case lowercase(Location) of
'bank':
begin
Result := ObjDTM_Find(ObjDTM_Bank, x, y, True) and InBankBox(x, y);
if (not Result) and ObjDTM_Find(ObjDTM_Bank, x, y, True) then
begin
DebugIt('Found ObjDTM_Bank');
if not InBankBox(x, y) then
ObjDTM_Walk(ObjDTM_Bank, 3, 50, 10, True);
end else if AngleWalkTo('Middle', 1, 12) and ObjDTM_Find(ObjDTM_Bank, x, y, True) then
ObjDTM_Walk(ObjDTM_Bank, 3, 50, 10, True);
Result := ObjDTM_Find(ObjDTM_Bank, x, y, True) and InBankBox(x, y);
end;
'trees': Result := InTreeArea(SP) or (ObjDTM_Walk(ObjDTM_Middle, 3, 50, 10, True) and InTreeArea(SP));
'north', 'south':
begin
Report(False);
if InTreeArea(SP) then
begin
WPoint := GetTreePoint(lowercase(location) = 'north',SP);
Result := Distance(MMCX,MMCY,WPoint.x,WPoint.y) < 16;
if not Result then
begin
Mouse(WPoint.x,WPoint.y+RandomRange(3,5),0,0,True);
Report(False);
if WaitFunc(@IsMoving, 1, 3000 + random(500)) then
begin
MarkTime(FailSafe);
while (TimeFromMark(FailSafe) < 30000) and IsLoggedIn and InTreeArea(SP) do
begin
WPoint := GetTreePoint(lowercase(location) = 'north',SP);
if (Distance(MMCX,MMCY,WPoint.x,WPoint.y) < 16) then
Break;
Wait(RandomRange(33,55));
Report(False);
end;
end;
DebugIt(ToStr(TimeFromMark(FailSafe)));
Result := (TimeFromMark(FailSafe) < 30000) and InTreeArea(SP);
end;
end else
Result := False;
end;
end;
until Result or (Attempt >= MaxWalks) or (not IsLoggedIn);
stats_IncVariable('Times Walked', 1);
DebugIt('WalkTo(' + ToStr(Location) + '): ' + ToStr(Result));
end;
Procedure DoStats(var Count: Integer);
var
NewCount: Integer;
begin
if (not IsLoggedIn) or (Count = InvCount) then
Exit;
NewCount := InvCount;
IncEx(MyPlayers[CurrentPlayer].Logs, (NewCount - Count));
stats_IncVariable('Yew Logs Chopped', (NewCount - Count));
stats_IncVariable('Woodcutting EXP (Gained)', ((NewCount - Count) * YewLogExp));
stats_IncVariable('Total EXP Gained', ((NewCount - Count) * YewLogExp));
Count := NewCount;
end;
Function FindAYew(out TreeBox: TBox): boolean;
var
Colors: TPointArray;
Tree: MyColor;
DCTS: Integer;
begin
if not IsLoggedIn then
Exit;
DCTS := GetColorToleranceSpeed;
Tree := LoadObject(OBJ_TreeLeaves);
try
ColorToleranceSpeed(Tree.CTS);
Result := FindColorsTolerance(Colors, Tree.Color, MSX1, MSY1, MSX2, MSY2, Tree.Tol)
and (Length(Colors) >= Tree.Accuracy);
TreeBox := GetTPABounds(Colors);
DebugIt('Length Of Colors Is: ' + tostr(length(Colors)));
finally
ColorToleranceSpeed(DCTS);
DebugIt('FindAYew: ' + ToStr(Result));
end;
end;
Function CutAYew(TreeBox: TBox): boolean;
var
MousePoint: TPoint;
Colors: TPointArray;
DCTS: Integer; //Default CTS
Tree: MyColor;
begin
if not IsLoggedIn then
Exit;
DebugIt('Function CutAYew.');
DCTS := GetColorToleranceSpeed;
Tree := LoadObject(OBJ_TreeTrunk);
try
ColorToleranceSpeed(Tree.CTS);
if FindColorsTolerance(Colors, Tree.Color, TreeBox.X1, TreeBox.Y1, TreeBox.X2, TreeBox.Y2, Tree.Tol) then
begin
SMART_ClearMS;
SMART_DrawDotsEx(False, Colors, clRed);
DebugIt('Length Of Colors Is: ' + tostr(length(Colors)));
//MousePoint := Colors[Random(High(Colors))];
MousePoint := MiddleTPA(Colors);
MMouse(MousePoint.x,MousePoint.y-10,5,5);
if WaitUpTextMulti(Tree.Uptexts, 500) then
ClickMouse2(true);
Result := DidRedClick;
end else
DebugIt('Unable To Find Tree Trunk Colors.');
finally
SetColorToleranceSpeed(DCTS);
DebugIt('CutAYew: ' + ToStr(Result));
end;
end;
Function ChopDownYew(out TreeGone: boolean): boolean;
var
Bounds: TBox;
TreeTime, Counter, I, Count: Integer;
begin
Report(False);
if (not IsLoggedIn) or InvFull then
Exit;
TreeGone := False;
Count := InvCount;
for I := 0 to MaxRetry do
begin
DebugIt('Retry: ' + ToStr(I));
if IsLoggedIn and (not InvFull) and FindAYew(Bounds) then
begin
DebugIt(ToStr(I));
Maintenance('W');
DebugIt('Found A Yew Tree.');
if CutAYew(Bounds) then
begin
Report(False);
DebugIt('Successfully Began To Chop Down Yew.');
MarkTime(TreeTime);
Counter := 0;
while IsLoggedIn and (not InvFull) and (Counter < 3) and (TimeFromMark(TreeTime) < MaxIdle) do
begin
AntiBan;
if not FindAYew(Bounds) then
Inc(Counter);
//Stats
DoStats(Count);
Report(False);
Wait(RandomRange(50,66));
end;
DebugIt('Time: ' + ToStr(TimeFromMark(TreeTime)));
Result := IsLoggedIn and (InvFull or ((TimeFromMark(TreeTime) < MaxIdle) xor (Counter < 3)));
if Result then
TreeGone := (TimeFromMark(TreeTime) < MaxIdle) and (Counter >= 3);
SMART_ClearMS;
//Stats
DoStats(Count);
end;
end;
end;
//Stats
DoStats(Count);
DebugIt(ToStr(I));
DebugIt('ChopDownYew(' + tostr(TreeGone) + '): ' + ToStr(Result));
end;
Function WaitTree: boolean;
var
MainTimer: Integer;
Unused: TBox;
It: TPointArray;
begin
if (not IsLoggedIn) or InvFull or (not InTreeArea(It)) then
Exit;
if AtNorthTree(It) then
WalkTo('South')
else
WalkTo('North');
MarkTime(MainTimer);
while IsLoggedIn and (not FindAYew(Unused)) and (TimeFromMark(MainTimer) < MaxWait) do
begin
AntiBan;
Report(False);
Wait(RandomRange(100,133));
end;
Result := IsLoggedIn and (TimeFromMark(MainTimer) < MaxWait);
DebugIt('WaitTree: ' + ToStr(Result));
end;
Procedure FreeMe;
begin
Report(True);
Writeln('"Bye Guys" - Yago');
end;
Procedure MainLoop;
var
WaitAttempts: Integer;
Unused: TPointArray;
MoveOn: Boolean;
begin
repeat
if not IsLoggedIn then
LoginPlayer
else
PlayerStartTime := GetSystemTime;
if not PlayerStartUp then
begin
DebugIt('Aborting!');
Exit;
end;
WaitAttempts := 0;
MarkTime(ReportTimer);
MarkTime(PaintTimer);
while IsLoggedIn and (WaitAttempts <= MaxWaits) do
begin
Report(False);
if (lowercase(Event) <> 'logout') and InvFull then
AssignStatus('Banking');
Writeln('Status: ' + Event);
case lowercase(Event) of
'banking':
if WalkTo('Bank') and BankIt then
begin
stats_IncVariable('Times Banked', 1000)
AssignStatus('Trees');
end;
'trees':
begin
if not InTreeArea(Unused) then
WalkTo('Trees');
if WalkTo('South') then
AssignStatus('Chopping');
end;
'chopping':
if (not ChopDownYew(MoveOn)) or MoveOn then
begin
AssignStatus('Waiting');
WaitAttempts := 0;
end;
'waiting':
if not WaitTree then
begin
Inc(WaitAttempts);
DebugIt('Wait Attempt: ' + ToStr(WaitAttempts));
end else
AssignStatus('Chopping');
end;
end;
NextPlayer(False);
until AllPlayersInactive;
end;
Begin
ClearDebug;
ScriptUpdate;
DownloadToFile('http://yagoscripts.netii.net/TCEProg.png',ThePath);
SetupSRL;
ObjDTM_Setup;
ObjDTM_Debug := Debug_Script;
SMART_ClearCanvas;
if (Stats_UserID = '') then
SetupSRLStats(919, 'YagoScripts', 'abcdefghij')
else
SetupSRLStats(919, Stats_UserID, Stats_Password);
DeclarePlayers;
SetPlayers;
Init;
AddOnTerminate('FreeMe');
MainLoop;
End.
Its not perfect, and I took out a lot of the code that logs you out since it kept randomly doing so.
But I haven't had any problems and can get it to run 6 hours or so.
[Error] C:\Simba\Scripts\TheCuttingEdge v0.6.simba(850:43): Invalid number of parameters at line 849
Compiling failed.
What's that?
I keep getting this error...
Simba Code:[Error] C:\Simba\Scripts\TheCuttingEdge v0.6.simba(850:43): Invalid number of parameters at line 849
Compiling failed.
The "error" is:
Simba Code:SMART_DrawBoxEx(False, BankBox, clRed);
There was a new parameter added, called fill. Replacing the line withSimba Code:procedure SMART_DrawBoxEx(Clear, Fill: boolean; Box: TBox; color: TColor)
should theoretically solve the issue. Let me know if it works.Simba Code:SMART_DrawBoxEx(False, False, BankBox, clRed);
Try going through this; http://villavu.com/forum/showthread.php?t=88578
Here's the working fix.
I've been running it for a few hours without any trouble.
Enjoy!
Simba Code:Program TheCutingEdge;
{$DEFINE SMART}
{$i SRL/SRL.simba}
{$i ObjectDTM/ObjDTMInclude.simba}
const
{----SMART Setup Constants----}
WORLD = 0; // Choose What Server To Load. Set As 0 For Random Sever.
{-----------------------------}
Stats_UserID = ''; // SRL Stats ID (Leave Blank If None).
Stats_Password = ''; // SRL Stats Password (Leave Blank If None).
Debug_Script = False; // Set To True To Debug The Script.
Auto_Update = True; // Check For And Download The Newest Script Version.
AntiBanAmount = 25; // 0 = 0% Chance. 100 = 100%.
ReportWait = 60; // How Often In Seconds To Print A Text Report
PaintWait = 50; // How Often In Miliseconds To Print On Screen. Set To 0 For No Paint
Type
MyPlayer = Record
Name, Pass, Pin: string;
Member, Active, AxeWielded: Boolean;
Logs, Exp, LogH, ExpH, LampSkill: Integer;
BoxRewards: TStringArray;
End;
MyColor = Record
Color, Tol, CTS, Accuracy: Integer;
Sat, Hue: Extended;
Uptexts: TStringArray;
End;
var MyPlayers: Array of MyPlayer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
CurrentPlayer := 0;
NumberOfPlayers(HowManyPlayers);
setlength(MyPlayers, HowManyPlayers);
With MyPlayers[0] do
begin
Name := ''; //Character Name
Pass := ''; //Character Pass
Pin := ''; //Pin for bank
Member := True; //True = Members Account & False = Non-Members Account.
Active := True; //Use player in script?
AxeWielded := True; //Is You Axe Wielded? Yes = True and No = False. If No then place axe in first slot.
BoxRewards := ['XP','Lamp'];
LampSkill := SKILL_WOODCUTTING;
end;
end;
{Do Not Touch Below Unless Instructed To!!!}
const
//Version And Paths
Version = '0.6'; //Script Version;
ThePath = ScriptPath + '/TCEProg.png'; // Image Path;
//Script-Function Wait Times
MaxWait = 100000; //How much time to wait for a tree after checking the previous tree.
MaxWaits = 10; //How many times to go from tree to tree without success before logging out.
MaxWalks = 4; //Maximum Attempts To Repeat Walking If Failed
MaxIdle = 60000; //Failsafe Time To Idle While Chopping
MaxRetry = 4; //Max Number of times to retry chopping script while idle
//Color-Related Constants
DHue = 0.2;
DSat = 0.2; //Default Hue And Sat
//Axe Constants
Dragon_Axe = 0;
Rune_Axe = 1;
Addy_Axe = 2;
Mith_Axe = 3;
Steel_Axe = 4;
Black_Axe = 5;
Iron_Axe = 6;
Bronze_Axe = 7;
//Other
YewLogExp = 175;
TLoggedIn = 4000;
//Object Constats
OBJ_Banker = 0;
OBJ_TreeTrunk = 1;
OBJ_TreeLeaves = 2;
//OBJDTM Points
ObjDTM_Bank = '81:80:7:1:7:121:67:1:7:92:32:10:7:91:66:10:7:87:71:10:7:87:79:10:7:87:88:3:7:127:84';
ObjDTM_Middle = '79:125:7:1:7:121:67:1:7:92:32:10:7:91:66:10:7:87:71:10:7:87:79:10:7:87:88:3:7:127:84';
var
Event: string;
ReportTimer, PaintTimer, Prog: Integer;
PaintArray: TStringArray;
Procedure DebugIt(Text: string);
begin
if Debug_Script then
Writeln(Text);
end;
Procedure Init;
begin
{Paint}
if (PaintWait <> 0) then
begin
Prog := LoadBitmap(ThePath);
SMART_DrawBitmap(True,Prog,Point(MCX1,MCY1));
SetLength(PaintArray,6);
end;
end;
Function LoadObject(Which: Integer): MyColor;
begin
case Which of
OBJ_Banker:
with Result do
begin
Color := 3678760;
Hue := 0.06;
Sat := 0.45;
Tol := 10;
CTS := 2;
Accuracy := 100;
Uptexts := ['Bank B', 'nk B'];
end;
OBJ_TreeTrunk:
with Result do
begin
Color := 1120536;
Tol := 1;
CTS := 1;
Uptexts := ['Chop','down','Yew','hop d','wn Y'];
end;
OBJ_TreeLeaves:
with Result do
begin
Color := 2113332;
Tol := 3;
CTS := 0;
Accuracy := 200;
end;
end;
end;
{*******************************************************************************
function DownloadToFile(const URL, Filename: string): boolean;
By: Dgby714. Editted By Yago.
Description: Downloading file from URL to Filename.
*******************************************************************************}
Function DownloadToFile(const URL, Filename: string): boolean;
var
FileI: LongInt;
FileC, FileH: string;
begin
Writeln('Paint File Check.');
Result := False;
FileI := InitializeHTTPClient(False,False);
try
FileC := GetHTTPPage(FileI, URL);
FileH := GetRawHeaders(FileI);
if ((FileC = '') or (FileH = '')) then
begin
WriteLn('Error downloading "' + URL + '".');
Exit;
end;
FileH := Copy(GetRawHeaders(FileI), 10, Pos(#13, FileH) - 10); //Error Code
if (FileH <> '200 OK') then
begin
WriteLn('Couldn''t download "' + URL + '", Error Code: ' + FileH + '.');
Exit;
end;
finally
FreeHTTPClient(FileI);
end;
try
if not FileExists(Filename) then
FileI := CreateFile(Filename)
else
FileI := OpenFile(Filename, False);
CloseFile(FileI);
FileI := RewriteFile(Filename, False);
Result := WriteFileString(FileI, FileC);
finally
CloseFile(FileI);
end;
end;
{*******************************************************************************
Procedure ScriptUpdate;
Description: Checks For Newer Versions Of The Script And Updates The Script If
The User Sets The Update Constant;
Authors: Harry. Eddited By Me.
*******************************************************************************}
Procedure ScriptUpdate;
var ClientUp, Neifile:integer;
OnlineVersion, NewScript, NeiFeilNennen:string;
begin
if Auto_Update then
begin
Writeln('Checking For An Updated Script Version.');
OnlineVersion := GetPage('http://yagoscripts.netii.net/TCEVersion.html');
Writeln(onlineversion);
Writeln(Version);
if (Length(trim(OnlineVersion)) = 3) and (trim(OnlineVersion) > Version) then
begin
WriteLn('Newer Version Found Online. Will AutoUpdate.');
ClientUp := InitializeHTTPClient(False,False);
SetHTTPUserAgent(ClientUp,'Simba');
NewScript := GetHTTPPage(ClientUp,'http://yagoscripts.netii.net/TCE-Current.simba');
FreeHTTPClient(ClientUp);
NeiFeilNennen := ScriptPath + 'TheCuttingEdge v'+trim(OnlineVersion)+'.simba';
Neifile := Rewritefile(NeiFeilNennen, true);
try
WriteFileString(Neifile, NewScript);
except
begin
WriteLn('Fatal Error Writing To '+NeiFeilNennen+'!');
TerminateScript;
end;
end;
CloseFile(Neifile);
WriteLn('New Script Downloaded And Saved To '+NeiFeilNennen+' !! Please Use This!');
TerminateScript;
end else
begin
if (Length(trim(OnlineVersion)) <> 3) then
begin
WriteLn('Version Checking Failed. You Might Be Outdated.');
Writeln('Please Check For The Latest Version Online.');
end else
WriteLn('You Have The Latest Version Of The Script!');
Exit;
end;
end else
WriteLn('!!!!! Not Checking For The Latest Version Of This Script. You Might Be Outdated!');
end;
Procedure SetPlayers;
var
I: Integer;
begin
for I := 0 to High(MyPlayers) do
begin
Players[i].Name := MyPlayers[i].Name;
Players[i].Pass := MyPlayers[i].Pass;
Players[i].Pin := MyPlayers[i].Pin;
Players[i].Active := MyPlayers[i].Active;
Players[i].Member := MyPlayers[i].Member;
Players[i].WorldInfo := [MyPlayers[i].Member, -1, False];
Players[I].BoxRewards := MyPlayers[i].BoxRewards;
Players[i].LampSkill := MyPlayers[i].LampSkill;
MyPlayers[i].Exp := 0;
MyPlayers[i].Logs := 0;
MyPlayers[i].ExpH := 0;
MyPlayers[i].LogH := 0;
end;
end;
Procedure AntiRandoms;
begin
FindNormalRandoms;
DebugIt('Ran Procedure AntiRandoms.');
end;
function IsLoggedIn: boolean;
var
Timer: Integer;
begin
//Failsafe for the onFocus bug with SMART. The screen goes black for a few ms when focusing on SMART.
AntiRandoms;
Result := (PercentBlackMM <> 100) and LoggedIn;
MarkTime(Timer);
while (not Result) and (TimeFromMark(Timer) <= TLoggedIn) do
begin
AntiRandoms;
Result := (PercentBlackMM <> 100) and LoggedIn;
end;
DebugIt('IsLoggedIn: ' + ToStr(Result));
end;
{*******************************************************************************
procedure SetAngle(Highest : Boolean);
By: Raymond, edit by NaumanAkhlaQ. Editted By me
Description: Sets the mainscreen at highest\lowest angle (Depends on the boolean)
Taken From SRL Include.
*******************************************************************************}
Procedure SetCustomAngle(Highest: Boolean);
begin
if (not IsLoggedIn) then exit;
KeyDown((Integer(not Highest) * 2) + 38);
Sleep(1000 + Random(300));
KeyUp((Integer(not Highest) * 2) + 38);
end;
Procedure Maintenance(Angle: string);
begin
if not (IsLoggedIn) then
Exit;
DebugIt('Running Procedure Maintenance(' + Angle +').');
SetCustomAngle(True);
MakeCompass(Angle);
end;
Procedure AntiBan;
var
I, AB: Integer;
begin
if (AntiBanAmount <> 0) then
begin
if (AntiBanAmount > 100) then
AB := 1000
else
AB := AntiBanAmount * 10;
I := Random(90 * (Ceil(1000/AB))) + 1;
case I of
1: RandomRClick;
2,3:
begin
HoverSkill('woodcutting', False);
SleepAndMoveMouse(100);
end;
4: PickUpMouse;
5: RandomAngle(True);
6: RandomMovement;
7: BoredHuman;
8..10: SleepAndMoveMouse(500);
end;
if (I <= 10) then
begin
DebugIt('Ran AntiBan Procedure.');
Maintenance('W');
end;
end;
end;
Procedure AssignStatus(Assignment: string);
begin
Event := Assignment;
end;
Procedure PrintOnSMART(Force: boolean);//Not Mine, Just Editted
var
Log, Exp, Logsh, Exph, Portion, I: Integer;
ThePoint: TPoint;
V: string;
begin
if (PaintWait = 0) or ((not Force) and (TimeFromMark(PaintTimer) < PaintWait)) then
Exit;
Log := MyPlayers[CurrentPlayer].Logs;
Exp := Round(175 * Log);
LogsH := Ceil((Log * 60.0 * 60.0 * 1000.0) / PlayerWorked(CurrentPlayer));
ExpH := Ceil((Exp * 60.0 * 60.0 * 1000.0) / PlayerWorked(CurrentPlayer));
for I := 0 to 5 do
begin
case I of
0:
begin
V := tostr(Log) + ' Logs';
ThePoint := Point(267,62);
end;
1:
begin
V := tostr(Exp) + ' Exp';
ThePoint := Point(267,79);
end;
2:
begin
V := tostr(ExpH);
ThePoint := Point(267,96);
end;
3:
begin
V := tostr(LogsH) + ' Logs';
ThePoint := Point(267,113);
end;
4:
begin
V := Event;
ThePoint := Point(382,64);
end;
5:
begin
V := MsToTime(GetTimeRunning, Time_Short);
ThePoint := Point(421,94);
end;
end;
if V = PaintArray[I] then
Continue;
Portion := GetMufasaBitmap(Prog).Copy(ThePoint.x, ThePoint.y, ThePoint.x + 76, ThePoint.y + 17).Index;
SMART_DrawBitmap(False,Portion,Point(MCX1 + ThePoint.x, MCY1 + ThePoint.y));
FreeBitmap(Portion);
SMART_DrawTextEx(False,MCX1 + ThePoint.x, MCY1 + ThePoint.y, SmallChars, V, clGreen);
end;
PaintArray := [tostr(Log) + ' Logs',tostr(Exp) + ' Exp',tostr(ExpH),tostr(LogsH) + ' Logs',Event,MsToTime(GetTimeRunning, Time_Short)];
MarkTime(PaintTimer);
end;
Procedure DrawPoint(Clear: Boolean; P: TPoint; S: Integer);
begin
if Clear then
SMART_ClearCanvasArea(IntToBox(MMX1, MMY1, MMX2, MMY2));
SMART_DrawLine(False,Point(P.x-S,P.y-S),Point(P.x+S+1,P.y+S+1),clBlue);
SMART_DrawLine(False,Point(P.x-S,P.y-S-1),Point(P.x+S,P.y+S+1),clBlue);
SMART_DrawLine(False,Point(P.x-S-1,P.y-S),Point(P.x+S+1,P.y+S),clBlue);
SMART_DrawLine(False,Point(P.x-S,P.y+S),Point(P.x+S+1,P.y-S-1),clBlue);
SMART_DrawLine(False,Point(P.x-S-1,P.y+S),Point(P.x+S+1,P.y-S),clBlue);
SMART_DrawLine(False,Point(P.x-S,P.y+S+1),Point(P.x+S,P.y-S-1),clBlue);
end;
Procedure RemoveATPAByAccuracy(var ATPA: T2DPointArray; Accuracy, Color: Integer);
var
I: Integer;
begin
for I := 0 to High(ATPA) do
if (Length(ATPA) = 0) or (High(ATPA) < I) then
Break
else if Length(ATPA[I]) < Accuracy then
begin
DeleteValueInATPA(ATPA, I);
I := I - 1;
end else if (Color <> 0) then
begin
DebugIt(ToStr(Length(ATPA[I])));
SMART_DrawDotsEx(False, ATPA[I], Color + I * 100);
end;
end;
Function LoadAxeDTM(Which: Integer): integer;
begin
DebugIt('LoadAxeDTM: ' + ToStr(Which));
case Which of
Dragon_Axe: Result := DTMFromString('mbQAAAHicY2VgYLjKwsBwAIhvAPEdID4BxF+B4hyMDAz/gPQnIP4GxJ78XECSCQUDlWAARiwYDADXZQh/');
Rune_Axe: Result := DTMFromString('mbQAAAHicY2VgYOACYn4gFgZiFgYIYAJiDiS2JBDbevpDeQgMU48MGLFgMAAAV5oBQQ==');
Addy_Axe: Result := DTMFromString('mbQAAAHicY2VgYOBigAAWIBYGYn4gZgJiSSgNAhxAbO1iDRVBYBYGBGCG0oxYMBgAAFEzASk=');
Mith_Axe: Result := DTMFromString('mbQAAAHicY2VgYOBigAAWIBYGYn4gZgJiSSgNAhxAbGYWABVBYBYGBGCG0oxYMBgAAFGZASs=');
Steel_Axe: Result := DTMFromString('mbQAAAHicY2VgYOBigAAWIBYGYn4gZgJiSSgNAhxAnJuZCRVBYBYGBGCG0oxYMBgAAHJ3Aa4=');
Black_Axe: Result := DTMFromString('mbQAAAHicY2VgYOBigAAWIBYGYn4gZgJiSSgNAhxAzMfLCxVBYBYGBGCG0oxYMBgAACy0AJc=');
Iron_Axe: Result := DTMFromString('mbQAAAHicY2VgYOACYn4gFgZiFgYIYAJiDiS2JBC7ODpCeQjMCFXDzIAAjFgwGAAAU9cBMg==');
Bronze_Axe: Result := DTMFromString('mbQAAAHicY2VgYOBigAAWIBYGYn4gZgJiSSgNAhxAbG8gAxVBYBYGBGCG0oxYMBgAAEWWAPo=');
end;
end;
Function PlayerStartUp: boolean;
var
Level,AxeDTM, x, y, I: integer;
begin
DebugIt('Function PlayerStartUp.');
Result := False;
if not IsLoggedIn then
Exit;
CloseBank;
ClosePinScreen;
SetCustomAngle(True);
Level := GetSkillLevel(Skill_WoodCutting);
DebugIt('WC Level Is ' + ToStr(Level));
case Level of
61..100: I := Dragon_Axe;
41..60: I := Rune_Axe;
31..40: I := Addy_Axe;
21..30: I := Mith_Axe;
6..20: I := Steel_Axe;
else
I := Bronze_Axe;
end;
if MyPlayers[CurrentPlayer].AxeWielded then
Gametab(tab_Equip)
else
GameTab(tab_Inv);
for I := I to Bronze_Axe do
begin
AxeDTM := LoadAxeDTM(I);
Result := FindDTM(AxeDTM, x, y, MIX1, MIY1, MIX2, MIY2);
FreeDTM(AxeDTM);
if Result then
Break;
end;
if Result then
if InvFull then
AssignStatus('Banking')
else
AssignStatus('Trees');
DebugIt('Player['+ ToStr(CurrentPlayer) + '] StartUp: ' + ToStr(Result));
end;
Procedure Report(Final: boolean);
Var
Log, TotalLogs, Exp, TotalExp, I: Integer;
LogsH, ExpH: LongInt;
begin
if (stats_Commit) then
Writeln('Stats Committed.');
if Final or ((TimeFromMark(ReportTimer) >= (ReportWait * 1000)) and IsLoggedIn) then
begin
for I := 0 to (High(Players)) do
begin
IncEx(TotalLogs, MyPlayers[I].Logs);
IncEx(TotalEXP, Round(YewLogExp * MyPlayers[I].Logs));
//IncEx(TotalLevels, Players[I].Integers[9]);
end;
Writeln('[Report]');
SRLRandomsReport;
WriteLn('*----------------------------------------------------------------*');
WriteLn('| The Cutting Edge ' + Padr(ToStr(Version), 23) + '|');
WriteLn('| By: Yago |');
WriteLn('|----------------------------------------------------------------|');
WriteLn('| Overall Progress Report |');
WriteLn('| |');
WriteLn('| ' + Padr('Total Players : ' + ToStr(HowManyPlayers), 53) + '|');
WriteLn('| ' + Padr('Total Time Running : ' + MsToTime(GetTimeRunning, Time_Abbrev), 53) + '|');
WriteLn('| ' + Padr('Total Logs Chopped : ' + ToStr(TotalLogs), 53) + '|');
WriteLn('| ' + Padr('Total Experience Gained : ' + ToStr(TotalEXP), 53) + '|');
//WriteLn('| ' + Padr('Total Smithing Levels Gained : ' + ToStr(TotalLevels), 53) + '|');
WriteLn('| |');
WriteLn('|----------------------------------------------------------------|');
end;
if (Final) then
for I := 0 to (High(Players)) do
begin
Log := MyPlayers[I].Logs;
Exp := Round(YewLogExp * Log);
LogsH := Ceil((Log * 60.0 * 60.0 * 1000.0) / PlayerWorked(I));
ExpH := Ceil((Exp * 60.0 * 60.0 * 1000.0) / PlayerWorked(I));
WriteLn('| Individual Report: |');
WriteLn('| |');
WriteLn('| ' + Padr('Player[' + ToStr(I) + ']: ' + Players[I].Name, 60) + '|');
WriteLn('| |');
//WriteLn('| ' + Padr('Reason : ' + Players[I].Strings[0], 60) + '|');
WriteLn('| ' + Padr('Time Active : ' + MsToTime(PlayerWorked(I), Time_Abbrev), 60) + '|');
//if TakeBreaks then
//Writeln('| ' + Padr('Breaks Taken : ' + ToStr(Players[I].Integers[10]) + ' Break(s)', 58) + '|');
WriteLn('| ' + Padr('Logs Chopped : ' + ToStr(Log), 60) + '|');
WriteLn('| ' + Padr('Logs Per Hour : ' + ToStr(LogsH), 60) + '|');
WriteLn('| ' + Padr('Experience Gained : ' + ToStr(Exp), 60) + '|');
WriteLn('| ' + Padr('Experience Per Hour : ' + ToStr(ExpH), 60) + '|');
//WriteLn('| ' + Padr('Smithing Level : ' + ToStr(Players[I].Integers[11]) + '(+' + ToStr(Players[I].Integers[9]) +')', 60) + '|');
WriteLn('| |');
WriteLn('*----------------------------------------------------------------*');
end
else if (TimeFromMark(ReportTimer) >= (ReportWait * 1000)) and IsLoggedIn then
begin
Log := MyPlayers[CurrentPlayer].Logs;
Exp := Round(YewLogExp * Log);
LogsH := Ceil((Log * 60.0 * 60.0 * 1000.0) / PlayerWorked(CurrentPlayer));
ExpH := Ceil((Exp * 60.0 * 60.0 * 1000.0) / PlayerWorked(CurrentPlayer));
WriteLn('| Individual Report: |');
WriteLn('| |');
WriteLn('| ' + Padr('Player[' + ToStr(CurrentPlayer) + ']: ' + MyPlayers[CurrentPlayer].Name, 60) + '|');
WriteLn('| |');
WriteLn('| ' + Padr('Status : ' + Event, 60) + '|');
WriteLn('| ' + Padr('Time Active : ' + MsToTime(PlayerWorked(CurrentPlayer), Time_Abbrev), 60) + '|');
//if TakeBreaks then
//Writeln('| ' + Padr('Breaks Taken : ' + ToStr(Players[CurrentPlayer].Integers[10]) + ' Break(s)', 58) + '|');
WriteLn('| ' + Padr('Logs Chopped : ' + ToStr(Log), 60) + '|');
WriteLn('| ' + Padr('Logs Per Hour : ' + ToStr(LogsH), 60) + '|');
WriteLn('| ' + Padr('Experience Gained : ' + ToStr(Exp), 60) + '|');
WriteLn('| ' + Padr('Experience Per Hour : ' + ToStr(ExpH), 60) + '|');
//WriteLn('| ' + Padr('Smithing Level : ' + ToStr(Players[CurrentPlayer].Integers[11]) + '(+' + ToStr(Players[CurrentPlayer].Integers[9]) +')', 60) + '|');
WriteLn('| |');
WriteLn('*----------------------------------------------------------------*');
Writeln('[/Report]');
MarkTime(ReportTimer);
end;
PrintOnSMART(Final);
if Final then
Writeln('[/Report]');
end;
Function BankOpen: boolean;
begin
Result := BankScreen or PinScreen;
end;
Function OpenEdgeBankNPC: boolean;
var
Banker: MyColor;
DCTS: Integer; //Defaults
Bankers: T2DPointArray;
Colors: TPointArray;
MousePoint: TPoint;
x, y, I: Integer;
begin
Result := False;
DCTS := GetColorToleranceSpeed;
Banker := LoadObject(OBJ_Banker);
try
ColorToleranceSpeed(Banker.CTS);
SetColorspeed2Modifiers(Banker.Hue, Banker.Sat);
if FindColorsSpiralTolerance(x, y, Colors, Banker.Color, MSX1, MSY1, MSX2, MSY2, Banker.Tol) then
begin
Bankers := TPAToATPA(Colors, 25);
SMART_ClearMS;
RemoveATPAByAccuracy(Bankers, Banker.Accuracy, clLime);
SortATPAFrom(Bankers,Point(MSCX,MSCY));
SortATPAFromFirstPoint(Bankers,Point(MSCX,MSCY));
for I := 0 to High(Bankers) do
begin
MousePoint := Bankers[I][Random(High(Bankers[I]))];
MMouse(MousePoint.x,MousePoint.y,0,0);
if WaitUpTextMulti(['anke','anker','nker'], 500) then
begin
ClickMouse2(False);
if WaitOptionMulti(Banker.Uptexts, 600) then
Result := WaitFunc(@BankOpen,50,4000);
end;
if Result then
Break;
end;
end;
SMART_ClearMS;
finally
ColorToleranceSpeed(DCTS);
SetColorspeed2Modifiers(DHue, DSat);
end;
end;
Function BankIt: boolean;
var
FailSafe: Integer;
begin
Result := False;
if not IsLoggedIn then
Exit;
Report(False);
for FailSafe := 0 to 4 do
if OpenEdgeBankNPC then
break;
if (FailSafe <= 4) then
begin
FailSafe := 0;
if PinScreen then
repeat
Inc(FailSafe);
InPin(Players[CurrentPlayer].Pin);
until WaitFunc(@BankScreen, 100, 1000) or (FailSafe >= 4);
if (FailSafe < 4) then
begin
FailSafe := 0;
repeat
Report(False);
Inc(FailSafe);
if MyPlayers[CurrentPlayer].AxeWielded then
Result := DepositAll
else
begin
Deposit(2,28,True);
Result := (InvCount = 1);
end;
until Result or (Failsafe >= 4);
if not Result then
DebugIt('Unable To DepositAll Items In The Inventory.');
end else
DebugIt('Unable To Open The Bank.');
end else
DebugIt('Unable To Open The Bank.');
DebugIt('BankIt: ' + ToStr(Result));
end;
function InTreeArea(out SPoints: TPointArray): boolean;
var
Check: Integer;
begin
AntiRandoms;
Check := 0;
repeat
Inc(Check);
FindSymbols(SPoints,'tree');
Result := (Length(SPoints) = 2);
until Result or (Check > 10);
DebugIt('InTreeArea: ' + ToStr(Result));
end;
function AtNorthTree(P: TPointArray): boolean;
begin
AntiRandoms;
Result := ((Distance(MMCX,MMCY,P[0].x,P[0].y) < Distance(MMCX,MMCY,P[1].x,P[1].y)) xor (P[0].x < P[1].x));
end;
Function GetTreePoint(North: Boolean; SPoints: TPointArray): TPoint;
begin
if not (North xor (SPoints[0].x < SPoints[1].x)) then
tSwap(SPoints[0], SPoints[1]);
SPoints := MidPoints(SPoints,9);
SMART_ClearCanvasArea(IntToBox(MMX1,MMY1,MMX2,MMY2));
SMART_DrawDotsEx(False, SPoints, clRed);
DrawPoint(False,SPoints[1],6);
Result := SPoints[1];
end;
Function Null_Point: TPoint;
begin
Result := Point(-1, -1);
end;
Function FindWalkPoint(Location: string): TPoint;
var
P: TPointArray;
Pt, NewPt, Offset: TPoint;
RotateRad: Extended;
begin
Result := Null_Point;
if not (IsLoggedIn and InTreeArea(P)) then
Exit;
case lowercase(Location) of
'bank': Offset := Point(35, -64);
'middle': Offset := Point(31, -20);
end;
if P[0].x < P[1].x then
tSwap(P[0],P[1]);
Pt := MiddleTPA(P);
RotateRad := Arctan2(P[0].x - Pt.x, Pt.y - P[0].y);
DebugIt('Degrees = ' + tostr(Degrees(RotateRad)));
NewPt := Point(Pt.x + Offset.x, Pt.y + Offset.y);
NewPt := RotatePoint(NewPt, RotateRad, Pt.x, Pt.y);
if rs_OnMiniMap(NewPt.x, NewPt.y) then
Result := NewPt;
end;
Function AngleWalkTo(Where: string; Rand, Dist: Integer): boolean;
var
WalkPt: TPoint;
FailSafe: Integer;
begin
WalkPt := FindWalkPoint(Where);
if (WalkPt = Null_Point) then
Exit;
DrawPoint(False, WalkPt, 10);
Result := Distance(MMCX, MMCY, WalkPt.x, WalkPt.y) < Dist;
if not Result then
begin
Mouse(WalkPt.x, WalkPt.y, Rand, Rand, mouse_Left);
Report(False);
if WaitFunc(@IsMoving, 1, 3000 + random(500)) then
begin
MarkTime(FailSafe);
while (TimeFromMark(FailSafe) < 30000) do
begin
WalkPt := FindWalkPoint(Where);
DrawPoint(True, WalkPt, 10);
if (Distance(MMCX, MMCY, WalkPt.x, WalkPt.y) < Dist) or (WalkPt = Null_Point) then
Break;
Wait(RandomRange(33,55));
Report(False);
end;
end;
DebugIt(ToStr(TimeFromMark(FailSafe)));
Result := (TimeFromMark(FailSafe) < 30000) and (WalkPt <> Null_Point);
end;
DebugIt('AngleWalkTo(' + ToStr(Where) + ', ' + ToStr(Rand) + ', ' + ToStr(Dist) + '): ' + ToStr(Result));
end;
Function InBankBox(X, Y: Integer): Boolean;
var
BankBox: TBox;
begin
BankBox := IntToBox(x - 12, y - 10, x + 16, y + 10);
Result := PointInBox(Point(MMCX, MMCY), BankBox);
if Result then
SMART_DrawBoxEx(False, False, BankBox, clRed);
DebugIt('InBankBox(' + ToStr(X) + ', ' + ToStr(Y) + '): ' + ToStr(Result));
end;
Function WalkTo(Location: string): boolean;
var
Attempt, FailSafe, X, Y: Integer;
SP: TPointArray;
WPoint: TPoint;
begin
if not IsLoggedIn then
Exit;
Attempt := 0;
repeat
SMART_ClearCanvasArea(IntToBox(MMX1, MMY1, MMX2, MMY2));
Report(False);
if not IsLoggedIn then
Exit;
Inc(Attempt);
RunEnergy(20);
Maintenance('W');
DebugIt('Walking To ' + ToStr(Location) + ' -- Attempt: ' + ToStr(Attempt));
case lowercase(Location) of
'bank':
begin
Result := ObjDTM_Find(ObjDTM_Bank, x, y, True) and InBankBox(x, y);
if (not Result) and ObjDTM_Find(ObjDTM_Bank, x, y, True) then
begin
DebugIt('Found ObjDTM_Bank');
if not InBankBox(x, y) then
ObjDTM_Walk(ObjDTM_Bank, 3, 50, 10, True);
end else if AngleWalkTo('Middle', 1, 12) and ObjDTM_Find(ObjDTM_Bank, x, y, True) then
ObjDTM_Walk(ObjDTM_Bank, 3, 50, 10, True);
Result := ObjDTM_Find(ObjDTM_Bank, x, y, True) and InBankBox(x, y);
end;
'trees': Result := InTreeArea(SP) or (ObjDTM_Walk(ObjDTM_Middle, 3, 50, 10, True) and InTreeArea(SP));
'north', 'south':
begin
Report(False);
if InTreeArea(SP) then
begin
WPoint := GetTreePoint(lowercase(location) = 'north',SP);
Result := Distance(MMCX,MMCY,WPoint.x,WPoint.y) < 16;
if not Result then
begin
Mouse(WPoint.x,WPoint.y+RandomRange(3,5),0,0,True);
Report(False);
if WaitFunc(@IsMoving, 1, 3000 + random(500)) then
begin
MarkTime(FailSafe);
while (TimeFromMark(FailSafe) < 30000) and IsLoggedIn and InTreeArea(SP) do
begin
WPoint := GetTreePoint(lowercase(location) = 'north',SP);
if (Distance(MMCX,MMCY,WPoint.x,WPoint.y) < 16) then
Break;
Wait(RandomRange(33,55));
Report(False);
end;
end;
DebugIt(ToStr(TimeFromMark(FailSafe)));
Result := (TimeFromMark(FailSafe) < 30000) and InTreeArea(SP);
end;
end else
Result := False;
end;
end;
until Result or (Attempt >= MaxWalks) or (not IsLoggedIn);
stats_IncVariable('Times Walked', 1);
DebugIt('WalkTo(' + ToStr(Location) + '): ' + ToStr(Result));
end;
Procedure DoStats(var Count: Integer);
var
NewCount: Integer;
begin
if (not IsLoggedIn) or (Count = InvCount) then
Exit;
NewCount := InvCount;
IncEx(MyPlayers[CurrentPlayer].Logs, (NewCount - Count));
stats_IncVariable('Yew Logs Chopped', (NewCount - Count));
stats_IncVariable('Woodcutting EXP (Gained)', ((NewCount - Count) * YewLogExp));
stats_IncVariable('Total EXP Gained', ((NewCount - Count) * YewLogExp));
Count := NewCount;
end;
Function FindAYew(out TreeBox: TBox): boolean;
var
Colors: TPointArray;
Tree: MyColor;
DCTS: Integer;
begin
if not IsLoggedIn then
Exit;
DCTS := GetColorToleranceSpeed;
Tree := LoadObject(OBJ_TreeLeaves);
try
ColorToleranceSpeed(Tree.CTS);
Result := FindColorsTolerance(Colors, Tree.Color, MSX1, MSY1, MSX2, MSY2, Tree.Tol)
and (Length(Colors) >= Tree.Accuracy);
TreeBox := GetTPABounds(Colors);
DebugIt('Length Of Colors Is: ' + tostr(length(Colors)));
finally
ColorToleranceSpeed(DCTS);
DebugIt('FindAYew: ' + ToStr(Result));
end;
end;
Function CutAYew(TreeBox: TBox): boolean;
var
MousePoint: TPoint;
Colors: TPointArray;
DCTS: Integer; //Default CTS
Tree: MyColor;
begin
if not IsLoggedIn then
Exit;
DebugIt('Function CutAYew.');
DCTS := GetColorToleranceSpeed;
Tree := LoadObject(OBJ_TreeTrunk);
try
ColorToleranceSpeed(Tree.CTS);
if FindColorsTolerance(Colors, Tree.Color, TreeBox.X1, TreeBox.Y1, TreeBox.X2, TreeBox.Y2, Tree.Tol) then
begin
SMART_ClearMS;
SMART_DrawDotsEx(False, Colors, clRed);
DebugIt('Length Of Colors Is: ' + tostr(length(Colors)));
//MousePoint := Colors[Random(High(Colors))];
MousePoint := MiddleTPA(Colors);
MMouse(MousePoint.x,MousePoint.y-10,5,5);
if WaitUpTextMulti(Tree.Uptexts, 500) then
ClickMouse2(true);
Result := DidRedClick;
end else
DebugIt('Unable To Find Tree Trunk Colors.');
finally
SetColorToleranceSpeed(DCTS);
DebugIt('CutAYew: ' + ToStr(Result));
end;
end;
Function ChopDownYew(out TreeGone: boolean): boolean;
var
Bounds: TBox;
TreeTime, Counter, I, Count: Integer;
begin
Report(False);
if (not IsLoggedIn) or InvFull then
Exit;
TreeGone := False;
Count := InvCount;
for I := 0 to MaxRetry do
begin
DebugIt('Retry: ' + ToStr(I));
if IsLoggedIn and (not InvFull) and FindAYew(Bounds) then
begin
DebugIt(ToStr(I));
Maintenance('W');
DebugIt('Found A Yew Tree.');
if CutAYew(Bounds) then
begin
Report(False);
DebugIt('Successfully Began To Chop Down Yew.');
MarkTime(TreeTime);
Counter := 0;
while IsLoggedIn and (not InvFull) and (Counter < 3) and (TimeFromMark(TreeTime) < MaxIdle) do
begin
AntiBan;
if not FindAYew(Bounds) then
Inc(Counter);
//Stats
DoStats(Count);
Report(False);
Wait(RandomRange(50,66));
end;
DebugIt('Time: ' + ToStr(TimeFromMark(TreeTime)));
Result := IsLoggedIn and (InvFull or ((TimeFromMark(TreeTime) < MaxIdle) xor (Counter < 3)));
if Result then
TreeGone := (TimeFromMark(TreeTime) < MaxIdle) and (Counter >= 3);
SMART_ClearMS;
//Stats
DoStats(Count);
end;
end;
end;
//Stats
DoStats(Count);
DebugIt(ToStr(I));
DebugIt('ChopDownYew(' + tostr(TreeGone) + '): ' + ToStr(Result));
end;
Function WaitTree: boolean;
var
MainTimer: Integer;
Unused: TBox;
It: TPointArray;
begin
if (not IsLoggedIn) or InvFull or (not InTreeArea(It)) then
Exit;
if AtNorthTree(It) then
WalkTo('South')
else
WalkTo('North');
MarkTime(MainTimer);
while IsLoggedIn and (not FindAYew(Unused)) and (TimeFromMark(MainTimer) < MaxWait) do
begin
AntiBan;
Report(False);
Wait(RandomRange(100,133));
end;
Result := IsLoggedIn and (TimeFromMark(MainTimer) < MaxWait);
DebugIt('WaitTree: ' + ToStr(Result));
end;
Procedure FreeMe;
begin
Report(True);
Writeln('"Bye Guys" - Yago');
end;
Procedure MainLoop;
var
WaitAttempts: Integer;
Unused: TPointArray;
MoveOn: Boolean;
begin
repeat
if not IsLoggedIn then
LoginPlayer
else
PlayerStartTime := GetSystemTime;
if not PlayerStartUp then
begin
AssignStatus('Logout');
DebugIt('Aborting!');
Exit;
end;
WaitAttempts := 0;
MarkTime(ReportTimer);
MarkTime(PaintTimer);
while IsLoggedIn and (WaitAttempts <= MaxWaits) do
begin
Report(False);
if (lowercase(Event) <> 'logout') and InvFull then
AssignStatus('Banking');
Writeln('Status: ' + Event);
case lowercase(Event) of
'banking':
if WalkTo('Bank') and BankIt then
begin
stats_IncVariable('Times Banked', 1)
AssignStatus('Trees');
end else
AssignStatus('LogOut');
'trees':
begin
if not InTreeArea(Unused) then
if not WalkTo('Trees') then
AssignStatus('LogOut');
if WalkTo('South') then
AssignStatus('Chopping')
else
AssignStatus('LogOut');
end;
'chopping':
if (not ChopDownYew(MoveOn)) or MoveOn then
begin
AssignStatus('Waiting');
WaitAttempts := 0;
end;
'waiting':
if not WaitTree then
begin
Inc(WaitAttempts);
DebugIt('Wait Attempt: ' + ToStr(WaitAttempts));
end else
AssignStatus('Chopping');
'logout':
begin
if Debug_Script then
TakeScreen('TCE - Logout');
LogOut;
end;
end;
end;
NextPlayer(False);
until AllPlayersInactive;
end;
Begin
ClearDebug;
ScriptUpdate;
DownloadToFile('http://yagoscripts.netii.net/TCEProg.png',ThePath);
SRL_SixHourFix := True;
SMART_FixSpeed := True;
SetupSRL;
ObjDTM_Setup;
ObjDTM_Debug := Debug_Script;
SMART_ClearCanvas;
if (Stats_UserID = '') then
SetupSRLStats(919, 'YagoScripts', 'abcdefghij')
else
SetupSRLStats(919, Stats_UserID, Stats_Password);
DeclarePlayers;
SetPlayers;
Init;
AddOnTerminate('FreeMe');
MainLoop;
End.
Guys, i try to run this script, but few seconds after logging into the server, it says bye guys and executes, anu thoughts about that?
Did you try the fixed script above your post?
yes, but now it turns off after three full inventories chopped, this happened two times
| Time Active : 40 min 0 sec |
| Logs Chopped : 81 |
| Logs Per Hour : 122 |
| Experience Gained : 14175 |
| Experience Per Hour : 21262 |
| |
*----------------------------------------------------------------*
[/Report]
"Bye Guys" - Yago
Successfully executed.
The following bitmaps were not freed: [4, 5]
heres what proggy says
Have you filled in all the information correctly?
I don't really have any scripting experience, so I can't help you too much... But I'd suggest double checking the script and making sure that you have the actual settings of RuneScape set up correctly.
Perhaps if you could provide more of your proggy...
i think i have solved this error by increasing maxwalks time to 40, thanks for your help anyway, btw great script, will post a proggy
[Error] C:\Simba\Includes\SRL/SRL/misc/SmartParams.Simba(278:134): Type mismatch at line 277
Compiling failed.
Just started getting this today , Any Ideas.
Other threads seem to be getting this as well, but I dont understand what I.m supposed to replace as line 277 here is just
MyPlayers[i].ExpH := 0;
When i start the script it compiles and appears to run but nothing happens. Smart comes up and loads runescape but thats the end of it. If i log in and then start the script it appears to start working, it tries to type my username and password in but it wont work unless i log myself in and then it does nothing after that.
why i cant open that?
I might update this script after Runescape rolls out its complete anti-botting system.
I get this message when I try to start it:
"Invalid number of parameters at line 849
Compiling failed."
and this is what is on line 849:
SMART_DrawBoxEx(False, BankBox, clRed);
For some reason banking fails sometimes every time the script ended my character stand with a full load logs in bank
^ I am having the same problem here. The banking was working well until the most recent SRL update. I do not really understand how the function works so I am not sure how I might be able to fix it.
It seems like it's having trouble identifying the bank, because it doesn't make it all the way there before executing.
Leonardo I got the error Invalid number of parameters at line 849
Compiling failed.
SMART_DrawBoxEx(False, False, BankBox, clRed);
Dw i got it to work after deleting that extra false.
says this
Exception in Script: Unable to find file 'ObjectDTM/ObjDTMInclude.simba' used from 'C:\Users\Pattycakes\Downloads\TheCuttingEdge v0.6 (1).simba'
what do?
actually i got he above to work but now it just sits there and doesnt log in
Exception in Script: Unable to find file 'ObjectDTM/ObjDTMInclude.simba' used from 'C:\Users\Home\Desktop\TheCuttingEdge v0.6.simba
:/ Thats what mine says..