joerobo
2007-07-26 15:18:04
<!– BEGIN TEMPLATE: formanswers –>
joerobo - SRL Member Application Form
joerobo
What is the meaning to life?
Where you Referred to SRL? If yes, by whom?
no
Programming Knowledge
C++ to an extent
Other Communitys
How Long have You Played Runescape
2 years on and off
Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.
Well… started writing this script for the purpose of raising my woodcutting level only. However I soon realised how rewarding it was to script using SCAR, the logical aproach needed is great and can be somewhat thought provoking. I find the logic easy to work with and very comparable to algerbra in maths. The script I have submitted is my first and only one so far, though I hope to go on to make several more scripts. Though it is a powerchopper I have tried to introduce some originality by designing it to use in a particular area, normally free of level3 bots. As a future script (though i may need to improve my current script first) I would look to do something never done before, because generaly speaking there are far too many scripts which all do the same thing.
As for the script I have submitted, I would hope that you appreciate that it has Anti-Randoms, Anti-Ban, DTM's, Multi-Player (with extra player arrays), fail safes and important for your viewing of the script, Standards! ..I have also used cases to avoid endless if's.
Of course yes votes would be nice :P but just any feedback would be greatly appreciated. Cheers
——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted
——————————————————
<!– END TEMPLATE: formanswers –>
joerobo - SRL Member Application Form
joerobo
What is the meaning to life?
Where you Referred to SRL? If yes, by whom?
no
Programming Knowledge
C++ to an extent
Other Communitys
How Long have You Played Runescape
2 years on and off
Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.
Well… started writing this script for the purpose of raising my woodcutting level only. However I soon realised how rewarding it was to script using SCAR, the logical aproach needed is great and can be somewhat thought provoking. I find the logic easy to work with and very comparable to algerbra in maths. The script I have submitted is my first and only one so far, though I hope to go on to make several more scripts. Though it is a powerchopper I have tried to introduce some originality by designing it to use in a particular area, normally free of level3 bots. As a future script (though i may need to improve my current script first) I would look to do something never done before, because generaly speaking there are far too many scripts which all do the same thing.
As for the script I have submitted, I would hope that you appreciate that it has Anti-Randoms, Anti-Ban, DTM's, Multi-Player (with extra player arrays), fail safes and important for your viewing of the script, Standards! ..I have also used cases to avoid endless if's.
Of course yes votes would be nice :P but just any feedback would be greatly appreciated. Cheers
——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted
program JuicyChops;
{Juicy Chops, a power willow chopper created by joerobo, his first script.
true effort has been made to include credit,
should any credit be missing please let me know
i shall include it asap.
This script is designed to run at the clump of trees found to
the left of the graveyard in WT-Fakawi's RATS script. (south west port sarim)
It uses FindDtm to find this cluster of trees if for some reason it goes off track.
Should you not want to chop in this location (which is nice and quiet),
then set boolean1 to False.
Currently Axe cannot be equiped, i may change this.
All items not to be dropped should be held in the first places in inv.}
const
NoOfLoads = 2; //Loads of Wood to Chop Before Droppin'
Colour1 = 2113592; //Tree Colours, set if you wish
Colour2 = 1718320;
Colour3 = 2177072;
var
Loads, TotalLoads, LogsDropped, Ents : Integer;
AexDTM : Integer;
WillowTreesDTM, WillowTrees2DTM, WillowTrees3DTM : Integer;
Mx, My, Ax, Ay :integer;
t,w : integer;
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\Woodcutting.scar}
procedure DeclarePlayers;
begin
HowManyPlayers := 4;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 3;
Players[0].Name := '';// -Username
Players[0].Pass := '';// -Password
Players[0].Nick := '';
Players[0].Active:=True;// -Active??
Players[0].Integer1 := 2 // -How many items not to drop?
Players[0].String1 := 'rune'; //Type Of Axe (rune, addy, mith, steel)
Players[0].Boolean1 := True; //Are you chopping at designed location?
Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Active:=True;
Players[1].Integer1 := 2
Players[1].String1 := 'rune';
Players[1].Boolean1 := True;
Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active:=False;
Players[2].Integer1 := 2
Players[2].String1 := 'rune';
Players[2].Boolean1 := True;
Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Active:=True;
Players[3].Integer1 := 2
Players[3].String1 := 'rune';
Players[3].Boolean1 := True;
end;
{*******************************************************************************
function FindAxeHeadColor: Boolean;
By: Sumilion
*******************************************************************************}
Procedure FindHeadColour;
var
Ix, Iy :integer;
begin
if LoggedIn then
begin
GameTab(4);
case Players[CurrentPlayer].String1 of
'rune' : AexDTM := DTMFromString('78DA639CCEC4C0F09401051485F1318800694' +
'620FE0F048C4B806AEEA2AA718E4864E082AA0101C6C54035F751' +
'D5D887C6A1AA590A547313558D4B740A8A1A00CFA10E03'); //rune
'addy' : AexDTM := DTMFromString('78DA6374606060686440014D497C0C22409A1' +
'188FF0301A337905187AAC6C6D786810BAA0604187D804415AA1A' +
'7B7F7B5435BE40A21C558D73B0338A1A00C1660AA8'); //addy
'mith' : AexDTM := DTMFromString('78DA633CC4C4C010C0C8800C5A53F81852803' +
'448F43F10309E05AAF14155636111CCC0055503028CE7816A5C51' +
'D5D839C4A2AA3981A9C6C52D0D450D0061FC0C64'); //mith
'steel': AexDTM := DTMFromString('78DA63CC636260D8C3C8800C5A53F81852803' +
'448F43F10305602D5EC4055939B9ACAC0055503028CD540351B51' +
'D594E5E5A2AA29C154D3545989A20600C3BC0E32'); //steel
end;
FindDtm(AexDTM, Ix, Iy, MIX1, MIY1, MIX2, MIY2);
GameTab(4);
if (Ix > 592) or (Iy > 238) then
Drag(Ix, Iy, 5, 5, 579, 227, 5, 5, True);
HeadColor[0] := GetColor(590, 220);
HeadColor[1] := GetColor(587, 219);
HeadColor[2] := GetColor(588, 218);
WriteLn('Axe head colors: ' + IntToStr(HeadColor[0]) + ' ' + IntToStr(HeadColor[1]) + ' ' +
IntToStr(HeadColor[1]));
FreeBitmap(AexDTM);
end;
end;
{*******************************************************************************
function AttachHead: Boolean;
By: Liquid and Starblaster100
*******************************************************************************}
function AttacHead: Boolean;
var
AxeHandleDTM, AxeHeadDTM: Integer;
begin
AxeHandleDTM := DTMFromString('78DA637465626078C48002CA2379191E02694' +
'620FE0F048C0E40352F19D000231209A4ED806A3E1150E30454F3' +
'86801A2FA09AEB04D47800D5DC23A0C616A8E61D01358E4035EF0' +
'9A80185CF03FC6A00E1CD105C');
AxeHeadDTM := DTMFromString('78DA63CC62626078C180021C2312191E02694' +
'620FE0F048C694035CF18D000231209A473816A9E12A1E6150135' +
'A94035AF09A801B9F9090135994498930C54F392809A3CCCF0415' +
'70300FB8311DF');
GameTab(4);
if (FindDTM(AxeHeadDTM, x, y, 550, 200, 745, 465)) and
(FindDTM(AxeHandleDTM, x, y, 550, 200, 745, 465)) then
begin
if (FindDTM(AxeHeadDTM, x, y, 550, 200, 745, 465)) then
begin
Mouse(x, y, 3, 3, True);
Wait(600 + Random(400));
end;
if (FindDTM(AxeHandleDTM, x, y, 550, 200, 745, 465)) then
begin
Mouse(x, y, 3, 3, True);
Wait(500 + Random(200));
AxeAttaches := AxeAttaches + 1;
Result := True;
WriteLn('Attached Axe Head!');
GameTab(4);
MakeCompass('N');
end;
end;
FreeDTM(AxeHandleDTM);
FreeDTM(AxeHeadDTM);
end;
{*******************************************************************************
function FindHead: Boolean;
By: Liquid and Starblaster100
*******************************************************************************}
function FindHeed: Boolean;
var
AxeHeadDTM, Tries, x, y: Integer;
begin
if not (GetColor(590, 220) = HeadColor[0]) or
not (GetColor(587, 219) = HeadColor[1]) or
not (GetColor(588, 218) = HeadColor[2]) then
begin
AxeHeadDTM := DTMFromString('78DA63CC62626078C180021C2312191E02694' +
'620FE0F048C694035CF18D000231209A473816A9E12A1E6150135' +
'A94035AF09A801B9F9090135994498930C54F392809A3CCCF0415' +
'70300FB8311DF');
GameTab(4);
Result := True;
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', HeadColor[0], HeadColor[1], HeadColor[2], 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', HeadColor[0], HeadColor[1], HeadColor[2], 5) then
begin
Status('Axe Head not found - Moving to Red Dot');
x := 648;
y := 83;
FindColorSpiral(x, y, 241, 570, 5, 725, 155)
Mouse(x + 3, y + 3, 2, 2, True);
Flag;
Wait(500 + Random(300));
end;
end;
if FindObjMulti('Take', HeadColor[0], HeadColor[1], HeadColor[2], 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 (AttacHead) then
Result := True;
end;
FreeDTM(AxeHeadDTM);
end;
end;
//->Ent Checker<--Credit to FOURScape!! and YoHoJo!!//
Procedure EntChecker;
Var
EX, EY : integer;
FX, FY : integer;
Begin
Status('Checking For Ent')
Flag;
If (FindObjEx(EX, EY, 'illow', Ax - 50, Ay -50, Ax + 50, Ay + 50, Colour1, 4, 0, 0, 0, true)) then
Begin
MMouse(Ex, EY, 0, 0)
Mx := Ex
My := Ey
If FindColorTolerance( FX, FY, 55769, 85, 15, 115, 15, 20) then
Begin
Status('Ent Found');
MouseFindFlag(648,83,5,5);
Wait(15000+Random(5000));
EntsAvoided := EntsAvoided + 1
end;
end;
end;
function FindFastRandoms: Boolean; //By WT-Fakawi.
var
i: Integer;
begin
for I := 1 to 10 do
begin
case I of
1: if FindDead then
Result := True;
2: if FindMod then
Result := True;
3: if FindMime then
Result := True;
4: if FindMaze then
Result := True;
5: if FindQuiz then
Result := True;
6: if FindDemon then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
writeln('No GameTab');
Logout;
Exit;
end;
end;
7: begin
if InBlack then
begin
Result := True;
writeln('InBlack');
Logout;
Exit;
end;
end;
8: If RC Then
Result := True;
9: If FindFight Then
Begin
Result := True;
RunAwayDirection('N');
Wait(8000 + random(6535));
RunBack;
End;
10: If FindTalk Then
Result := True;
end;
wait(1);
end;
end;
procedure FindRandoms;
begin
Status('Checking For Randoms');
FindFastRandoms;
If (FindNormalRandoms) then Mouse(x, y, 2, 2, true);
end;
procedure Respond;
begin
If (FindChatText('Hey ')) then TypeSend('hi');
If (FindChatText('lvl')) then TypeSend(IntToStr(GetSkillAmount('woodcutting')));
If (FindChatText('hi ')) then TypeSend('hey!');
If (FindChatText('sup')) then TypeSend('yo');
If (FindChatText(Players[CurrentPlayer].Nick)) then TypeSend('hi')
end;
procedure AntBan;
begin
Status('AntiBAn');
If (FindChatText(Players[CurrentPlayer].Name)) then
begin
TypeSend('hi, bye lol, sry i g2g')
repeat
Logout;
Wait(1500 + Random(500));
until not (LoggedIn);
Wait((60000) + Random(60000));
LoginPlayer;
end;
Case Random(100) of
0 : MouseBox(MIx1, MIy1, MIx2, MIy2, 3);
1 : RandomRClick;
2 : GameTab(1 + Random(7));
3 : BoredHuman;
4 : AlmostLogOut;
5 : FTWait(5);
6 : begin
HoverSkill('Woodcutting', False);
wait(500+random(2000));
GameTab(4);
end;
7 : PickUpMouse;
8 : PickUpMouse;
9 : PickUpMouse;
10: PickUpMouse;
11: begin
HoverSkill('Woodcutting', False);
wait(500+random(500));
GameTab(4);
end;
12: GameTab(1 + Random(7));
13: GameTab(1 + Random(7));
14: GameTab(1 + Random(7));
15: GameTab(1 + Random(7));
16: GameTab(1 + Random(7));
17: begin
MakeCompass('N');
wait(10+random(5));
MakeCompass('S');
wait(10+random(5));
MakeCompass('N');
end;
18: begin
MakeCompass('N');
wait(10+random(5));
MakeCompass('S');
wait(10+random(5));
MakeCompass('N');
end;
19: respond;
20: respond;
21: respond;
end;
end;
procedure Rand; //Credit to Special Ed (used only a couple of his ideas)
begin
EntChecker;
FindRandoms;
FindRandoms;
if(DetectFrogCave)then SolveFrogSwamp;
if (FindNewBox) then OpenBox;
if(TalkToRand)then
begin
repeat
ClickToContinue;
until(not(TalkToRand));
end;
end;
procedure Axes;
var
DTMBroken: integer;
begin
DTMBroken := DTMFromString('78DA63F4656260B8C580021C1CE218FE03694' +
'620FE0F048C7E40353718D000231209A48330CDC1501300547387' +
'08350F09A8F106AAB94B408D2B50CD4D026ADC816AAEE3570300B' +
'6A30F3B');
Gametab(4);
if FindDTM(DTMBroken,x,y,MIX1,MIY1,MIX2,MIY2)then
begin
writeln('Damn, missed an ent, axe is broken!');
nextplayer(false);
end;
FreeDTM(DTMBroken);
end;
function IsTreeGone :boolean;
begin
MMouse(MX,MY,2,2);
if (not(IsUpText('illow')))then result:=true;
end;
procedure FindTrees;
var
s : integer;
found : boolean;
begin
if (Players[CurrentPlayer].Boolean1 = False) then
begin
if (t>80) or (w>40) then nextplayer(false);
end;
if (Players[CurrentPlayer].Boolean1 = True) then
begin
if (t>40) or (w>30) then
begin
Status('Finding Willow Trees on MM');
writeln('looking for willows...');
if ( Not (LoggedIn) ) then exit;
s:=0;
t:=0;
w:=0;
MakeCompass('S');
MakeCompass('N');
WillowTreesDTM := DTMFromString('78DA636C6162608862400126D1120C72409A1' +
'188FF03016325508D1F6E3520C0580D54E3865B0D187702D5B8E2' +
'56C304A29380A433AA9AFA49BB50D40000545E0CEC');
WillowTrees2DTM := DTMFromString('78DA63EC616260F06140010E29F20C22409A1' +
'188FF0301633D508D3F6E3520C0580754138E5B0D187701D524E0' +
'56C304A253806430AA9ABA893B51CC0100835A0D69');
WillowTrees3DTM := DTMFromString('78DA639CC8C4C010CF80021C52E4194480342' +
'310FF0702C636A09A54DC6A4080B103A82617B71A309E0A545384' +
'5B0D13882E069259A86AEA26EE44310700BD520E01');
repeat
if (DTMRotated(WillowTreesDTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
begin
found := true;
writeln('found them!')
Mouse(x, y, 0, 0, True);
Wait(2000 + Random(4000));
end;
if (found=false) then
begin
if (DTMRotated(WillowTrees2DTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
begin
found := true;
writeln('found them!')
Mouse(x, y, 0, 0, True);
Wait(2000 + Random(4000));
end;
if (found=false) then
begin
if (DTMRotated(WillowTrees3DTM, x, y, MMX1, MMY1, MMX2, MMY2)) then
begin
found := true;
writeln('found them!')
Mouse(x, y, 0, 0, True);
Wait(2000 + Random(4000));
end;
end;
end;
if (found=false) then s := s + 1;
until (found=true) or (s>20);
FreeDTM(WillowTreesDTM);
FreeDTM(WillowTrees2DTM);
FreeDTM(WillowTrees3DTM);
if s>20 then
begin
writeln('NextPlayer cos cant find the willows!');
nextplayer(false);
end;
end;
end;
end;
procedure ChopTree;
var
Time1, Time2: LongInt;
gone : boolean;
begin
HighestAngle;
t := 0;
w := 0;
repeat
if ( Not (LoggedIn) ) then exit;
if (t>40) then FindTrees;
if (FindColorTolerance(Ax, Ay, Colour1, 110, 70, 300, 300, 3)) or
(FindColorTolerance(Ax, Ay, Colour2, 110, 70, 300, 300, 3)) or
(FindColorTolerance(Ax, Ay, Colour3, 110, 70, 300, 300, 3)) then
begin
Status('Found Tree, Checking It Is Willow');
MMouse(Ax,Ay,3,3);
t := 0;
if (w>30) then FindTrees;
if (IsUpText('illow')) then
begin
w:=0
Status('Found Willow, Chopping Up and Away');
Mouse(Ax, Ay, 2, 2, true);
gone:=false
Time1 := GetSystemTime;
Rand;
repeat
If (InvFull) then exit;
If (IsTreeGone) then gone:=true;
Rand;
FindHeed;
If (IsTreeGone) then gone:=true;
Rand;
If (IsTreeGone) then gone:=true;
AntBan;
Rand;
If (IsTreeGone) then gone:=true;
FindHeed;
Axes;
Time2 := GetSystemTime;
until (Time2 - Time1 >30000 + Random(8000)) or
(IsTreeGone) or (gone=true);
end else w:=w+1;
end else t:=t+1;
until (InvFull);
end;
procedure DropLogs;
var
LogSpace : integer;
begin
If (InvFull) then
begin
DropTo(Players[CurrentPlayer].Integer1 + 1,28);
Loads:=Loads + 1;
TotalLoads:=TotalLoads + 1;
LogSpace:= 28 - Players[CurrentPlayer].Integer1;
LogsDropped:=LogsDropped + LogSpace;
end;
end;
procedure ProgressReport;
Var
Active: String;
i:Integer;
begin
writeln('~!~!~!~!~!~Progress Report~!~!~!~!~!~');
Writeln('Worked For : ' + ScriptTime2(2));
writeln('Logs Dropped: ' + IntToStr(LogsDropped));
writeln('Axe head re-attaches: ' + IntToStr(AxeAttaches));
writeln('Ents Avoided: ' + IntToStr(EntsAvoided + Ents));
for i := 0 to HowManyPlayers - 1 Do
begin
if Players[i].Active=True then Active := 'T' else Active := 'F';
WriteLn( (IntToStr(i))+' : '+Players[i].nick+ ' = '+
Active);
end;
end;
begin
SetupSRL;
DeclarePlayers;
ActivateClient;
if(Not(LoggedIn)) then LoginPlayer;
repeat
If ( Not (LoggedIn) ) then NextPlayer (false);
HighestAngle;
FindHeadColour;
ChopTree;
DropLogs;
ProgressReport;
If(Loads = NoOfLoads + random(2)) then
begin
Loads:= 0;
NextPlayer(True);
HighestAngle;
end;
until(false);
end.——————————————————
<!– END TEMPLATE: formanswers –>