Sir R. M8gic1an
2010-05-02 14:57:27
From: Dgby714
Name: John
Age: 16
Team Scripting Experience: None
Solo Scripting Experience: I've been SCAR/Simba scripting for about a year now.
Notes: Im not the best scripter but id like to think i do pretty good =)
Why do you want to become an MSI SL: Just wanna join a project and become more of a part of the SRL community
I havnt made anything since joining SRL Members =/
I more like fixing procs and funcs that are broken, then making totaly new ones
but heres what i joined members with:
program DgsPowerCutter;
{$define SMART} //Comment to turn off Smart =)
{$IFDEF SIMBA}
{$include SRL/SRL.scar}
{$include SRL/SRL/misc/Reports.scar}
{$include SRL/SRL/misc/trade.scar}
{$include SRL/SRL/misc/FindXP.scar}
{$include SRL/SRL/misc/Debug.scar}
{$ELSE}
{.include SRL/SRL.scar}
{.include SRL/SRL/misc/Reports.scar}
{.include SRL/SRL/misc/trade.scar}
{.include SRL/SRL/misc/FindXP.scar}
{.include SRL/SRL/misc/Debug.scar}
{$ENDIF}
const
SRLStatsID = ''; //Stats ID
SRLStatsPass = ''; //Stats Pass
SServer = 123; // Smart Server (integer) 0 = Random
SMembers = False; // Member? (boolean)
SSigned = False; // Signed? (boolean)
CheckForUpdate = true; //Will alert you if theres a newer version out
UseAccountINI = true; //Use accounts.ini or DeclarePlayers
Debug = false; //does nothing atm lol
{*******************************************************************************
procedure DeclarePlayers;
By: ???
Description: Generic DeclarePlayers
*******************************************************************************}
procedure DeclarePlayers; // You only have to fill this
begin // out if your not using Accounts.ini
CurrentPlayer := 0;
NumberOfPlayers(1);
with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Strings[1] := ''; // Tree Type? [normal..magic or ivy]
Strings[4] := 'vtp'; // Area (Only if Cutting Ivy)
Strings[2] := 'Woodcutting'; // Lampskill
Strings[3] := 'N'; //Run Direction incase of Fight, can be 'N', 'E', 'S', 'W' or an angle in degrees (145, 93, 180, etc).
Integers[1] := 1; // Loads of Logs or Ivy CutDown?
BoxRewards := ['amp', 'mote', 'ostume', 'oins', 'unes', 're', 'ems'];
Active := True;
end;
end;
{###############################################################################
### SCRIPT BELOW THIS POINT ###
###############################################################################}
const
Script = 'Dg''s PowerCutter';
Version = '0.5';
UURL = 'http://dgspc.freehostia.com/DgsPC.simb.ver';
FourmURL = 'http://villavu.com/forum/showthread.php?p=687781';
{*******************************************************************************
type DGObject
By: Dgby714
Description: A type for Objects
*******************************************************************************}
type
DGObject = record
Uptext: TStringArray;
Color: integer;
Hue: extended;
Sat: extended;
Tol: integer;
Dir: string; //Direction to Point to see Ivy!
end;
{*******************************************************************************
Var and Const
By: Dgby714 and more =)
Description: Varibles and Constistants LOL cant Spell
*******************************************************************************}
var
NumOfPlay, Stats_UserID, Stats_Password, Stats_ScriptID: string;
{$IFNDEF SIMBA}SVersion: string;{$ENDIF}
Stats_LastTime: Integer;
Stats_GlobalVars: array[1..24] of Integer;
Stats_CustomVars: array [1..20] of Integer;
const
Stats_Link = 'http://scriptmanager.freehostia.com/submit.php';
{$IFDEF SIMBA}
{*******************************************************************************
function Implode(Glue : string; Pieces : TStringArray) : string;
Description: srl_Implode
*******************************************************************************}
function Implode(Glue : string; Pieces : TStringArray) : string;
begin
Result := srl_Implode(Pieces, Glue);
end;
{*******************************************************************************
function Explode(str, del: string): TStringArray;
Description: srl_Explode
*******************************************************************************}
function Explode(str, del: string): TStringArray;
begin
Result := srl_Explode(str, del);
end;
{$ENDIF}
{*******************************************************************************
procedure Screenie;
By: Dgby714
Description: Gets a ScreenShot of the Target
*******************************************************************************}
procedure Screenie;
begin
TakeScreenshot('');
end;
{*******************************************************************************
procedure WriteLnEx( str: string );
By: Dgby714
Description: Adds [TheTime] to the beggining of WriteLn
*******************************************************************************}
procedure WriteLnEx( str: string );
begin
WriteLn('[' + TheTime + '] ' + str);
end;
{*******************************************************************************
procedure Report( str: string );
By: Dgby714
Description: Does Disguise, Status, and WriteLnEx all in one
*******************************************************************************}
procedure Report( str: string );
begin
{$IFNDEF SIMBA}
Disguise(str);
Status(str);
{$ENDIF}
WriteLnEx(str);
end;
{*******************************************************************************
procedure Stats_CheckOutput(s: string);
By: ???
Description: ???
*******************************************************************************}
procedure Stats_CheckOutput(s: string);
var
i: Integer;
sa: TStringArray;
begin
sa := Explode(#10, s);
for i := 0 to High(sa) do
if (Trim(sa[i]) <> '') then
if StartsWith('ERROR(1)', sa[i]) then
begin
WriteLn('STATS: "' + sa[i] + '"');
Stats_UserID := '';
Stats_Password := '';
end
else if StartsWith('ERROR(2)', sa[i]) then
begin
WriteLn('STATS: "' + sa[i] + '"');
Stats_ScriptID := '';
end
else
WriteLn('STATS: "' + sa[i] + '"');
end;
{*******************************************************************************
function Stats_GetScriptInfo(out Version, News, Link: string; out OutDated: Boolean; out LastUpdate_HoursAgo: Integer): Boolean;
By: ???
Description: ???
*******************************************************************************}
function Stats_GetScriptInfo(out Version, News, Link: string; out OutDated: Boolean; out LastUpdate_HoursAgo: Integer): Boolean;
var
Client: Integer;
s: string;
sa: TStringArray;
begin
Result := False;
if (Stats_ScriptID = '') then
Exit;
Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
AddPostVariable(Client, 'do', 'getinfo');
AddPostVariable (Client, 'sID', Stats_ScriptID);
s := PostHTTPPageEx(Client, Stats_Link);
sa := Explode(#10'GLUE'#10, s);
if (Length(sa) = 5) then
begin
Result := True;
Version := sa[0];
News := sa[1];
Link := sa[2];
OutDated := sa[3] = '1';
LastUpdate_HoursAgo := StrToIntDef(sa[4], -1);
end
else
Stats_CheckOutput(s);
FreeHTTPClient(Client );
end;
{*******************************************************************************
procedure Stats_SendReport;
By: ???
Description: ???
*******************************************************************************}
procedure Stats_SendReport;
var
i, Client, Time: Integer;
s: string;
begin
if (Stats_UserID = '') and (Stats_Password = '') and (Stats_ScriptID = '') then
Exit;
Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
AddPostVariable(Client, 'do', 'submit');
Time := (GetTimeRunning - Stats_LastTime) div 1000 div 60;
if (Time < 5) then
Time := 0
else
Stats_LastTime := GetTimeRunning;
AddPostVariable(Client, 'sTime', IntToStr(Time));
if (Stats_UserID <> '') and (Stats_Password <> '') then
begin
AddPostVariable(Client, 'uID', Stats_UserID);
AddPostVariable(Client, 'uPass', Stats_Password);
end
else
begin
AddPostVariable(Client, 'uID', '-1');
AddPostVariable(Client, 'uPass', '');
end;
if (Stats_ScriptID <> '') then
begin
AddPostVariable (Client, 'sID', Stats_ScriptID);
for i := Low(Stats_CustomVars) to High(Stats_CustomVars) do
begin
AddPostVariable(Client, 'rndCustom' + IntToStr(i), IntToStr(Stats_CustomVars[i]));
Stats_CustomVars[i] := 0;
end;
end
else
begin
AddPostVariable (Client, 'sID', '-1');
end;
for i := Low(Stats_GlobalVars) to High(Stats_GlobalVars) do
begin
case i of
1: s := IntToStr(SRL_Logs - Stats_GlobalVars[i]);
2: s := IntToStr(Banks - Stats_GlobalVars[i]);
3: s := IntToStr(RandSolved[rand_Death] - Stats_GlobalVars[i]);
else if ((i - 3) < Length(RandSolved) - 1 {for Death}) then
s := IntToStr(RandSolved[i - 3] - Stats_GlobalVars[i]);
end;
AddPostVariable(Client, 'rndGlobal' + IntToStr(i), s);
Stats_GlobalVars[i] := Stats_GlobalVars[i] + StrToInt(s);
end;
s := PostHTTPPageEx(Client, Stats_Link);
Stats_CheckOutput(s);
FreeHTTPClient(Client);
if (SRL_Procs[srl_OnSendStats] <> nil) then
SRL_Procs[srl_OnSendStats]();
end;
{*******************************************************************************
procedure Stats_SendAccountInfo;
By: ???
Description: ???
*******************************************************************************}
procedure Stats_SendAccountInfo;
var
i, Client: Integer;
Accounts: TStringArray;
begin
if (Stats_UserID = '') and (Stats_Password = '') then
Exit;
Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
AddPostVariable(Client, 'do', 'setaccounts');
AddPostVariable(Client, 'uID', Stats_UserID);
AddPostVariable(Client, 'uPass', Stats_Password);
if (Stats_ScriptID <> '') then
AddPostVariable (Client, 'sID', Stats_ScriptID)
else
AddPostVariable (Client, 'sID', '-1');
SetLength(Accounts, HowManyPlayers);
for i := 0 to HowManyPlayers - 1 do
Accounts[i] := implode('.|€stat€|.', [Players[i].Name, Players[i].Loc, IntToStr(Integer(Players[i].Active))]);
AddPostVariable(Client, 'accInfo', Implode(#10'ACC'#10, Accounts));
Stats_CheckOutput(PostHTTPPageEx(Client, Stats_Link));
FreeHTTPClient(Client);
end;
{*******************************************************************************
procedure Stats_ManageAccounts;
By: ???
Description: ???
*******************************************************************************}
procedure Stats_ManageAccounts;
var
i, ii, Client: Integer;
s: string;
Accounts, Stats: TStringArray;
begin
if (Stats_UserID = '') and (Stats_Password = '') then
Exit;
Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
AddPostVariable(Client, 'do', 'getaccounts');
AddPostVariable(Client, 'uID', Stats_UserID);
AddPostVariable(Client, 'uPass', Stats_Password);
AddPostVariable (Client, 'sID', '-1');
s := PostHTTPPageEx(Client, Stats_Link);
Accounts := Explode(#10'ACC'#10, s);
for i := 0 to High(Accounts) do
begin
Stats := Explode('.|€stat€|.', Accounts[i]);
if (Length(Stats) = 3) then
begin
for ii := 0 to HowManyPlayers - 1 do
if (LowerCase(Players[ii].Name) = LowerCase(Stats[0])) then
begin
Players[ii].Loc := Stats[1];
Players[ii].Active := Stats[2] = '1';
Break;
end;
end
else
begin
Stats_CheckOutput(s);
Break;
end;
end;
FreeHTTPClient(Client);
stats_SendAccountInfo;
end;
{*******************************************************************************
function Space( num: integer ): string;
By: Dgby714
Description: Returns num spaces
*******************************************************************************}
function Space( num: integer ): string;
var
Text: string;
I: Integer;
begin
for I := 0 to Num do
Text := Text + ' ';
Result := Text;
end;
{*******************************************************************************
procedure Banner(str: string);
By: Dgby714
Description: My Banner =) (ToDo: Fix when ReplaceDebugLine comes out!)
*******************************************************************************}
procedure Banner(str: string);
var
ScriptName: string;
ConvertLength: integer;
begin
ScriptName := str + ' ' + Trim(Version);
ConvertLength := Floor((66 - Length(ScriptName)) / 2);
ScriptName := Space(ConvertLength) + ScriptName + Space(ConvertLength);
{$IFDEF SIMBA}
ClearDebug;
WriteLn('|--------------------------------------------------------------------|');
WriteLn('| |');
WriteLn('| \______ \ ____\_ |__ ___.__.\______ \/_ | / | | |');
WriteLn('| |');
WriteLn('| |');
WriteLn('| |');
WriteLn('| |');
WriteLn('|--------------------------------------------------------------------|');
WriteLn('|' + ScriptName + '|');
WriteLn('|--------------------------------------------------------------------|');
Wait(Random(500));
ClearDebug;
WriteLn('|--------------------------------------------------------------------|');
WriteLn('| |');
WriteLn('| \______ \ ____\_ |__ ___.__.\______ \/_ | / | | |');
WriteLn('| |');
WriteLn('| | ` \/ /_/ > \_\ \___ | / / | / ^ / |');
WriteLn('| |');
WriteLn('| |');
WriteLn('|--------------------------------------------------------------------|');
WriteLn('|' + ScriptName + '|');
WriteLn('|--------------------------------------------------------------------|');
Wait(Random(500));
ClearDebug;
WriteLn('|--------------------------------------------------------------------|');
WriteLn('| |');
WriteLn('| \______ \ ____\_ |__ ___.__.\______ \/_ | / | | |');
WriteLn('| |');
WriteLn('| | ` \/ /_/ > \_\ \___ | / / | / ^ / |');
WriteLn('| |');
WriteLn('| \//_____/ \/\/ |__| |');
WriteLn('|--------------------------------------------------------------------|');
WriteLn('|' + ScriptName + '|');
WriteLn('|--------------------------------------------------------------------|');
Wait(Random(500));
ClearDebug;
WriteLn('|--------------------------------------------------------------------|');
WriteLn('| ________ ___. _________ ____ _____ |');
WriteLn('| \______ \ ____\_ |__ ___.__.\______ \/_ | / | | |');
WriteLn('| |');
WriteLn('| | ` \/ /_/ > \_\ \___ | / / | / ^ / |');
WriteLn('| |');
WriteLn('| \//_____/ \/\/ |__| |');
WriteLn('|--------------------------------------------------------------------|');
WriteLn('|' + ScriptName + '|');
WriteLn('|--------------------------------------------------------------------|');
Wait(Random(500));
ClearDebug;
WriteLn('|--------------------------------------------------------------------|');
WriteLn('| ________ ___. _________ ____ _____ |');
WriteLn('| \______ \ ____\_ |__ ___.__.\______ \/_ | / | | |');
WriteLn('| | | \ / ___\| __ < | | / / | |/ | |_ |');
WriteLn('| | ` \/ /_/ > \_\ \___ | / / | / ^ / |');
WriteLn('| |');
WriteLn('| \//_____/ \/\/ |__| |');
WriteLn('|--------------------------------------------------------------------|');
WriteLn('|' + ScriptName + '|');
WriteLn('|--------------------------------------------------------------------|');
Wait(Random(500));
ClearDebug;
WriteLn('|--------------------------------------------------------------------|');
WriteLn('| ________ ___. _________ ____ _____ |');
WriteLn('| \______ \ ____\_ |__ ___.__.\______ \/_ | / | | |');
WriteLn('| | | \ / ___\| __ < | | / / | |/ | |_ |');
WriteLn('| | ` \/ /_/ > \_\ \___ | / / | / ^ / |');
WriteLn('| /_______ /\___ /|___ / ____| /____/ |___\____ | |');
WriteLn('| \//_____/ \/\/ |__| |');
WriteLn('|--------------------------------------------------------------------|');
WriteLn('|' + ScriptName + '|');
WriteLn('|--------------------------------------------------------------------|');
Wait(Random(500));
{$ELSE}
ClearDebug;
WriteLn('|--------------------------------------------------------------------|');
WriteLn('| |');
WriteLn('| |');
WriteLn('| |');
WriteLn('| |');
WriteLn('| |');
WriteLn('| |');
WriteLn('|--------------------------------------------------------------------|');
WriteLn('|' + ScriptName + '|');
WriteLn('|--------------------------------------------------------------------|');
Wait(Random(500));
ReplaceDebugLine(2, '| \______ \ ____\_ |__ ___.__.\______ \/_ | / | | |');
Wait(Random(500));
ReplaceDebugLine(4, '| | ` \/ /_/ > \_\ \___ | / / | / ^ / |');
Wait(Random(500));
ReplaceDebugLine(6, '| \//_____/ \/\/ |__| |');
Wait(Random(500));
ReplaceDebugLine(1, '| ________ ___. _________ ____ _____ |');
Wait(Random(500));
ReplaceDebugLine(3, '| | | \ / ___\| __ < | | / / | |/ | |_ |');
Wait(Random(500));
ReplaceDebugLine(5, '| /_______ /\___ /|___ / ____| /____/ |___\____ | |');
{$ENDIF}
end;
{*******************************************************************************
procedure AntiRandoms;
By: ???
Description: Generic AntiRandoms
*******************************************************************************}
procedure AntiRandoms;
begin
LampSkill := Players[CurrentPlayer].Strings[2];
FindNormalRandoms;
if FindFight then
begin
srl_Warn('AntiRandoms', Players[CurrentPlayer].Name + ' was Attacked!', warn_AllVersions);
RunAway(Players[CurrentPlayer].Strings[3], True, 1, 1000+Random(500));
end;
if SomeoneTrades then
srl_Warn('AntiRandoms', GetTradersName + ' Traded ' + Players[CurrentPlayer].Name + '!', warn_AllVersions);
end;
{*******************************************************************************
procedure AntiBan;
By: ???
Description: Generic AntiBan
*******************************************************************************}
procedure AntiBan;
begin
case Random(60) of
0: RandomRClick;
1: HoverSkill('Woodcutting', False);
2: PickUpMouse;
3: RandomMovement;
4: BoredHuman;
5: ExamineInv;
end;
end;
{*******************************************************************************
function GetBitmap(name: string): integer;
By: Dgby714
Description: Results the Log Bitmap
*******************************************************************************}
function GetBitmap(name: string): integer;
begin
case name of
'normal': Result := BitmapFromString(10, 10, 'beNpz02zNtk700o730Ip104x21' +
'YAgIBsoAkRA2XBbabgCuDhQBIggsineOhAuMoLoRVMAtyXSWR0iBTENLhjioB' +
'pkp+JrpRRpLwMXDHdUczSUdTGWczOV9zRX8LZUBAoC1aChABtloF6gCb7mEp7' +
'GYkAGUCMQARUDEdxfQJODrCSBapC9A2EDEcTNQBRiIwVxMEIWAJfFT3M=');
'oak': Result := BitmapFromString(10, 10, 'beNpLtppXHwlEZcGq7Wk2rSnWQARk' +
'wBFEFqKgM90WoqY52aoxybI23gIuBResT7CsijErizQpCjOuCFUFIohgTax5RZRp' +
'tKtGvIdWopd2mq8ukAtUmRNogIYKQoxAeqNMs7wVU9zkgUZBVAIR0BCgpUAEFAGa' +
'XBSgnOOjCDQcaAXQdrgDgBrhzi4JUkF2MxABNWKVhSjI8FRA9jIkEKAKANFOblo=');
'willow': Result := BitmapFromString(10, 10, 'beNqzEY0Mtgai8EArNzsxIHKxE' +
'QUiRysRILI3F4ZIoQnamApbGguZGwgCZZEF9TT5DLX5gchETwCIgIJANWgIqB' +
'GIgIp9PU08XQyBDAgCKoYjoIFAk4N8zYFqIOajIYibgSjE3wLZbQRlgWy4LNx' +
'fyAifLADjnD8n');
'maple': Result := BitmapFromString(10, 10, 'beNqz4a0IVQWismDVeHu+WFteCI' +
'q24Y204g235IFIQUTggkFmPAEm3N6G3EBZuGCIOY+9JqejNqeLDpebHpenARdQ' +
'EKgGDfkacwP1Ak3I8lZMcZMHMoAIqBeIgOohCGgg0OSiAOUcH0UgG4jgtkMQxM' +
'1AVBKkAncwXAEeWSAJl0X2MkQBLlmoAgB7C0VP');
'yew': Result := BitmapFromString(10, 10, 'beNoz5y6KMYYjexVOXwtuIPI2hyJk' +
'KbigpymXmzGXiyGXoz6noxoIAUXggoYq7CZq7OYaHEBZIBcoaKPDgYbs9TghspaK' +
'HCZy7BA2BAHVAxFEBGiyjTIHUA3EfDgCygIFcbkN4iqsskCUEqBjrsCB5mW4LMQN' +
'2AMEAB/iOxE=');
'magic': Result := BitmapFromString(10, 10, 'beNqrjdSf3q3T09heF9VaGwlEQA' +
'YQZSVaA1FarOXpKxcTI7RTonQgInDxxCjz2DATNCm4eGSQERDBpSDiGfFWEATk' +
'QhBQMC/VDog2re8sSLdHRkBBiJqSLEc4OnqwGkg2VoZfuXvrxMVzmq1VQMOBbj' +
'5xpLa5OgKIgFJAdPPxA8M5E3QntQG1QzwFkYUoAMoaLZhsOG9iSowF3NdwBSDZ' +
'hVMMZvXFR5jBZaEIABlMfTA=');
else
Result := BitmapFromString(10, 10, 'beNpz02zNtk700o730Ip104x21YAgIBsoA' +
'kRA2XBbabgCuDhQBIggsineOhAuMoLoRVMAtyXSWR0iBTENLhjioBpkp+JrpRRpLwMXDH' +
'dUczSUdTGWczOV9zRX8LZUBAoC1aChABtloF6gCb7mEp7GYkAGUCMQARUDEdxfQJODrCS' +
'BapC9A2EDEcTNQBRiIwVxMEIWAJfFT3M=');
end;
end;
{*******************************************************************************
procedure DeclarePlayersINI;
By: Dgby714
Description: Grabs player info from a ini file
*******************************************************************************}
procedure DeclarePlayersINI;
var
I: integer;
UserList, AccountsFile: string;
Usernames: array of string;
begin
AccountsFile := ScriptPath + '\accounts.ini';
if FileExists(AccountsFile) then
begin
CurrentPlayer := 0;
NumOfPlay := ReadInI('Accounts', 'Ammount', AccountsFile);
SetArrayLength(Usernames, StrToInt(NumOfPlay));
NumberOfPlayers(StrToInt(NumOfPlay));
UserList := ReadInI('Accounts', 'Usernames', AccountsFile);
if (StrToInt(NumOfPlay) > 1) then
begin
{$IFNDEF SIMBA}
Usernames := Explode(':', Userlist);
{$ELSE}
Usernames := srl_explode(':', Userlist);
{$ENDIF}
end else
Usernames[0] := Userlist;
for I := 0 to High(Usernames) do
begin
with Players[I] do
begin
Name := Usernames[I];
Pass := ReadInI(Usernames[I], 'Password', AccountsFile);
Nick := ReadInI(Usernames[I], 'Nick', AccountsFile);
Strings[1] := ReadInI(Usernames[I], 'Tree', AccountsFile);
Strings[2] := ReadInI(Usernames[I], 'LampSkill', AccountsFile);
Strings[3] := ReadInI(Usernames[I], 'RunDir', AccountsFile);
Integers[1] := StrToInt(ReadInI(Usernames[I], 'Loads', AccountsFile));
Active := StrToBool(ReadInI(Usernames[I], 'Active', AccountsFile));;
BoxRewards := ['amp', 'mote', 'ostume', 'oins', 'unes', 're', 'ems'];
end;
end;
end else
begin
srl_Warn('DeclarePlayersINI', 'Accounts.ini Missing, Switching to DeclarePlayers;', warn_AllVersions);
DeclarePlayers;
end;
end;
{*******************************************************************************
procedure CFU;
By: Dgby714
Description: Checks if you have the latest Script!
*******************************************************************************}
procedure CFU;
var
CVersion, LVersion: extended;
begin
CVersion := StrToFloat(Version);
LVersion := StrToFloat(GetPage(UURL));
if (LVersion > CVersion) then
Report('Update Available visit ' + FourmURL + '!')
else
Report('You are using the latest version of DGsPC!');
end;
{*******************************************************************************
function Axe_Check: boolean;
By: Dgby714
Description: Checks for a Axe
*******************************************************************************}
function Axe_Check: boolean;
var
Hatchet, DHatchet, x, y, I: integer;
begin
if not LoggedIn then exit;
Hatchet := DTMFromString('78DA631467606058C580022C5DBD19FE03694' +
'620FE0F048C0240C60A0634C0042619A13C462E20B19B801A1E20' +
'B19F801A2920B181801A5920B19A801A31C26E0600F1EB0B38');
DHatchet := DTMFromString('78DA639460606038C78002FC05B8194480342' +
'310FF070246794C350C0C4C609211CA630499739C801A3E207196' +
'801A5620F180801A49207115BF1A00CC5B09F1');
I := 0;
repeat
if Result then Break;
case GetCurrentTab of
tab_Equip:begin
if FindDTM(Hatchet, x, y, 566, 285, 606, 327) then
Result := true;
if FindDTM(DHatchet, x, y, 566, 285, 606, 327) then
Result := true;
if (I = 0) then
if not GameTab(tab_Inv) then exit;
Inc(I);
end;
tab_Inv:begin
if FindDTM(Hatchet, x, y, MIX1, MIY1, MIX2, MIY2) then
Result := true;
if FindDTM(DHatchet, x, y, MIX1, MIY1, MIX2, MIY2) then
Result := true;
if (I = 0) then
if not GameTab(tab_Equip) then exit;
Inc(I);
end;
else
if not GameTab(tab_Equip) then exit;
end;
until(I = 2);
FreeDTM(Hatchet);
FreeDTM(DHatchet);
end;
{*******************************************************************************
function GetIvyInfo(str: string): DGObject;
By: Dgby714
Description: Results info about Ivy as a DGObject
*******************************************************************************}
function GetIvyInfo(str: string): DGObject;
var
Ivy: DGObject;
begin
with Ivy do
begin
Uptext := ['vy', 'hop', 'hop ivy', 'Chop Ivy', 'Chop vy', 'hop vy'];
Color := 2442035;
Hue := 0.11;
Sat := 0.20;
Tol := 3;
Dir := 'E';
end;
Result := Ivy;
end;
{*******************************************************************************
function GetTreeInfo(str: string): DGObject;
By: Dgby714
Description: Results info about a tree as a DGObject
*******************************************************************************}
function GetTreeInfo(str: string): DGObject;
var
Tree: DGObject;
begin
case str of
'normal':begin
with Tree do
begin
Uptext := ['ree', 'hop', 'down tree', 'own ree', 'own tree'];
Color := 1329468;
Hue := 0.14;
Sat := 2.44;
Tol := 5;
end;
end;
'oak':begin
with Tree do
begin
Uptext := ['ak', 'Oak', 'own Oak', 'own oak'];
Color := 2649439;
Hue := 0.02;
Sat := 0.88;
Tol := 17;
end;
end;
'willow':begin
with Tree do
begin
Uptext := ['wil', 'low', 'own willow'];
Color := 3562314;
Hue := 0.10;
Sat := 0.55;
Tol := 15;
end;
end;
'maple':begin
with Tree do
begin
Uptext := ['aple', 'maple', 'own maple'];
Color := 2243938;
Hue := 0.26;
Sat := 0.52;
Tol := 8;
end;
end;
'yew':begin
with Tree do
begin
Uptext := ['yew', 'ew', 'own yew'];
Color := 3506545;
Hue := 0.04;
Sat := 1.08;
Tol := 12;
end;
end;
'magic':begin
with Tree do
begin
Uptext := ['agic', 'magic', 'own magic'];
Color := 9755617;
Hue := 0.03;
Sat := 1.81;
Tol := 20;
end;
end else
begin
with Tree do
begin
Uptext := [''];
Color := 0;
Hue := 0;
Sat := 0;
Tol := 0;
end;
end;
end;
Result := Tree;
end;
{*******************************************************************************
procedure Drop_Logs;
By: Dgby714
Description: Drops all Logs in Invo.
*******************************************************************************}
procedure Drop_Logs;
var
bmpLog, ICount: integer;
TreeXP: extended;
begin
if not LoggedIn then
srl_Warn('Drop_Logs', 'Character not Logged In!!', warn_Terminate);
AntiRandoms;
if not GameTab(tab_Inv) then exit;
Report('Starting Log Dropping Process!');
bmpLog := GetBitmap(Lowercase(Players[CurrentPlayer].Strings[1]));
ICount := CountItems('bitmap', bmpLog, [15]);
if ICount > 0 then
begin
Report('Dropping ' + IntToStr(ICount) + ' Logs!');
DropItemsByIdentifier('bitmap', bmpLog, [15]);
end else
Report('No Logs Found!');
FreeBitmap(bmpLog);
Report('All Logs dropped, Back to Trees!');
TreeXP := FindXP('woodcutting', Lowercase(Players[CurrentPlayer].Strings[1]));
Stats_CustomVars[0] := StrToIntDef(FloatToStr(StrToFloatDef(IntToStr(ICount), 1) * TreeXP), 1);
Stats_CustomVars[1] := ICount;
IncEx(Players[CurrentPlayer].Integers[52], Stats_CustomVars[0]);
end;
{*******************************************************************************
procedure Chop_Trees;
By: Dgby714
Description: Finds and Chops Trees
*******************************************************************************}
procedure Chop_Trees;
var
i, StartTime: longint;
x, y, tempCount, ucount, ccount: integer;
Tree: DGObject;
begin
x := MSCX;
y := MSCY;
StartTime := GetSystemTime;
Tree := GetTreeInfo(Lowercase(Players[CurrentPlayer].Strings[1]));
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Tree.Hue, Tree.Sat)
repeat
if FindColorSpiralTolerance(x, y, Tree.Color, MSX1, MSY1, MSX2, MSY2, Tree.Tol) then
begin
MMouse(x, y, 4, 4);
Wait(200 + Random(100));
if IsUpTextMultiCustom(Tree.Uptext) then
begin
Mouse(x, y, 0, 0, True);
x := MSCX;
y := MSCY;
tempCount := InvCount;
Wait(500+Random(500));
i := GetSystemTime;
while FindColorSpiralTolerance(x, y, Tree.Color, MSCX-100, MSCY-100, MSCX+100, MSCY+100, Tree.Tol) do
begin
AntiBan;
AntiRandoms;
Wait(250+random(100));
if (GetSystemTime-i > RandomRange(25000, 50000)) then Break;
if InvFull then Break;
if InvCount <> TempCount then
begin
i := GetSystemTime;
StartTime := GetSystemTime;
tempCount := InvCount;
end;
end;
end else
begin
srl_Warn('Chop_Trees', 'Couldn''t find the uptext of the tree.', warn_AllVersions);
Inc(ucount)
Wait(500);
end;
end else
begin
srl_Warn('Chop_Trees', 'Couldn''t find the color of the tree.', warn_AllVersions);
Inc(ccount)
Wait(500);
end;
until((InvFull) or ((GetSystemTime - StartTime) > RandomRange(25000, 50000)) or ((ucount + ccount) > 75));
end;
{*******************************************************************************
procedure Cut_Ivy;
By: Dgby714
Description: Finds and Cuts Ivy
*******************************************************************************}
procedure Cut_Ivy;
var
StartTime: longint;
x, y, ucount, ccount: integer;
Tree: DGObject;
begin
x := MSCX;
y := MSCY;
StartTime := GetSystemTime;
Tree := GetIvyInfo(Lowercase(Players[CurrentPlayer].Strings[4]));
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Tree.Hue, Tree.Sat);
MakeCompass(Tree.Dir);
repeat
if FindColorSpiralTolerance(x, y, Tree.Color, MSX1, MSY1, MSX2, MSY2, Tree.Tol) then
begin
MMouse(x, y, 4, 4);
Wait(200 + Random(100));
if IsUpTextMultiCustom(Tree.Uptext) then
begin
Mouse(x, y, 0, 0, True);
MMouse(MSCX, MSCY, 5, 5);
while IsUpTextMultiCustom(Tree.Uptext) do
Wait(100+Random(250));
Break;
end else
begin
srl_Warn('Cut_Ivy', 'Couldn''t find the uptext of the Ivy.', warn_AllVersions);
Inc(ucount)
Wait(500);
end;
end else
begin
srl_Warn('Cut_Ivy', 'Couldn''t find the color of the Ivy.', warn_AllVersions);
Inc(ccount)
Wait(500);
end;
until(((GetSystemTime - StartTime) > RandomRange(25000, 50000)) or ((ucount + ccount) > 75));
end;
{*******************************************************************************
procedure ProgressReport(Clear: boolean);
By: Dgby714
Description: My Proggie Procedure
*******************************************************************************}
procedure ProgressReport(Clear: boolean);
begin
if Clear then
ClearDebug;
SRLPlayerReport(ResultDebugBox, Skill_WoodCutting, False,
[True, False, True, False, False, False],
['Alches Done', 'Alches Left', 'Item Alched'],
[], [51, 52], [1], []);
end;
{*******************************************************************************
procedure MainLoop;
By: Dgby714
Description: My MainLoop
*******************************************************************************}
procedure MainLoop;
var
StartTime, EndTime, TotalTime: integer;
begin
if not LoggedIn then
srl_Warn('MainLoop', 'Character not Logged In!!', warn_Terminate);
Wait(1000+Random(1000));
if not Axe_Check then
srl_Warn('MainLoop', 'Axe Missing!!!', warn_Terminate);
repeat
StartTime := GetTickCount;
if (Lowercase(Players[CurrentPlayer].Strings[1]) <> 'ivy') then
begin
Chop_Trees;
Drop_Logs;
end else
Cut_Ivy;
EndTime := GetTickCount;
TotalTime := EndTime - StartTime;
Inc(Players[CurrentPlayer].Integers[50]);
IncEx(Players[CurrentPlayer].Integers[51], TotalTime);
ProgressReport(True);
SRLRandomsReport;
Stats_SendReport;
Stats_ManageAccounts;
until(Players[CurrentPlayer].Integers[50] >= Players[CurrentPlayer].Integers[1]);
end;
{*******************************************************************************
procedure ScriptTerminate;
By: Dgby714
Description: My ScriptTerminate
*******************************************************************************}
procedure ScriptTerminate;
begin
ProgressReport(False);
{$IFNDEF SIMBA}
SVersion := IntToStr(GetSCARVersion);
insert('.', SVersion, 2)
Disguise('SCAR ' + SVersion + ' by Freddy1990');
{$ENDIF}
end;
begin
Banner(Script);
if CheckForUpdate then
CFU;
{$IFNDEF SIMBA}
if not (GetSCARVersion = 323) then
begin
srl_Warn('Main', 'Your using a older version of SCAR then recommended!', warn_AllVersions);
Wait(1000);
end;
{$ENDIF}
if (SServer = 0) then
Smart_Server := RandomWorld(Smart_Members, False)
else
Smart_Server := SServer;
Smart_Signed := SSigned;
Smart_SuperDetail := False;
SetupSRL;
Stats_ScriptID := '35';
Stats_UserID := SRLStatsID;
Stats_Password := SRLStatsPass;
SRLRandomsReport;
Stats_SendReport;
Stats_ManageAccounts;
if UseAccountINI then
begin
if FileExists(ScriptPath + '\accounts.ini') then
DeclarePlayersINI
else
DeclarePlayers;
end else
DeclarePlayers;
repeat
if not LoggedIn then
LoginPlayer;
if (SRL_Logs < 1) then
SRL_Logs := 1;
Players[CurrentPlayer].Integers[50] := 0;//Temp (Loads Done)
Players[CurrentPlayer].Integers[51] := 0;//Temp (Time)
Players[CurrentPlayer].Integers[52] := 0;//Temp (Exp Gained)
Retaliate(False);
SetAngle(True);
SetRun(True);
GetAllLevels;
MainLoop;
if LoggedIn then
Logout;
NextPlayer(False);
until(AllPlayersInactive);
ProgressReport(True);
end.]program DGsAlcher;
//{$define SMART} //Comment to turn off Smart =)
{$IFDEF SIMBA}
{$include SRL/SRL.scar}
{$include SRL/SRL/misc/Reports.scar}
{$include SRL/SRL/misc/trade.scar}
{$include SRL/SRL/misc/QuickChat.scar}
{$ELSE}
{.include SRL/SRL.scar}
{.include SRL/SRL/misc/Reports.scar}
{.include SRL/SRL/misc/trade.scar}
{.include SRL/SRL/misc/QuickChat.scar}
{$ENDIF}
const
SRLStatsID = ''; //Stats ID
SRLStatsPass = ''; //Stats Pass
SServer = 123; // Smart Server (integer) 0 = Random
SMembers = False; // Member? (boolean)
SSigned = False; // Signed? (boolean)
{*******************************************************************************
procedure DeclarePlayers;
By: ???
Description: Generic DeclarePlayers
*******************************************************************************}
procedure DeclarePlayers;
begin
CurrentPlayer := 0;
NumberOfPlayers(1);
with Players[0] do
begin
Name := '';
Pass := '';
Nick := '';
Strings[1] := 'Magic'; // Lampskill
Strings[2] := 'N'; //Run Direction incase of Fight, can be 'N', 'E', 'S', 'W' or an angle in degrees (145, 93, 180, etc).
Strings[3] := Bank_GE; //Bank your neer (only if banking coins)
Integers[1] := 1; // Loads to Do?
Integers[2] := 0; //Break After? (mins) 0 = dont break
Integers[3] := 0; //Break For? (mins) + Random(60000);
Integers[4] := 0; //Only set if (Booleans[2] = true) When you get this many coins it will bank them all =)
Booleans[1] := False; //Force LowAlch
Booleans[2] := False; //Bank when coins >= Integers[4]
BoxRewards := ['amp', 'mote', 'ostume', 'oins', 'unes', 're', 'ems'];
Active := True;
end;
{with Players[1] do
begin
Name := '';
Pass := '';
Nick := '';
Strings[1] := 'Magic'; // Lampskill
Strings[2] := 'N'; //Run Direction incase of Fight, can be 'N', 'E', 'S', 'W' or an angle in degrees (145, 93, 180, etc).
Integers[1] := 1; // Loads to Do?
Integers[2] := 0; //Break After? (mins) 0 = dont break
Integers[3] := 0; //Break For? (mins) + Random(60000);
Integers[4] := 0; //Only set if (Booleans[2] = true) When you get this many coins it will bank them all =)
Booleans[1] := False; //Force LowAlch
Booleans[2] := False; //Bank when coins >= Integers[4]
BoxRewards := ['amp', 'mote', 'ostume', 'oins', 'unes', 're', 'ems'];
Active := True;
end;}
end;
{###############################################################################
### SCRIPT BELOW THIS POINT ###
###############################################################################}
const
Version = '0.2';
UURL = 'http://dgspc.freehostia.com/DgsAlcher.simb.ver';
FourmURL = 'http://villavu.com/forum/showthread.php?p=689750';
{*******************************************************************************
Var and Const
By: Dgby714 and more =)
Description: Varibles and Constistants LOL cant Spell
*******************************************************************************}
var
Stats_UserID, Stats_Password, Stats_ScriptID: string;
{$IFNDEF SIMBA}SVersion: string;{$ENDIF}
Stats_LastTime: Integer;
Stats_GlobalVars: array[1..24] of Integer;
Stats_CustomVars: array [1..20] of Integer;
const
Stats_Link = 'http://scriptmanager.freehostia.com/submit.php';
{$IFDEF SIMBA}
{*******************************************************************************
function Implode(Glue : string; Pieces : TStringArray) : string;
Description: srl_Implode
*******************************************************************************}
function Implode(Glue : string; Pieces : TStringArray) : string;
begin
Result := srl_Implode(Pieces, Glue);
end;
{*******************************************************************************
function Explode(str, del: string): TStringArray;
Description: srl_Explode
*******************************************************************************}
function Explode(str, del: string): TStringArray;
begin
Result := srl_Explode(str, del);
end;
{$ENDIF}
{*******************************************************************************
procedure WriteLnEx( str: string );
By: Dgby714
Description: Adds [TheTime] to the beggining of WriteLn
*******************************************************************************}
procedure WriteLnEx( str: string );
begin
WriteLn('[' + TheTime + '] ' + str);
end;
{*******************************************************************************
procedure Report( str: string );
By: Dgby714
Description: Does Disguise, Status, and WriteLnEx all in one
*******************************************************************************}
procedure Report( str: string );
begin
{$IFNDEF SIMBA}
Disguise(str);
Status(str);
{$ENDIF}
WriteLnEx(str);
end;
{*******************************************************************************
procedure Stats_CheckOutput(s: string);
By: ???
Description: ???
*******************************************************************************}
procedure Stats_CheckOutput(s: string);
var
i: Integer;
sa: TStringArray;
begin
sa := Explode(#10, s);
for i := 0 to High(sa) do
if (Trim(sa[i]) <> '') then
if StartsWith('ERROR(1)', sa[i]) then
begin
WriteLn('STATS: "' + sa[i] + '"');
Stats_UserID := '';
Stats_Password := '';
end
else if StartsWith('ERROR(2)', sa[i]) then
begin
WriteLn('STATS: "' + sa[i] + '"');
Stats_ScriptID := '';
end
else
WriteLn('STATS: "' + sa[i] + '"');
end;
{*******************************************************************************
function Stats_GetScriptInfo(out Version, News, Link: string; out OutDated: Boolean; out LastUpdate_HoursAgo: Integer): Boolean;
By: ???
Description: ???
*******************************************************************************}
function Stats_GetScriptInfo(out Version, News, Link: string; out OutDated: Boolean; out LastUpdate_HoursAgo: Integer): Boolean;
var
Client: Integer;
s: string;
sa: TStringArray;
begin
Result := False;
if (Stats_ScriptID = '') then
Exit;
Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
AddPostVariable(Client, 'do', 'getinfo');
AddPostVariable (Client, 'sID', Stats_ScriptID);
s := PostHTTPPageEx(Client, Stats_Link);
sa := Explode(#10'GLUE'#10, s);
if (Length(sa) = 5) then
begin
Result := True;
Version := sa[0];
News := sa[1];
Link := sa[2];
OutDated := sa[3] = '1';
LastUpdate_HoursAgo := StrToIntDef(sa[4], -1);
end
else
Stats_CheckOutput(s);
FreeHTTPClient(Client );
end;
{*******************************************************************************
procedure Stats_SendReport;
By: ???
Description: ???
*******************************************************************************}
procedure Stats_SendReport;
var
i, Client, Time: Integer;
s: string;
begin
if (Stats_UserID = '') and (Stats_Password = '') and (Stats_ScriptID = '') then
Exit;
Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
AddPostVariable(Client, 'do', 'submit');
Time := (GetTimeRunning - Stats_LastTime) div 1000 div 60;
if (Time < 5) then
Time := 0
else
Stats_LastTime := GetTimeRunning;
AddPostVariable(Client, 'sTime', IntToStr(Time));
if (Stats_UserID <> '') and (Stats_Password <> '') then
begin
AddPostVariable(Client, 'uID', Stats_UserID);
AddPostVariable(Client, 'uPass', Stats_Password);
end
else
begin
AddPostVariable(Client, 'uID', '-1');
AddPostVariable(Client, 'uPass', '');
end;
if (Stats_ScriptID <> '') then
begin
AddPostVariable (Client, 'sID', Stats_ScriptID);
for i := Low(Stats_CustomVars) to High(Stats_CustomVars) do
begin
AddPostVariable(Client, 'rndCustom' + IntToStr(i), IntToStr(Stats_CustomVars[i]));
Stats_CustomVars[i] := 0;
end;
end
else
begin
AddPostVariable (Client, 'sID', '-1');
end;
for i := Low(Stats_GlobalVars) to High(Stats_GlobalVars) do
begin
case i of
1: s := IntToStr(SRL_Logs - Stats_GlobalVars[i]);
2: s := IntToStr(Banks - Stats_GlobalVars[i]);
3: s := IntToStr(RandSolved[rand_Death] - Stats_GlobalVars[i]);
else if ((i - 3) < Length(RandSolved) - 1 {for Death}) then
s := IntToStr(RandSolved[i - 3] - Stats_GlobalVars[i]);
end;
AddPostVariable(Client, 'rndGlobal' + IntToStr(i), s);
Stats_GlobalVars[i] := Stats_GlobalVars[i] + StrToInt(s);
end;
s := PostHTTPPageEx(Client, Stats_Link);
Stats_CheckOutput(s);
FreeHTTPClient(Client);
if (SRL_Procs[srl_OnSendStats] <> nil) then
SRL_Procs[srl_OnSendStats]();
end;
{*******************************************************************************
procedure Stats_SendAccountInfo;
By: ???
Description: ???
*******************************************************************************}
procedure Stats_SendAccountInfo;
var
i, Client: Integer;
Accounts: TStringArray;
begin
if (Stats_UserID = '') and (Stats_Password = '') then
Exit;
Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
AddPostVariable(Client, 'do', 'setaccounts');
AddPostVariable(Client, 'uID', Stats_UserID);
AddPostVariable(Client, 'uPass', Stats_Password);
if (Stats_ScriptID <> '') then
AddPostVariable (Client, 'sID', Stats_ScriptID)
else
AddPostVariable (Client, 'sID', '-1');
SetLength(Accounts, HowManyPlayers);
for i := 0 to HowManyPlayers - 1 do
Accounts[i] := implode('.|€stat€|.', [Players[i].Name, Players[i].Loc, IntToStr(Integer(Players[i].Active))]);
AddPostVariable(Client, 'accInfo', Implode(#10'ACC'#10, Accounts));
Stats_CheckOutput(PostHTTPPageEx(Client, Stats_Link));
FreeHTTPClient(Client);
end;
{*******************************************************************************
procedure Stats_ManageAccounts;
By: ???
Description: ???
*******************************************************************************}
procedure Stats_ManageAccounts;
var
i, ii, Client: Integer;
s: string;
Accounts, Stats: TStringArray;
begin
if (Stats_UserID = '') and (Stats_Password = '') then
Exit;
Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
AddPostVariable(Client, 'do', 'getaccounts');
AddPostVariable(Client, 'uID', Stats_UserID);
AddPostVariable(Client, 'uPass', Stats_Password);
AddPostVariable (Client, 'sID', '-1');
s := PostHTTPPageEx(Client, Stats_Link);
Accounts := Explode(#10'ACC'#10, s);
for i := 0 to High(Accounts) do
begin
Stats := Explode('.|€stat€|.', Accounts[i]);
if (Length(Stats) = 3) then
begin
for ii := 0 to HowManyPlayers - 1 do
if (LowerCase(Players[ii].Name) = LowerCase(Stats[0])) then
begin
Players[ii].Loc := Stats[1];
Players[ii].Active := Stats[2] = '1';
Break;
end;
end
else
begin
Stats_CheckOutput(s);
Break;
end;
end;
FreeHTTPClient(Client);
stats_SendAccountInfo;
end;
{*******************************************************************************
procedure CFU;
By: Dgby714
Description: Checks if you have the latest Script!
*******************************************************************************}
procedure CFU;
var
CVersion, LVersion: extended;
begin
CVersion := StrToFloat(Version);
LVersion := StrToFloat(GetPage(UURL));
if (LVersion > CVersion) then
Report('Update Available visit ' + FourmURL + '!')
else
Report('You are using the latest version of DGsAlcher!');
end;
{*******************************************************************************
procedure AntiRandoms;
By: ???
Description: Generic AntiRandoms
*******************************************************************************}
procedure AntiRandoms;
begin
if not LoggedIn then
srl_Warn('MainLoop', 'Character not Logged In!!', warn_AllVersions);
LampSkill := Players[CurrentPlayer].Strings[2];
FindNormalRandoms;
if FindFight then
begin
srl_Warn('AntiRandoms', Players[CurrentPlayer].Name + ' was Attacked!', warn_AllVersions);
RunAway(Players[CurrentPlayer].Strings[3], True, 1, 1000+Random(500));
end;
if (InChat('What is your level in: Magic?')) then
begin
QCSayLevel('Magic');
end;
end;
{*******************************************************************************
procedure AntiBan;
By: ???
Description: Generic AntiBan
*******************************************************************************}
procedure AntiBan;
begin
case Random(60) of
0: RandomRClick;
1: HoverSkill('Magic', False);
2: PickUpMouse;
3: RandomMovement;
4: BoredHuman;
5: ExamineInv;
end;
end;
{*******************************************************************************
function Space( num: integer ): string;
By: Dgby714
Description: Returns num spaces
*******************************************************************************}
function Space( num: integer ): string;
var
Text: string;
I: Integer;
begin
for I := 0 to Num do
Text := Text + ' ';
Result := Text;
end;
{*******************************************************************************
procedure Banner;
By: Dgby714
Description: My Banner =) (ToDo: Fix when ReplaceDebugLine comes out!)
*******************************************************************************}
procedure Banner;
var
ScriptName: string;
ConvertLength: integer;
begin
ScriptName := 'Dgby714''s Alcher ' + Trim(Version);
ConvertLength := Floor((66 - Length(ScriptName)) / 2);
ScriptName := Space(ConvertLength) + ScriptName + Space(ConvertLength);
{$IFDEF SIMBA}
ClearDebug;
WriteLn('|--------------------------------------------------------------------|');
WriteLn('| |');
WriteLn('| \______ \ ____\_ |__ ___.__.\______ \/_ | / | | |');
WriteLn('| |');
WriteLn('| |');
WriteLn('| |');
WriteLn('| |');
WriteLn('|--------------------------------------------------------------------|');
WriteLn('|' + ScriptName + '|');
WriteLn('|--------------------------------------------------------------------|');
Wait(Random(500));
ClearDebug;
WriteLn('|--------------------------------------------------------------------|');
WriteLn('| |');
WriteLn('| \______ \ ____\_ |__ ___.__.\______ \/_ | / | | |');
WriteLn('| |');
WriteLn('| | ` \/ /_/ > \_\ \___ | / / | / ^ / |');
WriteLn('| |');
WriteLn('| |');
WriteLn('|--------------------------------------------------------------------|');
WriteLn('|' + ScriptName + '|');
WriteLn('|--------------------------------------------------------------------|');
Wait(Random(500));
ClearDebug;
WriteLn('|--------------------------------------------------------------------|');
WriteLn('| |');
WriteLn('| \______ \ ____\_ |__ ___.__.\______ \/_ | / | | |');
WriteLn('| |');
WriteLn('| | ` \/ /_/ > \_\ \___ | / / | / ^ / |');
WriteLn('| |');
WriteLn('| \//_____/ \/\/ |__| |');
WriteLn('|--------------------------------------------------------------------|');
WriteLn('|' + ScriptName + '|');
WriteLn('|--------------------------------------------------------------------|');
Wait(Random(500));
ClearDebug;
WriteLn('|--------------------------------------------------------------------|');
WriteLn('| ________ ___. _________ ____ _____ |');
WriteLn('| \______ \ ____\_ |__ ___.__.\______ \/_ | / | | |');
WriteLn('| |');
WriteLn('| | ` \/ /_/ > \_\ \___ | / / | / ^ / |');
WriteLn('| |');
WriteLn('| \//_____/ \/\/ |__| |');
WriteLn('|--------------------------------------------------------------------|');
WriteLn('|' + ScriptName + '|');
WriteLn('|--------------------------------------------------------------------|');
Wait(Random(500));
ClearDebug;
WriteLn('|--------------------------------------------------------------------|');
WriteLn('| ________ ___. _________ ____ _____ |');
WriteLn('| \______ \ ____\_ |__ ___.__.\______ \/_ | / | | |');
WriteLn('| | | \ / ___\| __ < | | / / | |/ | |_ |');
WriteLn('| | ` \/ /_/ > \_\ \___ | / / | / ^ / |');
WriteLn('| |');
WriteLn('| \//_____/ \/\/ |__| |');
WriteLn('|--------------------------------------------------------------------|');
WriteLn('|' + ScriptName + '|');
WriteLn('|--------------------------------------------------------------------|');
Wait(Random(500));
ClearDebug;
WriteLn('|--------------------------------------------------------------------|');
WriteLn('| ________ ___. _________ ____ _____ |');
WriteLn('| \______ \ ____\_ |__ ___.__.\______ \/_ | / | | |');
WriteLn('| | | \ / ___\| __ < | | / / | |/ | |_ |');
WriteLn('| | ` \/ /_/ > \_\ \___ | / / | / ^ / |');
WriteLn('| /_______ /\___ /|___ / ____| /____/ |___\____ | |');
WriteLn('| \//_____/ \/\/ |__| |');
WriteLn('|--------------------------------------------------------------------|');
WriteLn('|' + ScriptName + '|');
WriteLn('|--------------------------------------------------------------------|');
Wait(Random(500));
{$ELSE}
ClearDebug;
WriteLn('|--------------------------------------------------------------------|');
WriteLn('| |');
WriteLn('| |');
WriteLn('| |');
WriteLn('| |');
WriteLn('| |');
WriteLn('| |');
WriteLn('|--------------------------------------------------------------------|');
WriteLn('|' + ScriptName + '|');
WriteLn('|--------------------------------------------------------------------|');
Wait(Random(500));
ReplaceDebugLine(2, '| \______ \ ____\_ |__ ___.__.\______ \/_ | / | | |');
Wait(Random(500));
ReplaceDebugLine(4, '| | ` \/ /_/ > \_\ \___ | / / | / ^ / |');
Wait(Random(500));
ReplaceDebugLine(6, '| \//_____/ \/\/ |__| |');
Wait(Random(500));
ReplaceDebugLine(1, '| ________ ___. _________ ____ _____ |');
Wait(Random(500));
ReplaceDebugLine(3, '| | | \ / ___\| __ < | | / / | |/ | |_ |');
Wait(Random(500));
ReplaceDebugLine(5, '| /_______ /\___ /|___ / ____| /____/ |___\____ | |');
{$ENDIF}
end;
{*******************************************************************************
procedure ProgressReport(Clear: boolean);
By: Dgby714
Description: Simple...
*******************************************************************************}
procedure ProgressReport(Clear: boolean);
begin
if Clear then
ClearDebug;
SRLPlayerReport(ResultDebugBox, Skill_Mage, False,
[True, False, True, False, False, False],
['Alchs Done', 'Alchs Left', 'Item Alched', 'Alch Used'],
[], [50, 51], [50, 51], []);
end;
{*******************************************************************************
function FindAndClickAlch(str: string): boolean;
By: Dgby714
Description: Clicks High/Low Alch =)
*******************************************************************************}
function FindAndClickAlch(str: string): boolean;
var
Alch, GrayAlch, x, y, Tries: integer;
Clicked: boolean;
begin
Clicked := false;
Tries := 0;
if not (GetCurrentTab = tab_Magic) then
if not GameTab(tab_Magic) then
Exit;
case str of
'High':begin
Alch := BitmapFromString(20, 3, 'beNrTZX11J+TjPp6LuySa4' +
'tg0mZnuffkNF+ktZkUTWTmRHygIURlx+CtQ8NACASDK9mEB' +
'ikCU4RIB6gLqhYgD9cJNg6vEI4Kslx8A+OhLcQ==');
GrayAlch := BitmapFromString(20, 3, 'beNpjYYgM8vJ0sgIiL' +
'RVpJgaGlIQoqIgzhoiTlZWJtpG2MkTcydrIz90eSAKRkrQwUA' +
'SiDE0ErkZNQRyoESIO5LrbmwFNg4sAVbrbm2OIQNWoK0jAxbk' +
'BhZ0gkg==');
end;
'Low':begin
Alch := BitmapFromString(13, 3, 'beNo7/PXVnZCLuySAaOVEf' +
'kYGBnYhNn4/diCS2cQER3pVkkAFhxYIANU0xbFBlIFU6rIiI4' +
'4iVrgaCIIaiKosAgDgdhu8');
GrayAlch := BitmapFromString(13, 3, 'beNqzNgr0cvJ0sgIiK' +
'xNtJgYGIBLiYZYS5tZSkTY30ACSQKSuIAFU4GRtBFQDZEOUAR' +
'E3CwoC6oKogWiBq0RT5gQAaYUL6Q==');
end;
end;
repeat
if FindBitmapToleranceIn(Alch, x, y, MIX1, MIY1, MIX2, MIY2, 10) then
begin
Clicked := True;
Mouse(x, y, 5, 5, True);
end else
begin
if FindBitmapToleranceIn(GrayAlch, x, y, MIX1, MIY1, MIX2, MIY2, 10) then
begin
srl_Warn('FindAndClickAlch', 'Out of Runes!!!', warn_AllVersions);
Break;
end else
Inc(Tries);
end;
until((Clicked = True) or (Tries >= 5));
FreeBitmap(Alch);
FreeBitmap(GrayAlch);
Result := Clicked;
end;
{*******************************************************************************
procedure FindAndClickNotedItem;
By: Dgby714
Description: Clicks a Noted Item =)
*******************************************************************************}
procedure FindAndClickNotedItem;
var
NoteDTM, x, y, Tries: integer;
Clicked: boolean;
begin
if not (GetCurrentTab = tab_Inv) then
if not GameTab(tab_Inv) then
Exit;
NoteDTM := DTMFromString('78DA63DCC8CCC050C9C4800C26B52631FC07D' +
'28C40FC1F08185703D5B4A3AA61606062E082AA0101C61D4035DD' +
'04D41C05AA6924A0E618504D2D01358709DB050066470E51');
Tries := 0;
repeat
if FindDTM(NoteDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Clicked := True;
Mouse(x, y, 5, 5, True);
end else
Inc(Tries);
until((Clicked = True) or (Tries >= 5));
FreeDTM(NoteDTM);
end;
{*******************************************************************************
function BankMyCoins: boolean;
By: Dgby714
Description: Find/Opens a Bank and Deposits all Coins
*******************************************************************************}
function BankMyCoins: boolean;
var
CoinSlot, cx, cy: integer;
Coins: TInvenItem;
begin
FindCoins(cx, cy, 'inv');
CoinSlot := CoordsToItem(cx, cy);
Coins := GetInven(CoinSlot);
if (Coins.Count >= Players[CurrentPlayer].Integers[4]) then
begin
if OpenBank(Players[CurrentPlayer].Strings[3], False, False) then
begin
Wait(100+Random(250));
Deposit(CoinSlot, CoinSlot, True);
Report(IntToStr(Coins.Count) + ' coins banked!');
Wait(100+Random(250));
if CloseBank then
Result := true
else
srl_Warn('MainLoop', 'Can''t close the Bank.', warn_AllVersions);
end else
srl_Warn('MainLoop', 'Can''t open the Bank.', warn_AllVersions);
end;
end;
{*******************************************************************************
procedure MainLoop;
By: Dgby714
Description: My MainLoop
*******************************************************************************}
procedure MainLoop;
var
StartTime, BreakTime: integer;
begin
if not LoggedIn then
srl_Warn('MainLoop', 'Character not Logged In!!', warn_Terminate);
if ((Players[CurrentPlayer].Level[Skill_Mage] <= 54) or
(Players[CurrentPlayer].Booleans[1])) then
Players[CurrentPlayer].Strings[51] := 'Low'
else
Players[CurrentPlayer].Strings[51] := 'High';
StartTime := GetTickCount;
Stats_CustomVars[1] := 0;
repeat
if FindAndClickAlch(Players[CurrentPlayer].Strings[51]) then
begin
Wait(600+Random(100));
FindAndClickNotedItem;
Wait((500+Random(100))*RandomRange(2, 4));
AntiRandoms;
AntiBan;
Inc(Players[CurrentPlayer].Integers[50]);
Players[CurrentPlayer].Integers[51] := Players[CurrentPlayer].Integers[1] - Players[CurrentPlayer].Integers[50];
Inc(Stats_CustomVars[1]);
end;
ProgressReport(True);
if (Players[CurrentPlayer].Booleans[2]) then
begin
if not BankMyCoins then
Report('Problem Banking Coins!');
end;
if (((((GetTickCount - StartTime) / 1000) * 60) >= Players[CurrentPlayer].Integers[2]) and not (Players[CurrentPlayer].Integers[2] = 0)) then
begin
if LoggedIn then Logout;
BreakTime := (Players[CurrentPlayer].Integers[3] * 60 * 1000) + Random(60000);
Wait(BreakTime);
if not LoggedIn then LoginPlayer;
StartTime := GetTickCount;
end;
until(Players[CurrentPlayer].Integers[50] >= Players[CurrentPlayer].Integers[1]);
SRLRandomsReport;
Stats_SendReport;
Stats_ManageAccounts;
end;
{*******************************************************************************
procedure ScriptTerminate;
By: Dgby714
Description: My ScriptTerminate
*******************************************************************************}
procedure ScriptTerminate;
begin
ProgressReport(False);
{$IFNDEF SIMBA}
SVersion := IntToStr(GetSCARVersion);
insert('.', SVersion, 2);
Disguise('Script Finished - SCAR ' + SVersion + ' by Freddy1990');
{$ENDIF}
FreeSRLBitmaps;
end;
begin
Banner;
CFU;
{$IFNDEF SIMBA}
if not (GetSCARVersion = 323) then
begin
srl_Warn('Main', 'Your using a older version of SCAR then recommended!', warn_AllVersions);
Wait(1000);
end;
{$ENDIF}
if (SServer = 0) then
Smart_Server := RandomWorld(Smart_Members, False)
else
Smart_Server := SServer;
Smart_Signed := SSigned;
Smart_SuperDetail := False;
SetupSRL;
Stats_ScriptID := '37';
Stats_UserID := SRLStatsID;
Stats_Password := SRLStatsPass;
SRLRandomsReport;
Stats_SendReport;
Stats_ManageAccounts;
DeclarePlayers;
repeat
if not LoggedIn then
LoginPlayer;
if (SRL_Logs < 1) then
SRL_Logs := 1;
Players[CurrentPlayer].Integers[50] := 0;//Temp (Alchs Done)
Players[CurrentPlayer].Integers[51] := 0;//Temp (Alchs Left)
Players[CurrentPlayer].Strings[50] := '';//Temp (Item Alched)
Players[CurrentPlayer].Strings[51] := '';//Temp (Alch Type)
Players[CurrentPlayer].Level[Skill_Mage] := GetSkillLevel(Skill_Mage);
if (Players[CurrentPlayer].Level[Skill_Mage] >= 21) then
MainLoop
else
srl_Warn('Main', Players[CurrentPlayer].Name + '''s Magic Level is too Low!', warn_AllVersions);
if LoggedIn then
Logout;
if (Players[CurrentPlayer].Integers[51] <= 0) then
NextPlayer(False)
else
NextPlayer(True);
until(AllPlayersInactive);
ProgressReport(True);
end.
Thoughts?
~RM