SonOfSheep
2007-03-10 22:49:48
<!– BEGIN TEMPLATE: formanswers –>
SonOfSheep - SRL Member Application Form
SonOfSheep
What is the meaning to life?
Where you Referred to SRL? If yes, by whom?
no
Programming Knowledge
PHP, Delphi, Visual basic, C#, a little c++ (but i like c# the most)
Other Communitys
I was a member on kaitniek's forum for a looooong time.
How Long have You Played Runescape
i started 2 days after halloween event with scythes (pissed me off, i wanted a scythe)
Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.
Hi, none of you probably know me, but i used to use kaitnieks forums. My name on there was programmingps7man (how uncreative). I have come a long way since my scripting days then, i have learned alot about programming in specific languages but once you know a few they all seem to come real easy. You stop learning languages and start learning programming. I have been programming since i was 11. I am 15 now and i don't really play on my main much. If i feel like playing a game I play World of warcraft or halo if I feel like auto-aim owning idiots. When I first started scripting with scar, odie5533 was my hero. I learn alot from looking at people's scripts and then I think how I could improve it. Sometimes I like to program just for the sake of programming. I find programming in any language, including scar scripting, to be enjoyable. Logical problem solving is one of my strong points, and I think that I will be able to make some very good scripts in the future. (i just need some motivation and an idea, or i get bored fast) My motivation for my Oak Annihilator script was that my friend said he'd give me $50 for 20k oaks for his fletching. It works really good. I cut over 30k oaks total with it. I do not have that much experience with SRL, my only noteworthy scar script that uses SRL is my Oak Annihilator, which like 5 people commented on. I added forms in an attempt to mabey get some leechers to reply with something like "hey it works!". It basically chops and banks oak trees in draynor.
——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted
Put axe in first inventory spot or wielded. Setup bank so that in the first slot is your best axe, second slot is second best axes etc. I have a stack of addy in my first bank spot, mithril in second, and steel in third.
I find that it isn't as organised as I would like it to be, but about halfway through it's original version i started to get into a rythm and made a scar shortkeys app in c# with shortcuts for things like begin .. end and if then. (I would post it but i'm not sure where to put it.)
<!– END TEMPLATE: formanswers –>
SonOfSheep - SRL Member Application Form
SonOfSheep
What is the meaning to life?
Where you Referred to SRL? If yes, by whom?
no
Programming Knowledge
PHP, Delphi, Visual basic, C#, a little c++ (but i like c# the most)
Other Communitys
I was a member on kaitniek's forum for a looooong time.
How Long have You Played Runescape
i started 2 days after halloween event with scythes (pissed me off, i wanted a scythe)
Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.
Hi, none of you probably know me, but i used to use kaitnieks forums. My name on there was programmingps7man (how uncreative). I have come a long way since my scripting days then, i have learned alot about programming in specific languages but once you know a few they all seem to come real easy. You stop learning languages and start learning programming. I have been programming since i was 11. I am 15 now and i don't really play on my main much. If i feel like playing a game I play World of warcraft or halo if I feel like auto-aim owning idiots. When I first started scripting with scar, odie5533 was my hero. I learn alot from looking at people's scripts and then I think how I could improve it. Sometimes I like to program just for the sake of programming. I find programming in any language, including scar scripting, to be enjoyable. Logical problem solving is one of my strong points, and I think that I will be able to make some very good scripts in the future. (i just need some motivation and an idea, or i get bored fast) My motivation for my Oak Annihilator script was that my friend said he'd give me $50 for 20k oaks for his fletching. It works really good. I cut over 30k oaks total with it. I do not have that much experience with SRL, my only noteworthy scar script that uses SRL is my Oak Annihilator, which like 5 people commented on. I added forms in an attempt to mabey get some leechers to reply with something like "hey it works!". It basically chops and banks oak trees in draynor.
——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted
Put axe in first inventory spot or wielded. Setup bank so that in the first slot is your best axe, second slot is second best axes etc. I have a stack of addy in my first bank spot, mithril in second, and steel in third.
I find that it isn't as organised as I would like it to be, but about halfway through it's original version i started to get into a rythm and made a scar shortkeys app in c# with shortcuts for things like begin .. end and if then. (I would post it but i'm not sure where to put it.)
//SonOfSheep's Extreme Oak Annihilation and Bank-ation - a Scar Script-ation\\
{----------------------------------------------------------------------------)
Start in bank or at oak next to bank in Draynor.
Just press run and input as many users as you would like.
Version 2.2 final
Big thanks to Lorax, his find middle of tree procedure makes my
script more natural.
(----------------------------------------------------------------------------}
program OakAnnihilator;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/WoodCutting.scar}
var
success, trys, lostaxes, starttime, oaknotfound : integer;
LastOak : TPoint;
//Middle of tree finder by lorax
function SLFindMiddleOfTree(var ax, ay: Integer; tColor: Integer): Boolean;
var
Count, x1, y1, x2, y2, bCount, aCount: Integer;
arLuminance: array[0..1] of Extended;
Hue, Saturation: Extended;
minwcount, minhcount: integer;
begin
if(ax < 10)then
ax := 10;
if(ay < 10)then
ay := 10;
if(FindColorSpiralTolerance(ax, ay, tColor, ax - 10, ay - 10, ax + 10, ay + 10, 5))and
(LoggedIn)then
begin
for bCount := 0 to 3 do
begin
ColorToHSL(GetColor(ax, ay), Hue, Saturation, arLuminance[1]);
Count := 0;
if(bCount = 2)then
ax := (x2 + x1) div 2;
repeat
arLuminance[0] := arLuminance[1];
case bCount of
0: ColorToHSL(GetColor(ax - Count, ay), Hue, Saturation, arLuminance[1]);
1: ColorToHSL(GetColor(ax + Count, ay), Hue, Saturation, arLuminance[1]);
2: ColorToHSL(GetColor(ax, ay - Count), Hue, Saturation, arLuminance[1]);
3: ColorToHSL(GetColor(ax, ay + Count), Hue, Saturation, arLuminance[1]);
end;
if(Hue > 14)and(Hue < 34)then
begin
if(arLuminance[0] < arLuminance[1] - 1.5)or
(arLuminance[0] > arLuminance[1] + 1.5)then
aCount := 0
else
aCount := aCount + 1;
end else
aCount := aCount + 1;
if(aCount = 3)then
begin
case bCount of
0: x1 := ax - Count + 3;
1: x2 := ax + Count - 3;
2: y1 := ay - Count + 3;
3: y2 := ay + Count - 3;
end;
end;
Count := Count + 1;
until(Count = 60)or(aCount = 3);
if(Count = 60)then
begin
case bCount of
0: x1 := ax - Count;
1: x2 := ax + Count;
2: y1 := ay - Count;
3: y2 := ay + Count;
end;
end;
end;
ay := (y2 + y1) div 2;
if((x2 - x1) * (y2 - y1) >= MinWCount * MinHCount)then
Result := True;
end;
end;
{*************************Beginning of setup form*************************}
//-----------------------------------------------------------------------//
//-----------------------------------------------------------------------//
//-----------------------------------------------------------------------//
var
frmDesign : TForm;
Label1 : TLabel;
Label2 : TLabel;
GroupBox1 : TGroupBox;
Label3 : TLabel;
Label4 : TLabel;
Label5 : TLabel;
lstUsers : TListBox;
btnAdd : TButton;
btnDelete : TButton;
txtUsername : TEdit;
txtPass : TEdit;
txtNick : TEdit;
ckbWield : TCheckBox;
btnHelp : TButton;
btnGo : TButton;
UserIndex : Integer;
//this is from the srl Users include.
//i fixed it because it was messed up!
{ it used to say
if (FormOption[0]) then
WriteFileString(charsfile, 'loc' + IntToStr(f) + '=' +
--> players[CURRENTPLAYER].loc + Chr(13))
i changed currentplayer to f so it didnt save the current player's options
to all players.
}
procedure FixedSaveUs;
var
f, CharsFile: Integer;
begin
if (filename = '') then filename := 'chars'
CharsFile := RewriteFile(AppPath + FileName + '.dat', False)
for f := 0 to GetArrayLength(players) - 1 do
begin
WriteFileString(charsfile, 'name' + IntToStr(f) + '=' + players[f].name +
Chr(13))
WriteFileString(charsfile, 'pass' + IntToStr(f) + '=' + players[f].pass
+ Chr(13))
WriteFileString(charsfile, 'nick' + IntToStr(f) + '=' + players[f].nick
+ Chr(13))
WriteFileString(charsfile, 'active' + IntToStr(f) + '=' +
BoolToStr(players[f].active) + Chr(13))
if (FormOption[0]) then
WriteFileString(charsfile, 'loc' + IntToStr(f) + '=' +
players[f].loc + Chr(13))
if (FormOption[1]) then
WriteFileString(charsfile, 'skill' + IntToStr(f) + '=' +
players[f].skill + Chr(13))
if (FormOption[2]) then
WriteFileString(charsfile, 'waittime' + IntToStr(f) + '=' +
IntToStr(players[f].waittime) + Chr(13))
if (FormOption[3]) then
WriteFileString(charsfile, 'fight' + IntToStr(f) + '=' +
BoolToStr(players[f].fight) + Chr(13))
if (FormOption[4]) then
WriteFileString(charsfile, 'boolean1' + IntToStr(f) + '=' +
BoolToStr(players[f].boolean1) + Chr(13))
if (FormOption[5]) then
WriteFileString(charsfile, 'boolean2' + IntToStr(f) + '=' +
BoolToStr(players[f].boolean2) + Chr(13))
if (FormOption[6]) then
WriteFileString(charsfile, 'boolean3' + IntToStr(f) + '=' +
BoolToStr(players[f].boolean3) + Chr(13))
if (FormOption[7]) then
WriteFileString(charsfile, 'integer1' + IntToStr(f) + '='
+ IntToStr(players[f].integer1) + Chr(13))
if (FormOption[8]) then
WriteFileString(charsfile, 'integer2' + IntToStr(f) + '='
+ IntToStr(players[f].integer2) + Chr(13))
if (FormOption[9]) then
WriteFileString(charsfile, 'integer3' + IntToStr(f) +
'=' + IntToStr(players[f].integer3) +
Chr(13))
if (FormOption[10]) then
WriteFileString(charsfile, 'integer4' + IntToStr(f)
+
'=' + IntToStr(players[f].integer4) +
Chr(13))
if (FormOption[11]) then
WriteFileString(charsfile, 'string1' + IntToStr(f)
+ '=' + players[f].string1 + Chr(13))
if (FormOption[12]) then
WriteFileString(charsfile, 'string2' +
IntToStr(f) + '=' +
players[f].string2 + Chr(13))
if (FormOption[13]) then
WriteFileString(charsfile, 'string3' +
IntToStr(f) + '=' +
players[f].string3 + Chr(13))
if (FormOption[14]) then
WriteFileString(charsfile, 'extended1' +
IntToStr(f) + '=' +
FloatToStr(players[f].extended1)
+ Chr(13))
if (FormOption[15]) then
WriteFileString(charsfile, 'extended2' +
IntToStr(f) + '=' +
FloatToStr(players[f].extended2) + Chr(13))
if (FormOption[16]) then
WriteFileString(charsfile, 'extended3' +
IntToStr(f) + '=' +
FloatToStr(players[f].extended3) + Chr(13))
WriteFileString(charsfile, Chr(13))
end;
CloseFile(charsfile)
end;
procedure TellTheNoob(sender :TObject);
begin
GetApplication.MESSAGEBOx('Use 3-4 letters of your username. No capitals.' + chr(13) + chr(10) + 'Example: Username="The Nooblet" Nickname="oobl"','',0);
end;
Procedure LoadSettings;
var i : integer;
begin
FormOption[1] := true;
FormOption[4] := true;
LoadUs;
if HowManyPlayers < 1 then
begin
writeln('No players file. Creating new one.');
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
Players[0].Name := 'NewPlayer';
FixedSaveUs;
end;
LoadUs;
lstUsers.CLEAR;
for i := 0 to HowManyPlayers - 1 do
begin
Players[i].Active:=True;
Players[i].skill:='Woodcutting';
lstUsers.ITEMS.Add(inttostr(i+1) + ': ' + Players[i].Name);
end;
end;
Procedure DelPlayer(sender : TObject);
var i : integer;
begin
if getarraylength(players) = 1 then
begin
Writeln('You only have 1 player!')
exit;
end;
if getarraylength(players) < 1 then
begin
setarraylength(players,1);
exit;
end;
for i := UserIndex to getarraylength(players) - 2 do
players[i] := players[i+1];
setarraylength(players, getarraylength(players) - 1);
FixedSaveUs;
LoadSettings;
UserIndex :=0
lstUsers.ITEMINDEX := 0
FixedSaveUs;
if(lstUsers.ITEMINDEX >= 0) and (lstUsers.ITEMINDEX < getarraylength(Players))then
begin
UserIndex := lstUsers.ITEMINDEX;
ckbWield.Checked := Players[UserIndex].Boolean1;
txtUsername.Text:=Players[UserIndex].Name;
txtPass.Text:=Players[UserIndex].Pass;
txtNick.Text:=Players[UserIndex].Nick;
end;
end;
procedure SelectUser(sender : TObject);
begin
FixedSaveUs;
if(lstUsers.ITEMINDEX >= 0) and (lstUsers.ITEMINDEX < getarraylength(Players))then
begin
UserIndex := lstUsers.ITEMINDEX;
ckbWield.Checked := Players[UserIndex].Boolean1;
txtUsername.Text:=Players[UserIndex].Name;
txtPass.Text:=Players[UserIndex].Pass;
txtNick.Text:=Players[UserIndex].Nick;
end;
end;
procedure AddUser(sender : TObject);
begin
SetArrayLength(players, GetArrayLength(players)+1)
Players[GetArrayLength(players)-1].Name := 'NewPlayer';
FixedSaveUs;
LoadSettings;
end;
procedure ValueChanged(sender : TObject);
begin
if sender = txtUsername then
Players[UserIndex].Name := txtUsername.Text;
if sender = txtPass then
Players[UserIndex].Pass := txtPass.Text;
if sender = txtNick then
Players[UserIndex].Nick:= txtNick.Text;
if sender = ckbWield then
Players[UserIndex].Boolean1 := ckbWield.CHECKED;
FixedSaveUs;
LoadSettings;
end;
procedure Start(sender: TObject);
begin
FixedSaveUs;
frmDesign.ModalResult:= mrOk;
end;
procedure SafeInitForm; // Default Code
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('InitForm', v);
end;
procedure ShowFormModal; // Default Code
begin
frmDesign.ShowModal;
end;
procedure SafeShowFormModal; // Default Code
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
Procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 0;
frmDesign.Top := 0;
frmDesign.Width := 597;
frmDesign.Height := 480;
frmDesign.BorderStyle := bsSingle;
frmDesign.Caption := 'Oak Annihilator v2 by SonOfSheep';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.FormStyle := fsStayOnTop;
frmDesign.ShowHint := False;
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
frmDesign.POSITION := poScreenCenter;
Label1 := TLabel.Create(frmDesign);
Label1.Parent := frmDesign;
Label1.Left := 0;
Label1.Top := -2;
Label1.Width := 589;
Label1.Height := 60;
Label1.Alignment := taCenter;
Label1.AutoSize := False;
Label1.Caption := 'Oak Annihilator by SonOfSheep';
Label1.Font.Color := clWindowText;
Label1.Font.Height := -48;
Label1.Font.Name := 'BrushScript BT';
Label1.Font.Style := [];
Label1.ParentFont := False;
Label2 := TLabel.Create(frmDesign);
Label2.Parent := frmDesign;
Label2.Left := 0;
Label2.Top := 69;
Label2.Width := 592;
Label2.Height := 29;
Label2.Alignment := taCenter;
Label2.AutoSize := False;
Label2.Caption := 'v2.2';
Label2.Font.Color := clWindowText;
Label2.Font.Height := -24;
Label2.Font.Name := 'Revue BT';
Label2.Font.Style := [fsBold, fsItalic];
Label2.ParentFont := False;
GroupBox1 := TGroupBox.Create(frmDesign);
GroupBox1.Parent := frmDesign;
GroupBox1.Left := 31;
GroupBox1.Top := 111;
GroupBox1.Width := 532;
GroupBox1.Height := 277;
GroupBox1.Caption := 'User Setup';
GroupBox1.TabOrder := 0;
Label3 := TLabel.Create(GroupBox1);
Label3.Parent := GroupBox1;
Label3.Left := 15;
Label3.Top := 28;
Label3.Width := 51;
Label3.Height := 13;
Label3.Caption := 'Username:';
Label4 := TLabel.Create(GroupBox1);
Label4.Parent := GroupBox1;
Label4.Left := 15;
Label4.Top := 58;
Label4.Width := 49;
Label4.Height := 13;
Label4.Caption := 'Password:';
Label5 := TLabel.Create(GroupBox1);
Label5.Parent := GroupBox1;
Label5.Left := 15;
Label5.Top := 86;
Label5.Width := 51;
Label5.Height := 13;
Label5.Caption := 'Nickname:';
lstUsers := TListBox.Create(GroupBox1);
lstUsers.Parent := GroupBox1;
lstUsers.Left := 353;
lstUsers.Top := 25;
lstUsers.Width := 160;
lstUsers.Height := 211;
lstUsers.ItemHeight := 13;
lstUsers.TabOrder := 0;
lstUsers.ONCLICK := @SelectUser;
btnAdd := TButton.Create(GroupBox1);
btnAdd.Parent := GroupBox1;
btnAdd.Left := 352;
btnAdd.Top := 240;
btnAdd.Width := 75;
btnAdd.Height := 25;
btnAdd.Caption := 'Add';
btnAdd.TabOrder := 1;
btnAdd.OnClick := @AddUser;
btnDelete := TButton.Create(GroupBox1);
btnDelete.Parent := GroupBox1;
btnDelete.Left := 440;
btnDelete.Top := 240;
btnDelete.Width := 75;
btnDelete.Height := 25;
btnDelete.Caption := 'Delete';
btnDelete.TabOrder := 2;
btnDelete.OnClick := @DelPlayer;
txtUsername := TEdit.Create(GroupBox1);
txtUsername.Parent := GroupBox1;
txtUsername.Left := 79;
txtUsername.Top := 25;
txtUsername.Width := 260;
txtUsername.Height := 21;
txtUsername.Font.Color := clWindowText;
txtUsername.Font.Height := -11;
txtUsername.Font.Name := 'MS Sans Serif';
txtUsername.Font.Style := [];
txtUsername.ParentFont := False;
txtUsername.TabOrder := 3;
txtUsername.ONCHANGE := @ValueChanged;
txtPass := TEdit.Create(GroupBox1);
txtPass.Parent := GroupBox1;
txtPass.Left := 80;
txtPass.Top := 55;
txtPass.Width := 260;
txtPass.Height := 21;
txtPass.TabOrder := 4;
txtPass.ONCHANGE := @ValueChanged;
txtNick := TEdit.Create(GroupBox1);
txtNick.Parent := GroupBox1;
txtNick.Left := 80;
txtNick.Top := 85;
txtNick.Width := 238;
txtNick.Height := 21;
txtNick.Font.Color := clWindowText;
txtNick.Font.Height := -11;
txtNick.Font.Name := 'MS Sans Serif';
txtNick.Font.Style := [];
txtNick.ParentFont := False;
txtNick.TabOrder := 5;
txtNick.ONCHANGE := @ValueChanged;
ckbWield := TCheckBox.Create(GroupBox1);
ckbWield.Parent := GroupBox1;
ckbWield.Left := 80;
ckbWield.Top := 115;
ckbWield.Width := 97;
ckbWield.Height := 17;
ckbWield.Caption := 'Wield Axe';
ckbWield.TabOrder := 7;
ckbWield.OnClick := @ValueChanged;
btnHelp := TButton.Create(GroupBox1);
btnHelp.Parent := GroupBox1;
btnHelp.Left := 318;
btnHelp.Top := 84;
btnHelp.Width := 23;
btnHelp.Height := 23;
btnHelp.Caption := '?';
btnHelp.Font.Color := clWindowText;
btnHelp.Font.Height := -11;
btnHelp.Font.Name := 'Arial Narrow';
btnHelp.Font.Style := [fsBold];
btnHelp.ParentFont := False;
btnHelp.TabOrder := 6;
btnHelp.OnClick := @TellTheNoob;
btnGo := TButton.Create(frmDesign);
btnGo.Parent := frmDesign;
btnGo.Left := 414;
btnGo.Top := 394;
btnGo.Width := 150;
btnGo.Height := 47;
btnGo.Caption := 'Go!';
btnGo.Font.Color := clWindowText;
btnGo.Font.Height := -27;
btnGo.Font.Name := 'Arial Black';
btnGo.Font.Style := [fsItalic];
btnGo.ParentFont := False;
btnGo.TabOrder := 9;
btnGo.ONCLICK := @Start;
LoadSettings;
UserIndex := 0;
ckbWield.Checked := Players[UserIndex].Boolean1;
txtUsername.Text:=Players[UserIndex].Name;
txtPass.Text:=Players[UserIndex].Pass;
txtNick.Text:=Players[UserIndex].Nick;
end;
//-----------------------------------------------------------------------//
//-----------------------------------------------------------------------//
//-----------------------------------------------------------------------//
//-----------------------------End of Setup------------------------------//
Procedure SetupPlayers;
begin
SafeInitForm; //show player setup for idiots
SafeShowFormModal; //and lazy people
LoadUs; //just in case
CurrentPlayer := 0 //start at zero
end;
{---------------------------------------------------------------------------------------------}
procedure ProgressReport;
begin
writeln('');
writeln('[---Oak Annihilator by SonOfSheep v 2.20---]');
writeln('[-- Time: ' + ScriptTime2(1));
if trys <> 0 then
writeln('[-- Banked: ' + inttostr(success) + '/' + inttostr(trys) + ' (' + inttostr(round(100 * success / trys)) + '%)');
writeln('[-- Lost ' + inttostr(lostaxes) + ' axes.');
writeln('[------------------------------------------]');
writeln('');
end;
{---------------------------------------------------------------------------------------------}
function AllPlayersLost : boolean;
var
i : integer;
begin
Result := true;
for i := 0 to HowManyPlayers - 1 do
if Players[i].Active then
Result := false
end;
{---------------------------------------------------------------------------------------------}
//so i dont have to type it over n over
function HoldAxe : boolean;
begin
result := Players[CurrentPlayer].Boolean1;
end;
{---------------------------------------------------------------------------------------------}
//all of the functions for next player built into srl didn't work how i
//wanted them to.
procedure SOSNextPlayer;
begin
PlayerCurTime := (GetSystemTime div 1000);
Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked +
((PlayerCurTime - PlayerStartTime) / 60);
CurrentPlayer := CurrentPlayer + 1;
Logout;
if CurrentPlayer >= HowManyPlayers then
CurrentPlayer := 0;
if AllPlayersLost then
begin
ProgressReport;
Writeln('All players are lost. Terminating Script');
TerminateScript;
end;
if getarraylength(players) = 1 then
begin
writeln('Taking a break for a couple minutes.');
Logout;
wait(2 * 60000 + 2 * random(60000));
LoginPlayer;
end
else
begin
while (Players[CurrentPlayer].Active = false)and(not AllPlayersLost) do
begin
CurrentPlayer := CurrentPlayer + 1;
wait(100);
if CurrentPlayer >= HowManyPlayers then
CurrentPlayer := 0;
end;
end;
end;
{-Forward References--------------------------------------------------------------------------}
procedure SetupNextPlayer; forward; //this is later on in the script
procedure AntiRands; forward;
{---------------------------------------------------------------------------------------------}
function CheckAxe : boolean;
var
axemask : integer;
begin
axemask := BitmapFromString(15, 11, 'z78DA33300001371070C52' + '40D2800F84DC06523312EA1DC6DB84CC36532793652D79DA4862D' + 'FD638D166E26DE2FE4A593C1E62A52E30E7FF80300DC24CD96');
GameTab(4);
if HoldAxe then
begin
ClickAllItemsBmpMaskTolWait('ield', axemask, 0, 0, 500 + random(100));
GameTab(5);
end;
Result := FindBitmapMaskTolerance(axemask, x, y, MIX1, MIY1, MIX2, MIY2, 0, 0);
FreeBitmap(axemask);
if ( (not result) and (HoldAxe)) then
begin
GameTab(4);
if InventoryFull then
DropItems(6129060, 0, 1, 'Oak logs');
GameTab(5);
Mouse(581, 291, 20, 20, true);
end;
end;
{---------------------------------------------------------------------------------------------}
procedure CheckUsers;
begin
if not LoggedIn then
begin
if Players[CurrentPlayer].Active Then
begin
LoginPlayer;
end
else
begin
if AllPlayersLost then
begin
ProgressReport;
Writeln('All players are lost. Terminating Script');
TerminateScript;
end;
SetupNextPlayer;
end;
end;
end;
{---------------------------------------------------------------------------------------------}
//Rotate Points (for finding bank a little better)
//Feel free to use this, i found it on the internet
Procedure RotateOrigin(RotAng : Double; x, y : Double; Var Nx, Ny : Double);
Var
SinVal : Double;
CosVal : Double;
Begin
//remove comment if it's used with degrees
//RotAng := RotAng*(PI / 180);
SinVal := Sin(RotAng);
CosVal := Cos(RotAng);
Nx := x * CosVal - y * SinVal;
Ny := y * CosVal + x * SinVal;
End;
Procedure Rotate(RotAng : Double; x, y, ox, oy : Double; Var Nx, Ny : Integer);
var
newX, newY : double;
Begin
RotateOrigin(RotAng, x - ox, y - oy, newx, Newy);
Nx := round(Newx + ox);
Ny := round(Newy + oy);
End;
{---------------------------------------------------------------------------------------------}
//Bankfinding Procedure (i thought it was a really good way)
//Uses a DTM of the 4 bank tellers in draynor bank arranged in a backwards
//L pattern on the minimap. It has 100% accuracy during testing
//also finds bank booth using DTM and then deposits all
Procedure OpenBankSheepStyle;
var
x, y, xs, ys, BankersDTM, BoothDTM, QBankDTM, trytime : integer;
z : extended;
resetcolors, haveaxe : boolean;
Label Retry;
begin
if not LoggedIn then
exit;
Status('Banking');
trys := trys + 1;
BoothDTM := DTMFromString('78DA6364666460A8634001D5B9610C22401A2' + '8C3F01F08185981AC62543556A6A60C1A503520C0F8074814A0AA' + 'F1B7E1809B0356C3C348580D1FA67BEA0A2251D5FC021235A86A5' + 'A4AC231D5B4A3AA494888467533C83DAD686A224251D53001597D' + '04DCFC9381B01A3E22CC6103B2BA08B8E73F90E8C4AF060048511' + 'CE0');
BankersDTM := DTMFromString('78DA630C676260F06540017FFE30318800694' + '61806A909C5AD8601A626928039FE44A80906AA094255931E9FC0' + 'A0816C5728504D1C7E3500D5740EF0');
QBankDTM := DTMFromString('78DA63FCCBC0C070890105FCFFFF1F4C33023' + '11788E603B2AEE15603A69F301056F31C489C23A04601C8BACC80' + '15C0D59803596719D00D4255E38FE9E6D810775435518C187EC73' + '0470BC8BA45C0CD6C44A879C880E1667435001FFF2803');
//I used dtm for quickbank because Popup lagged
Retry : //only way i could think of
MakeCompass('N'); //still works best this way
wait(500 + random(500));
if random(3) = 0 then
SetRun(true);
MarkTime(trytime);
while(not FindDTMRotated(BankersDTM, x, y, 556, 0, 764, 179, 0, 360, 0.5, z)) and (timefrommark(trytime) < 30000) do
begin
if not LoggedIn then
exit;
wait(50)
status('Error, can''t find bank. Resetting minimap to fix this')
case random(2)of
0 : Makecompass('S');
1 : MakeCompass('E');
2 : MakeCompass('W');
end
wait(500 + random(300))
MakeCompass('N');
wait(1000 + random(500));
AntiRands;
end;
if timefrommark(trytime) > 30000 then
begin
if resetcolors then
begin
Players[CurrentPlayer].Active := false;
resetcolors := false;
Logout;
CheckUsers;
ProgressReport;
Writeln('Relogin failed. Player "' + players[currentplayer].Name + '" has been lost.');
CheckUsers;
exit;
end
else
begin //reset minimap colors. They can mess up the DTM
writeln('Attempting Relogin to fix minimap colors.');
resetcolors := true;
Logout;
LoginPlayer;
Goto Retry;
end;
end;
wait(200 + random(200));
Rotate(z, x + 12, y + 10, x, y, xs, ys);
Mouse(xs, ys, 3, 3, true);
makecompass('W');
HighestAngle;
CountFlag(0);
wait(1000 + random(1000));
//I felt like making my own function to open the bank booth in draynor
//it works very well. None of the banking things in srl worked
HaveAxe := CheckAxe;
if findDTMRotated(BoothDTM, x, y, 0, 0, 514, 336, 0, 360, 0.5, z)then
begin
mouse(x, y, 10, 10, false);
wait(500 + random(500));
if findDTM(QBankDTM, x, y, x - 200, y - 200, x + 200, y + 200)then
mouse(x - 20, y - 2, 80, 4, true);
CountFlag(0);
wait(1000 + random(1000));
if not getcolor(249, 40) = 2070783 then
writeln('Found the booth, but couldn''t open!');
status('Found booth successfully');
if not HaveAxe then
begin
lostaxes := lostaxes + 1;
Deposit(1, 28, 2);
Withdraw(1, 1, 1);
end
else
begin
if HoldAxe then
begin
DepositAll;
end
else
begin
Deposit(2, 28, 2);
end;
end;
CloseBank;
success := success + 1
end
else
writeln('Omg error with finding booth!');
if (not HaveAxe) and HoldAxe then
CheckAxe;
//free DTM's
freedtm(BoothDTM);
freedtm(BankersDTM);
freedtm(QBankDTM);
wait(500+random(500));
CloseBank;
wait(1000+random(500));
FindAxeHeadColor;
end;
{---------------------------------------------------------------------------------------------}
//Oak tree location finding procedure
//uses DTM of several trees on the minimap to find the oak next to the bank
function LoadOakDTM(tolerancelevel : integer) : integer;
begin
case tolerancelevel of
1:Result := DTMFromString('78DA635CC1C4C010CB00068C108A4125808D8' +
'10BCAFF0F048CDB816AA270AB018BAF04AAF120A0E618508D2B7E' +
'3500B3D90A33');
2:Result := DTMFromString('78DA635CCCC4C090C400068C108A412E41988' +
'10BCAFF0F048C4B816A7C71AB018B6F00AA8927A0E620508D377E' +
'3500C7850A8F');
3:Result := DTMFromString('78DA635CC1C4C010CB00068C108A4125808D4' +
'104CAFF0F048CDB816AA270AB018BAF04AAF120A0E618508D2B7E' +
'3500BE290A5B');
4:Result := DTMFromString('78DA635CCCC4C090C400068C108A412E41984' +
'104CAFF0F048C4B816A7C71AB018B6F00AA8927A0E620508D377E' +
'3500D1D50AB7');
5:Result := DTMFromString('78DA635CC1C4C010CB00068C108A4125808D4' +
'112CAFF0F048CDB816AA270AB018BAF04AAF120A0E618508D2B7E' +
'3500C3510A6F');
6:Result := DTMFromString('78DA635CCCC4C090C400068C108A412E41984' +
'112CAFF0F048C4B816A7C71AB018B6F00AA8927A0E620508D377E' +
'3500D6FD0ACB');
7:Result := DTMFromString('78DA635CC1C4C010CB00068C108A4125808D4' +
'119CAFF0F048CDB816AA270AB018BAF04AAF120A0E618508D2B7E' +
'3500CDA10A97');
8:Result := DTMFromString('78DA635CCCC4C090C400068C108A412E41984' +
'119CAFF0F048C4B816A7C71AB018B6F00AA8927A0E620508D377E' +
'3500E14D0AF3');
end;
end;
function FindOakDtms(var x, y : integer; whatangle : extended) : boolean;
var
i : integer;
begin
result := false;
for i := 1 to 8 do
begin
if FindDTMRotated(LoadOakDTM(i), x, y, MMX1, MMY1, MMX2, MMY2, 340, 380, 0.5, WhatAngle)then
begin
result := true;
writeln('Found using dtm with a tolerance level of ' + inttostr(i));
break;
end;
wait(150 + random(50));
end;
end;
Procedure WalkToOak;
var
xx, yy, TryTime : integer;
found : boolean;
whatangle : extended;
begin
if not LoggedIn then
exit;
Status('Walking: Bank -> Oak tree');
AntiRands;
wait(500 + random(1000));
makecompass('N');
wait(500 + random(1000));
MarkTime(trytime);
while(not FindOakDtms(xx, yy, WhatAngle)) and (timefrommark(trytime) < 10000) do
begin
if not LoggedIn then
exit;
AntiRands;
wait(50)
status('Error, can''t find oaks. Resetting minimap to fix this');
keydown(VK_LEFT);
wait(random(1000));
keyup(VK_LEFT);
wait(random(1000));
keydown(VK_RIGHT);
wait(random(1000));
keyup(VK_RIGHT);
wait(1100 + random(300))
MakeCompass('N');
wait(500 + random(1000));
end;
if timefrommark(trytime) < 10000 then
found := true;
if not found then
begin
Logout;
ProgressReport;
Writeln('Got lost while trying to find oak tree on map.');
SetupNextPlayer;
exit;
end;
AntiRands;
writeln('Found oaks in ' + inttostr(timefrommark(trytime)) + 'ms.');
Rotate(whatangle, xx + 5, yy, xx, yy, xx, yy);
MouseFindFlag(xx, yy, 1, 1);
CountFlag(0);
end;
{---------------------------------------------------------------------------------------------}
//Antirandoms
Procedure AntiRands;
begin
if FindFight then
begin
OpenBankSheepStyle;
WalkToOak;
end;
if InBlack then
begin
Players[CurrentPlayer].Active := false;
Writeln(Players[CurrentPlayer].Name + ' is stuck in a random event!');
ProgressReport;
SetupNextPlayer;
end;
if FindDead then
begin
Players[CurrentPlayer].Active := false;
Writeln(Players[CurrentPlayer].Name + ' has died!');
ProgressReport;
SetupNextPlayer;
end;
end;
procedure SOSAntiBan;
begin
case random(30) of
0 : FTWait(4+random(2));
1 : FTWait(4+random(2));
2 : HoverEvery(2+random(2),'woodcutting');
3 : FTWait(4+random(2));
4 : HoverEvery(2+random(2),'woodcutting');
5 : FTWait(4+random(2));
6 : FTWait(4+random(2));
7 : HoverEvery(2+random(2),'woodcutting');
8 : FTWait(4+random(2));
9 : MMouse(MSX1-200, MSY1-200, MSX2 +500, MSY2 +500);
10 : FTWait(4+random(2));
11 : FTWait(4+random(2));
12 : HoverEvery(2+random(2),'woodcutting');
13 : FTWait(4+random(2));
14 : FTWait(4+random(2));
15 : FTWait(4+random(2));
16 : FTWait(4+random(2));
17 : FTWait(4+random(2));
18 : FTWait(4+random(2));
19 : FTWait(4+random(2));
20 : HoverEvery(2+random(2),'woodcutting');
else
FTWait(4+random(2))
end;
end;
//-------------------------------------------------------------------------//
{i modified the FindHead by Starblaster and Liquid from the srl woodcutting }
{include file. }
//-------------------------------------------------------------------------//
function SOSFindHead: Boolean;
var
AxeHeadDTM, HandleDTM, Tries, x, y: Integer;
hStart: Boolean;
begin
HandleDTM := DTMFromString('78DA633CC4C0C07098010D302291407A3F903' +
'84940CD76207183809ADD40E22611E6DC23A0661790B88AAAA221' +
'810F550DC84FC7F09B0300318D0BE0');
CheckAxe;
if FindInvDtm(x,y,HandleDTM) then
begin
AxeHeadDTM := DTMFromString('78DA63CC62626078C180021C2312191E02694' +
'620FE0F048C694035CF18D000231209A473816A9E12A1E6150135' +
'A94035AF09A801B9F9090135994498930C54F392809A3CCCF0415' +
'70300FB8311DF');
GameTab(4);
Result := True;
EquipAxe := HoldAxe;
if ((HoldAxe = False) and
not (GetColor(590, 220) = Head) or
not (GetColor(587, 219) = Head2) or
not (GetColor(588, 218) = Head3)) then
hStart := True;
if (HoldAxe) then
begin
GameTab(5);
Wait(200 + Random(200));
if not (GetColor(597, 294) = Head) or
not (GetColor(600, 295) = Head2) or
not (GetColor(599, 298) = Head3) then
begin
hStart := True;
Mouse(592, 297, 2, 2, True);
Wait(1000);
end;
end;
if (hStart = True) then
begin
Result := False;
Tries := 0;
repeat
if not LoggedIn then Exit;
if (FindDTM(AxeHeadDTM, x, y, 550, 200, 745, 465)) then
Break;
if not (FindObjMulti('Take', Head, Head2, Head3, 5)) then
begin
Tries := Tries + 1;
WriteLn('Axe head not found. Taken ' + IntToStr(tries) + ' tries');
Status('Axe Head not found - Rotating Screen');
KeyDown(VK_LEFT);
Wait(1000 + Random(1000));
KeyUp(VK_LEFT);
Wait(400 + Random(300));
if (not FindObjMulti('Take', Head, Head2, Head3, 5)) and (tries < 3) then
begin
Status('Axe Head not found - Moving to Red Dot');
x := 648;
y := 83;
FindColorSpiral(x, y, 241, 627, 58, 669, 100)
Mouse(x + 3, y + 3, 2, 2, True);
Flag;
Wait(500 + Random(300));
end;
end;
if FindObjMulti('Take', Head, Head2, Head3, 5) then
begin
Status('Found Axe Head');
WriteLn('Axe head was found. Picking it up');
Wait(450 + Random(400));
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Flag;
Wait(500 + Random(300));
end;
until (tries > 9) or
(FindDTM(AxeHeadDTM, x, y, 550, 200, 745, 465))
if not (tries > 9) then
if (AttachHead) then
Result := True;
end;
FreeDTM(AxeHeadDTM);
end;
FreeDTM(HandleDTM);
end;
{---------------------------------------------------------------------------------------------}
//determines if a new axe is needed and then gets one
procedure GetNewAxe;
var fullDTM, youDTM, x, y : integer;
begin
fullDTM := DTMFromString('78DA6394666060B8C1C8800DC044196581C44' +
'3026ACC81C403026A3C80C45D026AA288B0AB0848DC21A0661990' +
'B847404D0B116EDE4C8439478830E72890784A40CD3D22FCF50B4' +
'8DC22A0E619116128C048382E841809FB1DA486905D224498A3C4' +
'485C7C5D24A02616485C20A0C607489C27A046970873648950739' +
'008377F02129709A80904B2EE1350934F4418D631124EAB3D8C84' +
'D3611D11E9672AA67B76AF9B84AA460C48BC24600E17236135494' +
'4A8790B642D60C42A8BA2E6117E350055653298');
youDTM := DTMFromString('78DA639462606058C8C8800DC044192580C47' +
'2026AC480C462026A648930471148AC24A0460E48AC22A0468F08' +
'BB3480C40AFC6A00C7E30647');
if (FindDTM(youDTM, x, y, 18, 414, 51, 431)) then
if FindDTM(fullDTM, x ,y, 2, 342, 498, 436) then
if Not CheckAxe then
begin
Writeln('Lost an axe');
Status('finding head or getting new axe');
SendText3(' '); //to make sure it doesnt find it again
if not SOSfindhead then
begin
OpenBankSheepStyle;
WalkToOak;
end;
end;
freedtm(youDTM);
freedtm(fullDTM);
end;
{---------------------------------------------------------------------------------------------}
Function FindTextENT : boolean;
var EntUpTextDTM, EntMenuTextDTM : integer;
ssx, ssy : integer;
begin
EntMenuTextDTM := DTMFromString('78DA639CCCC0C010C88002FEFF87D08C503EE' +
'31420114640CD0C22CC994F84398B8930A70F48F8A1AA890D7147' +
'55D30F242208A85902248209D8351548841350331D530D0CC0D52' +
'C23C2EF4B81843F0173A662FA9D2CF780E23D14BF390054D023D8');
if(FindColorTolerance(ssx, ssy, 65535, 75, 5, 116, 22,30))then
begin
getmousepos(ssx,ssy);
SLFindMiddleOfTree(ssx, ssy, getcolor(ssx, ssy));
if not IsUpTextMulti('hop', 'own', 'hop down') then exit;
Mouse(ssx, ssy, 5, 5, false);
wait(150 + random(100))
if(FindDTM(EntMenuTextDTM, ssx, ssy, MSX1, MSY1, MSX2, MSY2))then
begin
Mouse(647,82,3,3,true);
wait(100+random(100));
result := true;
writeln('Found an ENT');
wait(5000 + random(1000));
if(CheckAxe)then
begin
Writeln('Successfully avoided ENT');
status('waiting for ENT to leave');
FTwait(20+random(10));
end
else
begin
Writeln('Arrgh, too late to find ENT! You broke an axe :(');
OpenBankSheepStyle;
WalkToOak;
end;
end;
end;
end;
//chops oak tree and waits 10 to 20 seconds or until its gone
procedure ChopOak;
var
h, i, j, k, x, y, fx, fy, treecol: integer;
EntDTM: integer;
Found : boolean;
treegone : LongInt;
begin
if not LoggedIn then
exit;
oaknotfound := oaknotfound + 1;
EntDTM := DTMFromString('78DA639CCCC0C010C88002FEFF87D08C503EE' + '31420114640CD0C22CC994F84398B8930A70F48F8A1AA890D7147' + '55D30F242208A85902248209D8351548841350331D530D0CC0D52' + 'C23C2EF4B81843F0173A662FA9D2CF780E23D14BF390054D023D8' + '');
MakeCompass('N'); //must be facing north or could find wrong tree!
//Search small sections of the screen for oak color
//excludes the corner so it SHOULD only chop the one
//next to the bank
Found := false
//find from last point
if findcolorspiral(x, y, 4624512, LastOak.X - 50, LastOak.Y - 50, LastOak.X + 50, LastOak.Y + 50)then
begin //check for oak text
wait(100 + random(200));
SLFindMiddleOfTree(x,y,4624512);
MMouse(x, y, 5, 5);
if IsUpText('Oak')then
begin
found := true;
end;
end;
if not found then
for j := 1 to 8 do
for k := 3 to 10 do
begin
wait(10 + random(20));
if findcolorspiral(x, y, 4624512, 50 * (j - 1) + 5, 33 * (k - 1) + 5, 50 * j + 5, 33 * k + 5)then
begin //check for oak text
wait(100 + random(200));
SLFindMiddleOfTree(x,y,4624512);
MMouse(x, y, 5, 5);
if IsUpText('Oak')then
begin
found := true;
break;
end;
end;
end;
{begin click tree}
begin
fx := x; // Dont want to mess with our x and y values
fy := y;
treecol := getcolor(x, y);
//click or rightclick?
if random(5) > 0 then
begin
if IsUpText('Oak')then
begin
wait(100 + random(300));
MMouse(x, y, 5, 5);
if FindTextENT then exit;
Mouse(x,y,0,0,false);
begin
PopUp('hop down')
end;
end;
end
else
begin
wait(200 + random(500));
if IsUpText('Oak')then
begin
if FindTextENT then exit;
getmousepos(x, y);
HoldMouse(x, y, true);
wait(15 + random(80));
releasemouse(x - 1 + random(2), y - 1 + random(2), true);
end;
end;
CountFlag(0);
//wait 20-25 seconds or until tree is gone
MarkTime(i);
if not found then
status('Attempt number ' + inttostr(oaknotfound) + ' to find oak tree.');
while( (findcolorspiral(x, y, treecol, fx - 5, fy - 5, fx + 5, fy + 5)) and (TimeFromMark(i) < 20000 + random(5000))) and (Found) and (getcolor(719, 444) = 4345174) do
begin
DisguiseScar('[' + ScriptTime2(1) + '] - Oak Annihilator by SonOfSheep');
status('Clicked tree. Waiting for player to finish chopping.');
oaknotfound := 0
LastOak.X := x;
LastOak.Y := y;
GetNewAxe;
if not IsUpTextMulti('own Oak', 'Oak', 'ak') then MMouse(x, y, 5, 5);
if FindTextENT then exit;
SOSAntiBan;
AntiRands;
if random(5) = 0 then //reduce lag from clicktocontinue
clicktocontinue;
end;
if InvFull then
exit;
MarkTime(treegone);
if found then
repeat
status('waiting for tree to respawn');
SOSAntiBan;
until(timefrommark(treegone) > 10500);
end;
FTWait(1 + random(1));
{end click tree}
end;
{---------------------------------------------------------------------------------------------}
procedure SetupNextPlayer;
begin
if AllPlayersLost then
begin
ProgressReport;
writeln('All players have been lost!');
terminatescript;
end;
SOSNextPlayer;
Writeln(Players[CurrentPlayer].Name);
wait(1000 + random(1000));
LoginPlayer;
wait(2000 + random(2000));
SetChat('Friends',1);
SetChat('Off',2);
SetChat('On',3);
HighestAngle;
FindNormalRandoms;
OpenBankSheepStyle;
FindAxeHeadColor;
WalkToOak;
FindNormalRandoms;
FTWait(2 + random(4));
end;
{---------------------------------------------------------------------------------------------}
begin
SetupSRL;
ClearDebug;
SetupPlayers;
LoginPlayer;
wait(1000 + random(1000));
LastOak.X := MSCX;
LastOak.Y := MSCY;
marktime(starttime);
//start from bank
HighestAngle;
FindNormalRandoms;
SetChat('Friends',1);
SetChat('Off',2);
SetChat('On',3);
OpenBankSheepStyle;
WalkToOak;
FindNormalRandoms;
FTWait(2 + random(4));
repeat
repeat //find inventory full
CheckUsers;
if getcolor(636, 176) = 5531511 then
Mouse(652, 176, 15, 10, true);
FTWait(4 + random(2));
FindNormalRandoms;
AntiRands;
ChopOak;
until (InvFull or (oaknotfound > 30))
oaknotfound := 0;
FindNormalRandoms;
OpenBankSheepStyle;
WalkToOak;
FTWait(1 + random(2));
FindNormalRandoms;
progressreport;
until (false);
end.
——————————————————<!– END TEMPLATE: formanswers –>