SRL Archive - Archive

TRiLeZ - SRL Member Application


TRiLeZ

2009-06-24 12:32:10

How Long have You Played Runescape?
4 Year(s)


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?



What is your general programming knowledge?
HTML, PHP, Delphi, C, C++, C#, Java


Are you a member of any other communities?
Moparscape forums, Moparisthebest, RSBot, Scion Bot.


Tell us about yourself…
From: TRiLeZ
I am a kid that likes technology and is really into it.



Please show us one (or multiple) of your scripts.
program CowFighter;
{.Script Info:
# ScriptName = Cow Fighter v3.1 [SMART] BETA 2
# Author = TRiLeZ |
# Description = A complex cow fighter that will amaze you! |
# Version = 3.1 BETA 2 |
# Date = 6/24/09 |
| Instructions: |
| Setup: |
| 1. Fill in the Const secttion |
| 2. Fill in the DeclarePlayers procedure |
| 3. Run the script! |
| 4. Sit back and let it auto |
| |
| Info: |
| -Must be where cows are |
| -Only bring 3 items |
| -Walks back from dead! |
| -Attack the cows under fally! |
| -Needs Reflection! |
| |
| Help: |
| -Report Bugs to me by PM on SRL Forums! (My username is TRiLeZ) |
| |
| Possible Combat Styles: |
| -Attack, Strength, Defence, Even, Mage, MageDef, Accurate, Rapid, |
| LongRange |
| |
| Skill Numers: |
| -Attack = 0 |
| -Defence = 1 |
| -Strength = 2 |
| -Hitpoints = 3 |
| -Range = 4 |
| -Prayer = 5 |
| -Magic = 6 |
| |
|______________________________________________________________________________|
/Script Info}
{.Include SRL/SRL/Misc/Smart.Scar}
{.include srl/srl.scar}
{.include srl/srl/skill/ranging.scar}
{.include srl/srl/reflection/Reflection.scar}
{.include srl/srl/misc/DoorProfiles.scar}

var
x,y,i,q: Integer;
gCowKill,gBones,gDeathsTRiLeZ,gStartXP,gNowXP,gTxp,gArrowsUsed,gArrows: Integer;
gHides: integer;
Skill: string;

const
SmartWorld = 154;//Change to world you want to auto on

Username = ''; //Name used to id you on my stats website

procedure DeclarePlayers;
begin
HowManyPlayers := 1;// Change this accordingly
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :=''; // Character Name
Players[0].Pass :=''; // Character Pass
Players[0].Nick :=''; // Nickname 3 - 4 Letter's of char name
Players[0].Active := True; // To be ran in the script?
Players[0].Strings[1] := ''; // Combat Styles - See line 25
Players[0].Integers[9] := 0; // The skill number to record XP gain - See line 29
Players[0].Strings[3] := ''; // Only if using Mage or MageDef! Type in spell name in undercase letters!
Players[0].Integers[10] := 0; // Picking up, 0 for nothing, 1 for bones, 2 for hides
Players[0].Pin := ''; //Bank Pin
{
Players[1].Name :=''; // Character Name
Players[1].Pass :=''; // Character Pass
Players[1].Nick :=''; // Nickname 3 - 4 Letter's of char name
Players[1].Active := True; // To be ran in the script?
Players[1].Strings[1] := ''; // Combat Styles - See line 25
Players[1].Integers[9] := 0; // The skill number to record XP gain - See line 29
Players[1].Strings[3] := ''; // Only if using Mage or MageDef! Type in spell name in undercase letters!
Players[1].Integers[10] := 0; // Picking up, 0 for nothing, 1 for bones, 2 for hides
Players[1].Pin := ''; //Bank Pin
}
{
Players[2].Name :=''; // Character Name
Players[2].Pass :=''; // Character Pass
Players[2].Nick :=''; // Nickname 3 - 4 Letter's of char name
Players[2].Active := True; // To be ran in the script?
Players[2].Strings[1] := ''; // Combat Styles - See line 25
Players[2].Integers[9] := 0; // The skill number to record XP gain - See line 29
Players[2].Strings[3] := ''; // Only if using Mage or MageDef! Type in spell name in undercase letters!
Players[2].Integers[10] := 0; // Picking up, 0 for nothing, 1 for bones, 2 for hides
Players[2].Pin := ''; //Bank Pin
}
{
Players[3].Name :=''; // Character Name
Players[3].Pass :=''; // Character Pass
Players[3].Nick :=''; // Nickname 3 - 4 Letter's of char name
Players[3].Active := True; // To be ran in the script?
Players[3].Strings[1] := ''; // Combat Styles - See line 25
Players[3].Integers[9] := 0; // The skill number to record XP gain - See line 29
Players[3].Strings[3] := ''; // Only if using Mage or MageDef! Type in spell name in undercase letters!
Players[3].Integers[10] := 0; // Picking up, 0 for nothing, 1 for bones, 2 for hides
Players[3].Pin := ''; //Bank Pin
}
end;

{*******************************************************************************
function PostReport(ScriptName, Website, Proggy : String): Boolean;
By: Camo Kyle & Floor66
Description: Posts the Progress Report to my database which you can see
*******************************************************************************}
function PostReport(ScriptName, Website, Proggy : string): Boolean;
var
Dbase : string;
Client : Integer;
begin
Client := InitializeHTTPClient(False, False);
ClearPostData(Client);
Wait(10);
AddPostVariable(Client, 'proggy', Proggy);
AddPostVariable(Client, 'scn', ScriptName);
Dbase := PostHTTPPageEx(Client, Website);
FreeHTTPClient(Client);
Result := true;
end;

procedure SetUpAutoCast(AutoSpell: string; Defensive: Boolean); //Works better than the srl one
begin
GameTab(1);
case Defensive of
True: Mouse(690, 270, 8, 8, True);
False: Mouse(695, 330, 8, 8, True);
end;
Wait(1200+Random(600));
case LowerCase(AutoSpell) of
'wind strike': Mouse(583,240,3,3,true);
'water strike': Mouse(624,240,3,3,true);
'earth strike': Mouse(663,240,3,3,true);
'fire strike': Mouse(703,240,3,3,true);
'wind bolt': Mouse(584,299,3,3,true);
'water bolt': Mouse(625,299,3,3,true);
'earth bolt': Mouse(664,299,3,3,true);
'fire bolt': Mouse(704,299,3,3,true);
'wind blast': Mouse(582,363,3,3,true);
'water blast': Mouse(624,363,3,3,true);
'earth blast': Mouse(663,363,3,3,true);
'fire blast': Mouse(703,363,3,3,true);
'wind wave': Mouse(585,424,3,3,true);
'water wave': Mouse(625,424,3,3,true);
'earth wave': Mouse(664,424,3,3,true);
'fire wave': Mouse(704,424,3,3,true);
end;
Wait(1200+Random(600));
end;

procedure PickSkill;
begin
if (Players[CurrentPlayer].Strings[1] = 'even') then
begin
if (GetMySkill(0,true) < GetMySkill(1,true)) and (GetMySkill(2,true) < GetMySkill(2,true)) then SetFightMode(1)
else
if (GetMySkill(1,true) < GetMySkill(2,true)) and (GetMySkill(0,true) < GetMySkill(2,true)) then SetFightMode(4)
else
if (GetMySkill(2,true) < GetMySkill(0,true)) and (GetMySkill(1,true) < GetMySkill(2,true)) then SetFightMode(2);
end;
end;

procedure SetCStyle;
begin
GameTab(1);
case Players[CurrentPlayer].Strings[1] of
'strength': SetFightMode(2);
'attack': SetFightMode(1);
'defence': SetFightMode(4);
'even': PickSkill;
'mage': SetUpAutoCast(Players[CurrentPlayer].Strings[3], false);
'mageDef': SetUpAutoCast(Players[CurrentPlayer].Strings[3], true);
'accurate': Mouse(602, 272,0,0,true);
'rapid': Mouse(677, 273,0,0,true);
'longRange': Mouse(602, 319,0,0,true);
end;
end;

procedure NowEXP;
begin
gNowXp := SmartGetFieldArrayInt(0, Experiences, Players[CurrentPlayer].Integers[9]);
gTxp := (gNowXp-gStartXp);
end;

procedure ProgressReport;
begin
if not LoggedIn then exit;
ClearDebug;
if (HowManyPlayers = 1) then
begin
Writeln('****************************************************************************');
Writeln('Cow Fighter v3.1 [SMART] BETA 2 by TRiLeZ ' + ' Used by: ' + Username);
Writeln('****************************************************************************');
Writeln('Running Time: '+TimeRunning);
Writeln('Killed: '+inttostr(gCowKill)+' Cows.');
Writeln('Xp Gained: '+inttostr(gTxp)+' of '+Skill);
case Players[CurrentPlayer].Integers[10] of
1: Writeln('Bones Picked Up: '+inttostr(gBones));
2: Writeln('Cowhides Picked Up: '+inttostr(gHides));
end;
Writeln('Deaths: '+inttostr(gDeathsTRiLeZ));
if (Players[CurrentPlayer].Strings[1] = 'accurate') or
(Players[CurrentPlayer].Strings[1] = 'rapid') or
(Players[CurrentPlayer].Strings[1] = 'longRange') then
Writeln('Arrows Used: '+inttostr(gArrowsUsed));
Writeln('****************************************************************************');
end;
if (HowManyPlayers > 1) then
begin
Players[CurrentPlayer].Integers[1]:= Players[CurrentPlayer].Integers[1] + gCowKill;
gCowKill:= 0;
Players[CurrentPlayer].Integers[2]:= gNowXp-gStartXp;
Players[CurrentPlayer].Integers[3]:= Players[CurrentPlayer].Integers[3] + gBones;
gBones:= 0;
Players[CurrentPlayer].Integers[11]:= Players[CurrentPlayer].Integers[11] + gHides;
gHides:= 0;
Players[CurrentPlayer].Integers[5]:= Players[CurrentPlayer].Integers[5] + gDeathsTRiLeZ;
gDeathsTRiLeZ:= 0;
Players[CurrentPlayer].Integers[6]:= Players[CurrentPlayer].Integers[5] + gArrowsUsed;
Writeln('********************************************************************');
Writeln('Cow Fighter v3.1 [SMART] BETA 2 by TRiLeZ ' + ' Used by: ' + Username);
Writeln('********************************************************************');
Writeln('| Nick | Killed | XP Gained | Bones | Deaths | Arrows Used | Hides |');
Writeln(' ******** ******** *********** ******* ****** ******** *************');
for i:= 0 to HowManyPlayers-1 do
begin
Writeln('| '+Padr(Players[i].Nick, 7)+'| '+Padr(IntToStr(Players[i].Integers[1]),7)+'| '
+Padr(IntToStr(Players[i].Integers[2]),10)+'| '+Padr(IntToStr(Players[i].Integers[3]),6)+'| '
+Padr(IntToStr(Players[i].Integers[5]),7)+'| '+Padr(IntToStr(Players[i].Integers[6]),12)+'| '
+Padr(IntToStr(Players[i].Integers[11]),6)+'| ');
end;
Writeln('**********************************************************************');
Writeln(' Total Running Time: '+TimeRunning);
Writeln('**********************************************************************');
end;
end;

procedure OpenDoor;
var
P: TPoint;
begin
Status('Finding Door');
KeyDown(VK_Down);
ClickDoor(8695,'n','Open');
KeyDown(VK_Up);
end;

procedure RandomEmote;
begin
if not IsInteractingWithMe('Cow') then
begin
GameTab(12);
case Random(20) of
0: Mouse(569,232,5,5,true);
1: Mouse(613,232,5,5,true);
2: Mouse(654,232,5,5,true);
3: Mouse(701,232,5,5,true);
4: Mouse(569,282,5,5,true);
5: Mouse(613,282,5,5,true);
6: Mouse(654,282,5,5,true);
7: Mouse(701,282,5,5,true);
8: Mouse(569,332,5,5,true);
9: Mouse(613,332,5,5,true);
10: Mouse(654,332,5,5,true);
11: Mouse(701,332,5,5,true);
12: Mouse(569,382,5,5,true);
13: Mouse(613,382,5,5,true);
14: Mouse(654,382,5,5,true);
15: Mouse(701,382,5,5,true);
16: Mouse(569,332,5,5,true);
17: Mouse(613,332,5,5,true);
18: Mouse(654,332,5,5,true);
19: Mouse(701,332,5,5,true);
end;
WaitForAnim(1000);
While (GetAnimation > 0) do wait(20);
end;
end;

procedure AntiBan;
var
Close: integer;
begin
if not LoggedIn then Exit;
case Random(7+random(2)) of
0: wait(500+random(3000));
1: begin
case Random(2) of
0: HoverSkill('random', false);
1: begin
if IsInteractingWithMe('Cow') then Exit;
HoverSkill('random', false);
GetMousePos(x,y);
Mouse(x,y,5,5,true);
Wait(1600+random(500));
Close := DTMFromString('78DA63CC666260686340010F7654317000694' +
'620FE0F048C25403575A86A96D6DAC3D580006332916AFA08A829' +
'21AC06000EE41086');
if FindDTM(Close,x,y,MSX1,MSY1,MSX2,MSY2) then
begin
Mouse(x,y,3,3,false);
ChooseOption('Close');
Wait(800+Random(200));
end else
begin
Mouse(498,21,8,8,false);
Wait(800+Random(250));
if ChooseOption('Close') then Wait(300+Random(200))
else
begin
Mouse(449,51,8,8,false);
ChooseOption('Close');
Wait(800+Random(200));
end;
FreeDTM(Close);
end;
end;
end;
end;
2: PickUpMouse;
3: BoredHuman;
4: RandomRClick;
5: RandomEmote;
end;
end;

procedure Intro;
begin
ClearReport;
ChangeReportWidth(300);
AddtoReport(' _ _ _ _ _ _ _ _ _ _ _ _ _');
Wait(500);
AddtoReport('|_ _|| |_| ||_|| | | O_||__ /');
Wait(500);
AddtoReport(' | | | _ \ | || |_ | \_ / /_');
Wait(500);
AddtoReport(' |_| |_| \_\|_||_ _||_ _| /_ _ |');
Wait(500);
AddtoReport('Cow Fighter v3.1 [SMART] BETA 2 By TRiLeZ');
Disguise('Cow Fighter v3.1 [SMART] BETA 2');
Status('Running...');
end;

procedure SetupScript;
var
v: string;
begin
v:= GetPage('http://scardevreflection.googlecode.com/svn/trunk/RSBuild.txt');
if not (RSBuild = StrToInt(GetNumbers(v))) then UpdateHooks;
DeclarePlayers;
for i := 0 to howmanyplayers - 1 do
begin
Players[i].Strings[1] := LowerCase(Players[i].Strings[1]);
Players[i].Strings[3] := LowerCase(Players[i].Strings[3]);
end;
LoginPlayer;
Wait(800+Random(200));
end;

procedure SetupPlayer;
begin
q:= 1;
KeyDown(VK_Up);
SetRun(True);
gStartXp := SmartGetFieldArrayInt(0, Experiences, Players[CurrentPlayer].Integers[9]);
if (Players[CurrentPlayer].Strings[1] = 'accurate') or
(Players[CurrentPlayer].Strings[1] = 'rapid') or
(Players[CurrentPlayer].Strings[1] = 'longRange') then
begin
gArrows:= ArrowAmount;
end;
case Players[CurrentPlayer].Integers[9] of
0: Skill:= 'Attack';
1: Skill:= 'Defence';
2: Skill:= 'Strength';
3: Skill:= 'HitPoints';
4: Skill:= 'Range';
5: Skill:= 'Prayer';
6: Skill:= 'Magic';
end;
end;

function DeathWalkPath: TPointArray;
begin
Result := [Point(3227, 3219), Point(3229, 3219), Point(3232, 3227), Point(3222, 3238),
Point(3209, 3238), Point(3195, 3238), Point(3180, 3236), Point(3166, 3233), Point(3150, 3229),
Point(3134, 3228), Point(3119, 3227), Point(3106, 3236), Point(3105, 3248), Point(3093, 3249),
Point(3079, 3251), Point(3072, 3265), Point(3059, 3276), Point(3043, 3275), Point(3033, 3286),
Point(3039, 3295)];
end;

procedure WalkFromDead;
var
I: Integer;
Path: TPointArray;
begin
gDeathsTRiLeZ := gDeathsTRiLeZ + 1;
Status('Walking back to cows from death');
SetRun(true);
Path := DeathWalkPath;
for i:=0 to High(Path) do
begin
WalkToTile(Path[i], 0, 3);
if (i = High(Path)) then break;
while(not TileOnMM(Path[(i+1)]))do
Wait(RandomRange(100, 150));
end;
MMouse(578,226,3,3);
Wait(500+Random(200));
for i:= 1 to 3 do
begin
if IsUpText('Wield') or IsUpText('Wear') then
begin
GetMousePos(x,y);
Mouse(x,y,0,0,true);
end;
MMouse(x+42,226,3,3);
Wait(500+Random(200));
end;
MakeCompass('N');
OpenDoor;
Wait(1250+Random(250));
Mouse(608,42,4,4,true);
SetAngle(true);
Flag;
Mouse(91,493,0,0,true);
Flag;
Wait(2000+Random(200));
end;

function FindDeadTRiLeZ: Boolean;
begin
Result := False;
if FindBlackChatMessage('Oh dear, you are dead!') then
begin
Result := True;
SaveToChatLog;
if (SRL_Procs[srl_OnFindDead] <> nil) then
SRL_Procs[srl_OnFindDead]();
TakeScreen('Found Dead');
WalkFromDead;
end;
end;

procedure ArrowCheck;
begin
if (Players[CurrentPlayer].Strings[1] = 'Accurate') or
(Players[CurrentPlayer].Strings[1] = 'rapid') or
(Players[CurrentPlayer].Strings[1] = 'longRange') then
begin
Wait(200+random(100));
if (ArrowAmount = 0) then
begin
Writeln('No arrows left to continue');
if IsInteractingWithMe('Cow') then
begin
GameTab(5);
Mouse(587,304,10,10,true);
repeat
wait(20);
until not IsInteractingWithMe('Cow');
end;
Logout;
Exit;
end else
gArrowsUsed:= (gArrows-ArrowAmount);
end;
end;

procedure MageCheck;
begin
if (Players[CurrentPlayer].Strings[1] = 'mage') or
(Players[CurrentPlayer].Strings[1] = 'mageDef') then
begin
repeat
Wait(20);
if not IsInteractingWithMe('Cow') then
begin
Writeln('You dont have enough runes to continue');
Logout;
Exit;
end;
until (GetAnimation = 1162);
end;
end;

function CowInFight: Boolean;
var
X1,Y1,X2,Y2,cx,cy: Integer;
begin
GetMousePos(cx,cy);
X1:=cx-45; Y1:=cy-45;
X2:=cx+45; Y2:=cy+45;
if FindColorSpiralTolerance(cx,cy,56488,X1,Y1,X2,Y2,10) or
FindColorSpiralTolerance(cx,cy,334812,X1,Y1,X2,Y2,10) then
Result:= True
else
Result:= False;
end;

function FindFreeCow(var cx, cy: Integer; Color: TIntegerArray;
Tol, Step, xs, ys, xe, ye: Integer): Boolean;
var
CurX, CurY, a, b, c, i: Integer;
Start: Boolean;
begin
for b := 0 to (GetArrayLength(Color)-1) do
begin
if (FindColorSpiralTolerance(cx, cy, color[b], xs, ys, xe, ye, Tol)) then
begin
Start := True;
Break;
end;
end;
if (Start) then
begin
CurX := Round((xs + xe) div 2);
CurY := Round((ys + ye) div 2) - Step;
i := 1;
repeat
for c := 1 to i do
begin
case a of
0: begin //To allow for beginning offset and loop
a := a + 1;
i := 0;
CurY := CurY + Step;
end;
1: CurX := CurX + Step;
2: CurY := CurY - Step;
3: CurX := CurX - Step;
4: CurY := CurY + Step;
end;
if (CurX >= xs) and (CurX <= xe) and (CurY >= ys) and (CurY <= ye) then
begin
try
for b := 0 to (GetArrayLength(Color)-1) do
begin
if (FindColorTolerance(cx, cy, Color[b], CurX-(Step/2), CurY-(Step/2), CurX+(Step/2), CurY+(Step/2), Tol)) then
begin
MMouse(cx, cy, 3, 3);
Wait(50 + Random(50));
If (IsUpTextMultiCustom(['Cow'])) then
begin
if not CowInFight then
begin
GetMousePos(cx, cy);
Result := True;
Exit;
end;
end;
end;
end;
except
end;
end;
end;
a := a + 1;
if a mod 5 = 0 then a := 1;
if (a = 1) or (a = 3) then i := i + 1;
until (Result) or ((CurX > xe) and (CurY > ye))
end;
end;

function FindCow(var cx, cy: Integer; Tol: Integer): Boolean;
var
Color: TIntegerArray;
begin
Color:= [8421504,12238531,7635346,7045533,5594475,10791857,4018778,6650774];
Result := FindFreeCow(cx, cy, Color, Tol, 50, MSX1, MSY1, MSX2, MSY2);
end;

procedure BuryBones;
var
x,y,Bones: Integer;
begin
GameTab(4);
Wait((100)+ Random(80));
Bones := DTMFromString('78DA63CC616260F8C18002CE1C3DCAC00AA41' +
'981F83F10306600D57C475573E2E001B81A10602C06AAF989AA66' +
'FFB6ADA86A32816AFEA1AA99337102AA9A7CA09ACFA86AF66DD98' +
'2A20600F06D15CE');
repeat
if FindDTM(Bones,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
Mouse(x,y,3,3,false);
ChooseOption('Bury');
Wait(650+random(200));
end;
Wait(400+Random(200));
until not FindDTM(Bones,x,y,MIX1,MIY1,MIX2,MIY2);
FreeDTM(Bones);
end;

function FindWallColor: Integer;
var
TPA : TPointArray;
I, Col : Integer;
begin
if FindColorsTolerance(TPA, 15462895, MMX1, MMY1, MMX2, MMY2, 35) then
begin
Col := GetColor(TPA[i].X, TPA[i].Y);
Result:= Col;
end;
end;

function FindFloorColor: Integer;
var
TPA : TPointArray;
I, Col : Integer;
begin
if FindColorsTolerance(TPA, 10137790, MMX1, MMY1, MMX2, MMY2, 2) then
begin
Col := GetColor(TPA[i].X, TPA[i].Y);
Result:= Col;
Writeln('Floor Color= '+inttostr(Col));
end else
if FindColorsTolerance(TPA, 9744314, MMX1, MMY1, MMX2, MMY2, 2) then
begin
Col := GetColor(TPA[i].X, TPA[i].Y);
Result:= Col;
Writeln('Floor Color= '+inttostr(Col));
end else
if FindColorsTolerance(TPA, 9414324, MMX1, MMY1, MMX2, MMY2, 2) then
begin
Col := GetColor(TPA[i].X, TPA[i].Y);
Result:= Col;
Writeln('Floor Color= '+inttostr(Col));
end else
if FindColorsTolerance(TPA, 10137790, MMX1, MMY1, MMX2, MMY2, 2) then
begin
Col := GetColor(TPA[i].X, TPA[i].Y);
Result:= Col;
Writeln('Floor Color= '+inttostr(Col));
end else
if FindColorsTolerance(TPA, 9219247, MMX1, MMY1, MMX2, MMY2, 2) then
begin
Col := GetColor(TPA[i].X, TPA[i].Y);
Result:= Col;
Writeln('Floor Color= '+inttostr(Col));
end;
end;

function FindTreeColor: Integer;
var
TPA : TPointArray;
I, Col : Integer;
begin
if FindColorsTolerance(TPA, 410389, MMX1, MMY1, MMX2, MMY2, 25) then
begin
Col := GetColor(TPA[i].X, TPA[i].Y);
Result:= Col;
end;
end;

function FindLadderColor2: Integer;//SRL function dosnt pickup this ladder well
var
TPA : TPointArray;
I, Col : Integer;
begin
if FindColorsTolerance(TPA, 78936, MMX1, MMY1, MMX2, MMY2, 4) then
begin
Col := GetColor(TPA[i].X, TPA[i].Y);
Result:= Col;
Writeln('Ladder Color= '+inttostr(Col));
end else
if FindColorsTolerance(TPA, 929381, MMX1, MMY1, MMX2, MMY2, 4) then
begin
Col := GetColor(TPA[i].X, TPA[i].Y);
Result:= Col;
Writeln('Ladder Color= '+inttostr(Col));
end else
if FindColorsTolerance(TPA, 10063, MMX1, MMY1, MMX2, MMY2, 4) then
begin
Col := GetColor(TPA[i].X, TPA[i].Y);
Result:= Col;
Writeln('Ladder Color= '+inttostr(Col));
end else
if FindColorsTolerance(TPA, 800860, MMX1, MMY1, MMX2, MMY2, 4) then
begin
Col := GetColor(TPA[i].X, TPA[i].Y);
Result:= Col;
Writeln('Ladder Color= '+inttostr(Col));
end;
end;

procedure OpenGate;
begin
Status('Opening Gate');
if FindObjCustom(x,y,['Gate'],[5533052,3427931,5401465,5467258],4) then
begin
Mouse(x,y,3,3,false);
if ChooseOption('Open') then
begin
WaitToMove(500);
while CharacterMoving do wait(10);
Wait(400+Random(200));
end;
end;
end;

function DDTMWalk(WalkNumber: Integer): Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: array[0..3] of TDTMPointDef;
TempTDTM: TDTM;
begin
case WalkNumber of
1:
begin
dtmMainPoint.x := 713;
dtmMainPoint.y := 137;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindWallColor;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 713;
dtmSubPoints[0].y := 137;
dtmSubPoints[0].AreaSize := 6;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := FindWallColor;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 716;
dtmSubPoints[1].y := 147;
dtmSubPoints[1].AreaSize := 6;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := FindTreeColor;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 699;
dtmSubPoints[2].y := 153;
dtmSubPoints[2].AreaSize := 6;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := FindTreeColor;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 729;
dtmSubPoints[3].y := 149;
dtmSubPoints[3].AreaSize := 6;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := FindTreeColor;
dtmSubPoints[3].Tolerance := 0;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
2:
begin
dtmMainPoint.x := 685;
dtmMainPoint.y := 187;
dtmMainPoint.AreaSize := 1;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindFallyRoadColor;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 685;
dtmSubPoints[0].y := 187;
dtmSubPoints[0].AreaSize := 1;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := FindFallyRoadColor;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 697;
dtmSubPoints[1].y := 187;
dtmSubPoints[1].AreaSize := 1;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := FindTreeColor;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 679;
dtmSubPoints[2].y := 200;
dtmSubPoints[2].AreaSize := 1;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := FindFallyRoadColor;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 688;
dtmSubPoints[3].y := 215;
dtmSubPoints[3].AreaSize := 1;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := FindFallyRoadColor;
dtmSubPoints[3].Tolerance := 0;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
3:
begin
dtmMainPoint.x := 744;
dtmMainPoint.y := 148;
dtmMainPoint.AreaSize := 1;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindFallyRoadColor;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 744;
dtmSubPoints[0].y := 148;
dtmSubPoints[0].AreaSize := 1;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := FindFallyRoadColor;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 754;
dtmSubPoints[1].y := 148;
dtmSubPoints[1].AreaSize := 1;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := FindFallyRoadColor;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 767;
dtmSubPoints[2].y := 166;
dtmSubPoints[2].AreaSize := 1;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := FindLadderColor2;
dtmSubPoints[2].Tolerance := 8;

dtmSubPoints[3].x := 766;
dtmSubPoints[3].y := 146;
dtmSubPoints[3].AreaSize := 1;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := FindFloorColor;
dtmSubPoints[3].Tolerance := 10;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
4:
begin
dtmMainPoint.x := 757;
dtmMainPoint.y := 213;
dtmMainPoint.AreaSize := 1;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindFloorColor;
dtmMainPoint.Tolerance := 10;

dtmSubPoints[0].x := 757;
dtmSubPoints[0].y := 213;
dtmSubPoints[0].AreaSize := 1;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := FindFloorColor;
dtmSubPoints[0].Tolerance := 10;

dtmSubPoints[1].x := 757;
dtmSubPoints[1].y := 215;
dtmSubPoints[1].AreaSize := 1;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := FindWallColor;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 755;
dtmSubPoints[2].y := 213;
dtmSubPoints[2].AreaSize := 1;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := FindWallColor;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 761;
dtmSubPoints[3].y := 220;
dtmSubPoints[3].AreaSize := 4;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 195836;
dtmSubPoints[3].Tolerance := 35;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
5:
begin
dtmMainPoint.x := 615;
dtmMainPoint.y := 171;
dtmMainPoint.AreaSize := 1;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindFallyRoadColor;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 615;
dtmSubPoints[0].y := 171;
dtmSubPoints[0].AreaSize := 1;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := FindFallyRoadColor;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 616;
dtmSubPoints[1].y := 156;
dtmSubPoints[1].AreaSize := 1;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := FindFallyRoadColor;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 624;
dtmSubPoints[2].y := 157;
dtmSubPoints[2].AreaSize := 1;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := FindFallyRoadColor;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 632;
dtmSubPoints[3].y := 178;
dtmSubPoints[3].AreaSize := 4;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := FindLadderColor2;
dtmSubPoints[3].Tolerance := 8;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
6:
begin
dtmMainPoint.x := 741;
dtmMainPoint.y := 320;
dtmMainPoint.AreaSize := 1;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindFallyRoadColor;
dtmMainPoint.Tolerance := 0;

dtmSubPoints[0].x := 741;
dtmSubPoints[0].y := 320;
dtmSubPoints[0].AreaSize := 1;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := FindFallyRoadColor;
dtmSubPoints[0].Tolerance := 0;

dtmSubPoints[1].x := 747;
dtmSubPoints[1].y := 292;
dtmSubPoints[1].AreaSize := 1;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := FindFallyRoadColor;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 751;
dtmSubPoints[2].y := 299;
dtmSubPoints[2].AreaSize := 1;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := FindTreeColor;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 768;
dtmSubPoints[3].y := 290;
dtmSubPoints[3].AreaSize := 1;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := FindFloorColor;
dtmSubPoints[3].Tolerance := 8;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
end;
end;

procedure WalkToBank;
begin
if not LoggedIn then Exit;
Status('Walking to Bank');
if DTMRotated(DDTMWalk(1),x,y,MMX1,MMY1,MMX2,MMY2) then
begin
Mouse(x,y,0,0,true);
Flag;
Wait(500+Random(250));
end else
if RadialRoadWalk(FindWallColor, 304, 330, 62, -1, 0) then
begin
Flag;
Wait(500+Random(250));
end else
if WalkToTile(Point(3021, 3326), 0, 5) then
begin
Flag;
Wait(500+Random(250));
end else
begin
Writeln(Players[CurrentPlayer].Nick+' got lost.');
Logout;
end;
if DTMRotated(DDTMWalk(2),x,y,MMX1,MMY1,MMX2,MMY2) then
begin
Mouse(x,y,0,0,true);
Flag;
Wait(500+Random(250));
end else
if RadialRoadWalk(FindFallyRoadColor, 300, 280, 60, -1, 0) then
begin
Flag;
Wait(500+Random(250));
end else
if WalkToTile(Point(3006, 3330), 0, 5) then
begin
Flag;
Wait(500+Random(250));
end else
begin
Writeln(Players[CurrentPlayer].Nick+' got lost.');
Logout;
end;
if DTMRotated(DDTMWalk(3),x,y,MMX1,MMY1,MMX2,MMY2) then
begin
Mouse(x,y,0,0,true);
Flag;
Wait(500+Random(250));
end else
if RadialRoadWalk(FindFallyRoadColor, 5, 20, 68, -1, 0) then
begin
Flag;
Wait(500+Random(250));
end else
if WalkToTile(Point(3007, 3345), 0, 5) then
begin
Flag;
Wait(500+Random(250));
end else
begin
Writeln(Players[CurrentPlayer].Nick+' got lost.');
Logout;
end;
if DTMRotated(DDTMWalk(4),x,y,MMX1,MMY1,MMX2,MMY2) then
begin
Mouse(x,y,0,0,true);
Flag;
Wait(500+Random(250));
end else
if FindSymbol(x,y,'Bank') then
begin
Mouse(x,y,3,3,true);
Flag;
Wait(500+Random(250));
end else
if RadialRoadWalk(FindFloorColor, 360, 401, 70, -1, 0) then
begin
Flag;
Wait(500+Random(250));
end else
if WalkToTile(Point(3011, 3355), 0, 5) then
begin
Flag;
Wait(500+Random(250));
end else
begin
Writeln(Players[CurrentPlayer].Nick+' got lost.');
Logout;
end;
if WalkToTile(Point(3013, 3356),0,5) then
begin
Flag;
Wait(500+Random(250));
end else
begin
Writeln(Players[CurrentPlayer].Nick+' got lost.');
Logout;
end;
end;

procedure DepositCowHides;
var
CowHide: integer;
begin
if not LoggedIn then Exit;
Status('Depositing Cowhides');
if not OpenBankFast('feb') then R_OpenBankBooth('feb');
Wait(750+Random(500));
if PinScreen then
begin
InPin(Players[CurrentPlayer].Pin)
Wait(750+Random(500));
end else
if BankScreen then
begin
CowHide := DTMFromString('78DA63DCC3C4C010C6C8800C766FDCC0C006A' +
'441A2FF81807117508D37AA9AADAB56C1D58000E331A09A005435' +
'1B972E45557310A8260155CDBE2D5B50D56C02AA89425573E1D44' +
'914350017D01437');
if FindDTM(CowHide,x,y,MIX1,MIY1,MIX2,MIY2) then
begin
Mouse(x,y,3,3,false);
ChooseOption('Deposit-All');
Wait(500+Random(250));
CloseBank;
end;
FreeDTM(CowHide);
end;
end;

procedure WalkToPen;
begin
if not LoggedIn then Exit;
Status('Walking to cow pen');
if DTMRotated(DDTMWalk(5),x,y,MMX1,MMY1,MMX2,MMY2) then
begin
Mouse(x,y,0,0,true);
Flag;
Wait(500+Random(250));
end else
if RadialRoadWalk(FindFallyRoadColor, 195, 220, 68, -1, 0) then
begin
Flag;
Wait(500+Random(250));
end else
if WalkToTile(Point(3007, 3340), 0, 5) then
begin
Flag;
Wait(500+Random(250));
end else
begin
Writeln(Players[CurrentPlayer].Nick+' got lost.');
Logout;
end;
if DTMRotated(DDTMWalk(6),x,y,MMX1,MMY1,MMX2,MMY2) then
begin
Mouse(x,y,0,0,true);
Flag;
Wait(500+Random(250));
end else
if RadialRoadWalk(FindFallyRoadColor, 180, 218, 65, -1, 0) then
begin
Flag;
Wait(500+Random(250));
end else
if WalkToTile(Point(3006, 3325), 0, 5) then
begin
Flag;
Wait(500+Random(250));
end else
begin
Writeln(Players[CurrentPlayer].Nick+' got lost.');
Logout;
end;
if FindSymbolIn(x,y,'tree',749,120,830,276) then
begin
Mouse(x,y,3,3,true);
Flag;
Wait(500+Random(250));
end else
if WalkToTile(Point(3017, 3318),0,5) then
begin
Flag;
Wait(500+Random(250));
end else
begin
Writeln(Players[CurrentPlayer].Nick+' got lost.');
Logout;
end;
if WalkToTile(Point(3031, 3314),0,5) then
begin
Flag;
Wait(500+Random(250));
end else
begin
Writeln(Players[CurrentPlayer].Nick+' got lost.');
Logout;
end;
OpenGate;
if WalkToTile(Point(3032, 3306),6,5) then
begin
Flag;
Wait(500+Random(250));
end;
end;

procedure DepositHides;
begin
if not LoggedIn then Exit;
Status('Walking to bank');
if not InvFull then Exit;
WalkToTile(Point(3032, 3313),0,5);
Flag;
Wait(750+Random(250));
OpenGate;
WalkToBank;
DepositCowHides;
WalkToPen;
end;

procedure AttackCow;
var
Close,MMCow: integer;
begin
FindDeadTRiLeZ;
repeat
if (not LoggedIn) then exit;
FindNormalRandoms;
FindDeadTRiLeZ;
ArrowCheck;
case Players[CurrentPlayer].Integers[10] of
1: if InvFull then BuryBones;
2: if InvFull then DepositHides;
end;
Status('Finding Cow');
if FindCow(x,y,1) then
begin
if IsInteractingWithMe('Cow') then Break;
Mouse(x,y,0,0,false);
if IsInteractingWithMe('Cow') then Break;
if ChooseOption('Attack') then
begin
FindDeadTRiLeZ;
FindNormalRandoms;
WaitToMove(600);
while CharacterMoving do wait(10);
WaitForAnim(1200);
while (GetAnimation > 0) do wait(10);
if FindBlackChatMessage('reach that!') and not IsInteractingWithMe('Cow') then
begin
WalkToTile(Point(3032,3314),0,5);
Flag;
Wait(500+Random(250));
OpenGate;
end;
end;
end else
begin
Close := DTMFromString('78DA63CC666260686340010F7654317000694' +
'620FE0F048C25403575A86A96D6DAC3D580006332916AFA08A829' +
'21AC06000EE41086');
if FindDTM(Close,x,y,MSX1,MSY1,MSX2,MSY2) then
begin
Mouse(x,y,3,3,false);
ChooseOption('Close');
Wait(800+Random(200));
end else Wait(200+random(150));
FreeDTM(Close);
MMCow := DTMFromString('78DA636C636260086500034608C5F0E70F138' +
'33294FF1F0818416A8251D564342B31A821F1195B30CDC150D389' +
'A926015D0DC8AE48FC6A00ADA20F39');
if FindDTM(MMCow,x,y,MMX1,MMY1,MMX2,MMY2) then
begin
Mouse(x,y,3,3,true);
Flag;
Wait(500+Random(250));
end;
FreeDTM(MMCow);
end;
until IsInteractingWithMe('Cow');
Status('Fighting Cow');
MageCheck;
FindNormalRandoms;
AntiBan;
NowEXP;
repeat
ArrowCheck;
wait(10);
until not IsInteractingWithMe('Cow');
gCowKill:= gCowKill+1;
NowEXP;
end;

procedure PickupBones;
var
Drop: integer;
begin
if (Players[CurrentPlayer].Strings[1] = 'attack') or
(Players[CurrentPlayer].Strings[1] = 'strength') or
(Players[CurrentPlayer].Strings[1] = 'defence') or
(Players[CurrentPlayer].Strings[1] = 'even') then
begin
MakeCompass('n');
Drop := DTMFromString('78DA630C676460500362206062808005CAA20' +
'C1C401A24FA1F081823802C6554352BE7CE85AB0101C638204B03' +
'55CD86258B51D50462AA39B47307AA1A3F20CB0855CD9573E750D' +
'4000013F8100F');
if FindDTM(Drop,x,y,MSX1,MSY1,MSX2,MSY2) then
begin
Mouse(x,y,4,4,false);
Wait(250+Random(100));
if FindText(x,y,'Bones',upchars,115,93,373,337) then
begin
Mouse(x,y,1,1,true);
gBones := gBones+1;
wait(650+random(150));
end;
end else
if FindColorSpiralTolerance(x,y,1319583,184, 100,339, 253, 4) then
begin
Mouse(x,y,4,4,false);
Wait(250+Random(100));
if FindText(x,y,'Bones',upchars,115,93,373,337) then
begin
Mouse(x,y,1,1,true);
gBones := gBones+1;
wait(650+random(150));
end;
end;
FreeDTM(Drop);
if InvFull then DepositHides;
end;
end;

procedure PickupHides;
var
Drop: integer;
begin
if (Players[CurrentPlayer].Strings[1] = 'attack') or
(Players[CurrentPlayer].Strings[1] = 'strength') or
(Players[CurrentPlayer].Strings[1] = 'defence') or
(Players[CurrentPlayer].Strings[1] = 'even') then
begin
MakeCompass('n');
Drop := DTMFromString('78DA630C676460500362206062808005CAA20' +
'C1C401A24FA1F081823802C6554352BE7CE85AB0101C638204B03' +
'55CD86258B51D50462AA39B47307AA1A3F20CB0855CD9573E750D' +
'4000013F8100F');
if FindDTM(Drop,x,y,MSX1,MSY1,MSX2,MSY2) then
begin
Mouse(x,y,4,4,false);
Wait(250+Random(100));
if FindText(x,y,'Cowhide',upchars,115,93,373,337) then
begin
Mouse(x,y,1,1,true);
gHides := gHides+1;
wait(650+random(150));
end;
end else
if FindColorSpiralTolerance(x,y,1319583,184, 100,339, 253, 4) then
begin
Mouse(x,y,4,4,false);
Wait(250+Random(100));
if FindText(x,y,'Cowhide',upchars,115,93,373,337) then
begin
Mouse(x,y,1,1,true);
gHides := gHides+1;
wait(650+random(150));
end;
end;
FreeDTM(Drop);
if InvFull then DepositHides;
end;
end;

procedure CheckBreak;
begin
if HowManyPlayers = 1 then
begin
if (gCowKill = (q*50)) then
begin
Status('Taking a 15-30 second break and switching worlds');
Logout;
Wait(15000+random(30000));
OpenWorldScreen;
SelectWorld(RandomWorld(false,false));
LoginPlayer;
q:= q+1;
end;
end;
if HowManyPlayers > 1 then
begin
if (Players[CurrentPlayer].Integers[1] = (q*50)) then
begin
Status('Taking a 15-30 second break and switching worlds');
Logout;
Wait(15000+random(30000));
RandomWorld(false,false);
LoginPlayer;
q:= q+1;
end;
end;
end;

procedure MainLoop;
begin
repeat
SetupPlayer;
SetCStyle;
repeat
if (not LoggedIn) then break;
FindNormalRandoms;
Antiban;
FindDeadTRiLeZ;
AttackCow;
case Players[CurrentPlayer].Integers[10] of
1:begin
Wait(4000);
PickupBones;
end;
2:begin
Wait(4000);
PickupHides;
end;
end;
ProgressReport;
SetRun(true);
CheckBreak;
until (not LoggedIn);
Status('Running...');
if (not LoggedIn) then
begin
if (CurrentPlayer = HowManyPlayers-1) then Break;
NextPlayer(false);
end;
until(false);
Postreport('Cow Fighter v3.1 [SMART] BETA 2', 'http://stats.trilez.comuf.com/add.php', GetDebugText);
end;

begin
Smart_Server:= SmartWorld;
SetupSRL;
Intro;
ClearDebug;
SetupScript;
MainLoop;
end.

ian.

2009-06-24 12:38:23

Well, I guess it has everything. Don't see a mistake, really. I'm tired though :p

Yes.

Frt

2009-06-24 13:15:42

I don't like that you're using constant waittimes in your SetUpAutoCast.

I guess your OpenDoor function is quite slow, since you're using FindObject instead of FindObjectEx.

v:= GetPage('http://scardevreflection.googlecode.com/svn/trunk/RSBuild.txt');
if not (RSBuild = StrToInt(GetNumbers(v))) then UpdateHooks;

Just call SetupReflection.

Overall a good script, it's a yes from me.

Torrent of Flame

2009-06-24 14:47:13

REFLECTION? D:

I'll say this now, give this guy a break all of you Colour users. If you don't like Reflection or w/e, please don't vote this guy a no. Reflection is part of SRL so he knows how to use SRL if can code Ref.

Da 0wner

2009-06-24 14:49:16

Reflection is not part of SRL.
No. It sucks. Sorry. Jk, yes.

Torrent of Flame

2009-06-24 15:43:27

Damn you Kyle and your White texting.

Da 0wner

2009-06-24 15:47:15

Josh, you racist :<.

Torrent of Flame

2009-06-24 15:54:52

AHAHA. I wasn't racisting. Gah.. emr.. duuurrh… /runs

TRiLeZ

2009-06-24 15:56:25

I just made a new OpenDoor procedure thats faster and more accurate, here it is:

procedure OpenDoor;
var
P: TPoint;
begin
Status('Finding Door');
KeyDown(VK_Down);
ClickDoor(8695,'n','Open');
KeyDown(VK_Up);
end;
I forgot about the constant wait times in SetupAutoCast so I added some randomness to em.

Floor66

2009-06-24 18:33:34

I was sceptical because it'd need to be a really good ref script. And it was :D

senrath

2009-06-24 20:04:07

Hmm, I don't think your PickSkill function will work properly. Here's why:

if GetMySkill(0,true) < GetMySkill(1,true) and GetMySkill(2,true) then
GetMySkill returns an integer value, so what you're doing is comparing the results of GetMySkill(0,true) to the result of a bitwise AND operation on GetMySkill(1,true) and GetMySkill(2,true), which is not what you want. For instance, this following statement is essentially what you're doing:

if 0 < 1 and 2 then
Writeln('0 is less than 1 and is less than 2.')
else
Writeln('But it is not less than (1 and 2).');

What you really want to do is this:

if (GetMySkill(0,true) < GetMySkill(1,true)) and (GetMySkill(0,true) < GetMySkill(2,true)) then

TRiLeZ

2009-06-24 20:18:29

From: senrath
Hmm, I don't think your PickSkill function will work properly. Here's why:

if GetMySkill(0,true) < GetMySkill(1,true) and GetMySkill(2,true) then
GetMySkill returns an integer value, so what you're doing is comparing the results of GetMySkill(0,true) to the result of a bitwise AND operation on GetMySkill(1,true) and GetMySkill(2,true), which is not what you want. For instance, this following statement is essentially what you're doing:

if 0 < 1 and 2 then
Writeln('0 is less than 1 and is less than 2.')
else
Writeln('But it is not less than (1 and 2).');

What you really want to do is this:

if (GetMySkill(0,true) < GetMySkill(1,true)) and (GetMySkill(0,true) < GetMySkill(2,true)) then


My way works properly. Its already been tested.
Just to let you know, and dosnt add.

senrath

2009-06-24 20:24:27

From: TRiLeZ
My way works properly. Its already been tested.
Just to let you know, and dosnt add.


Of course it doesn't add. And I'm not sure HOW yours works properly. I'll give an example. Say strength was 10, attack was 13, and defense was 11. The statement 10 < 11 and 13 is false, however 10 < 11 and 10 < 13 is true.

TRiLeZ

2009-06-24 20:31:21

From: senrath
Of course it doesn't add. And I'm not sure HOW yours works properly. I'll give an example. Say strength was 10, attack was 13, and defense was 11. The statement 10 < 11 and 13 is false, however 10 < 11 and 10 < 13 is true.


Its more like this.
if Skill1 < Skill2 and Skill3… it would check if Skill1 is less than both Skill2 and Skill3.
With your example, 10 is less than 11 and also 13. So the skill thats level 10 would be the lowest, training that.

senrath

2009-06-24 20:35:19

From: TRiLeZ
Its more like this.
if Skill1 < Skill2 and Skill3… it would check if Skill1 is less than both Skill2 and Skill3.
With your example, 10 is less than 11 and also 13. So the skill thats level 10 would be the lowest, training that.


Except that's not how your function is working. Run this in SCAR, and things should be a bit clearer for you:
program New;

begin
Writeln(BoolToStr(10 < 11 and 13));
Writeln(BoolToStr((10 < 11) and (10 < 13)));
end.

Frt

2009-06-24 20:35:49

From: TRiLeZ
Its more like this.
if Skill1 < Skill2 and Skill3… it would check if Skill1 is less than both Skill2 and Skill3.
With your example, 10 is less than 11 and also 13. So the skill thats level 10 would be the lowest, training that.


Could you explain why this doesn't write that attack is lowest then?
Program New;

const
Att = 10;
Def = 13;
Str = 11;

begin
if (Att < Def and Str) then
Writeln('Attack is lowest');
end.

P1nky

2009-06-24 20:50:34

I like it, btw why use coords for random Emote/Spells(srl done it for us)

You have DDTM/good object finding/RRW and more.

YES

TRiLeZ

2009-06-24 21:01:10

Your right Senrath but my script is able to pick the lowest fight skill just the way it is. i just tested with 4 accounts in my army and my main. Every time it picked the lowest skill to train.

Download it here and run it to see for yourself : http://www.villavu.com/forum/showthread.php?t=46972

senrath

2009-06-24 21:12:16

From: TRiLeZ
Your right Senrath but my script is able to pick the lowest fight skill just the way it is. i just tested with 4 accounts in my army and my main. Every time it picked the lowest skill to train.

Download it here and run it to see for yourself : http://www.villavu.com/forum/showthread.php?t=46972


Okay, I ran it. And all 3 of the evaluations came back false. My stats are 40 attack, 30 strength, 20 defense.

TRiLeZ

2009-06-24 21:40:20

From: senrath
Okay, I ran it. And all 3 of the evaluations came back false. My stats are 40 attack, 30 strength, 20 defense.


For me, it sets the fight mode to train the lowest skill. It also does this on my other computer. I dont know why its not working for you. :confused:

You ran it just the way you downloaded right? And changed Players[0].Strings[1] := ''; to Players[0].Strings[1] := 'Even';?

senrath

2009-06-24 21:47:27

From: TRiLeZ
For me, it sets the fight mode to train the lowest skill. It also does this on my other computer. I dont know why its not working for you. :confused:

You ran it just the way you downloaded right? And changed Players[0].Strings[1] := ''; to Players[0].Strings[1] := 'Even';?


I know exactly why it's not working, and it's the thing I've been telling you to change. Here is the set of comparisons it makes on my character:

if 40 < 20 and 30 then SetFightMode(1)
else
if 20 < 40 and 30 then SetFightMode(4)
else
if 30 < 20 and 40 then SetFightMode(2);

Which, when simplified, looks like this:
if 40 < 20 then SetFightMode(1)
else
if 20 < 8 then SetFightMode(4)
else
if 30 < 0 then SetFightMode(2);

bugger0001

2009-06-25 01:54:18

Backing up senrath as using an 'and' means two statements not multiple values in one statement. But I think it should work if this way:
if GetMySkill(0,true) < (GetMySkill(1,true) and GetMySkill(2,true)) then

senrath

2009-06-25 02:12:28

From: bugger0001
Backing up senrath as using an 'and' means two statements not multiple values in one statement. But I think it should work if this way:
if GetMySkill(0,true) < (GetMySkill(1,true) and GetMySkill(2,true)) then


Nope. That's still performing a bitwise AND between GetMySkill(1,true) and GetMySkill(2,true).

JAD

2009-06-25 02:18:22

Senrath is right about the GetSkill and bitwise and.

Yes from me though. Good job! Not too often that a reflection app goes this long without a single no vote :)

TRiLeZ

2009-06-25 02:27:39

Ok ill change up GetSkill the way Senrath thinks it should be… right after I come back from my friends house that im going to right now.
My way works though but whatever.

senrath

2009-06-25 02:28:44

From: TRiLeZ
Ok ill change up GetSkill the way Senrath thinks it should be… right after I come back from my friends house that im going to right now.
My way works though but whatever.


That is not a good attitude to have.

ZephyrsFury

2009-06-25 02:31:26

From: TRiLeZ
Ok ill change up GetSkill the way Senrath thinks it should be… right after I come back from my friends house that im going to right now.
My way works though but whatever.


You're just lucky if it works because thats not he way to do it. The and statement is used to compare two boolean statements or as a bitwise operator. You can't go:


if 1 < (2 and 3) then

Its just not how its supposed to work.

Griff

2009-06-25 02:51:42

I like your script, but not your attitude. No. Come back next time willing to learn from other members, and having a great attitude. If you do that, then the next time you apply, I won't even look at the script, I'll vote yes.

EDIT: Looks like you're going to get in anyways. Try to have a better attitude when you become a member.

Macro_FTW

2009-06-25 02:55:07

From: TRiLeZ
Ok ill change up GetSkill the way Senrath thinks it should be… right after I come back from my friends house that im going to right now.
My way works though but whatever.


**Not allowed to vote for another two weeks, but the rules said nothing about commenting. :3** [[If I am not allowed to comment either, :duh: . Please inform me via PM, IRC, or a post here, and I'll just lurk. Thanks. :)]]

Your way is a shortcut that does not work due to a more advanced use of the 'and', 'or', 'xor', etc. operators. There are plenty of bitwise tutorials in the tutorials sections.

If your way works, it's out of luck, not skill. It won't work in nearly every instance.

When in doubt, write it out. [/corny saying]

Also, as a friendly suggestion, don't say "my way works better" or come off that way on an app. Not only does it make you look like you think you know more than a person trying to offer help- which alone reflects badly on your personality and inclines others to vote no- but it also makes it look even worse when you're wrong.

Compliance with the suggestion, though, was a step in the right direction.

You seem to be a good scripter overall; you just need to change a few things and read up on a few tutorials. :)

~Macro_FTW

TRiLeZ

2009-06-25 03:54:45

Ok then Ill read up on some bitwise tutorials. I never said that my way works better, I said that it works, but Ill change GetSkill because SRL Members should know what they're talking about, and most do.

senrath

2009-06-25 04:12:34

From: TRiLeZ
I never said that my way works better, I said that it works


Unfortunately, that's the problem. Even if in all of your tests your method works flawlessly, if someone says that it doesn't work properly, and then can cite specific examples of when said method would fail, it is wise to listen and to reexamine your method to figure out why it fails in those cases and work on fixing it, not to sit stubbornly and insist that your method is working as intended. This goes doubly so if the person in question saves you the trouble of having to figure out what went wrong and flat out tells you why it's broken and how to fix it.

TRiLeZ

2009-06-25 04:17:24

From: senrath
Unfortunately, that's the problem. Even if in all of your tests your method works flawlessly, if someone says that it doesn't work properly, and then can cite specific examples of when said method would fail, it is wise to listen and to reexamine your method to figure out why it fails in those cases and work on fixing it, not to sit stubbornly and insist that your method is working as intended. This goes doubly so if the person in question saves you the trouble of having to figure out what went wrong and flat out tells you why it's broken and how to fix it.


I have examined my way and your way and its makes sence to me that your way works better so I changed my way to your way. As I stated in my last post. Thanks for telling me how to fix the problem.

ZaSz

2009-06-25 04:32:20

yes. Just a small thing. I would replace your SetupScript with this. So this way, in the declare players, doesnt matter if they capitalize it wont matter.


procedure SetupScript;
var
v: string;
begin
v:= GetPage('http://scardevreflection.googlecode.com/svn/trunk/RSBuild.txt');
if not (RSBuild = StrToInt(GetNumbers(v))) then UpdateHooks;
DeclarePlayers;
For i := 0 to howmanyplayers - 1 do
begin
Players[I].Strings[1] := LowerCase(Players[I].Strings[1]);
Players[I].Strings[3] := LowerCase(Players[I].Strings[3]);
end;
LoginPlayer;
Wait(800+Random(200));
end;

Macro_FTW

2009-06-25 04:35:13

From: TRiLeZ
Ok then Ill read up on some bitwise tutorials. I never said that my way works better, I said that it works, but Ill change GetSkill because SRL Members should know what they're talking about, and most do.


What you said, "My way works, but whatever", or something to that extent, still- to me, at least- gave off the apathetic suggestion "I don't care. I'll do this so you'll stop trying to talking about it." That's what I was getting at. Respect gets you a long ways in applications. ;)

You're doing much better, from examining your recent posts. Good job. :)

TRiLeZ

2009-06-25 04:39:08

From: Zasz
yes. Just a small thing. I would replace your SetupScript with this. So this way, in the declare players, doesnt matter if they capitalize it wont matter.


procedure SetupScript;
var
v: string;
begin
v:= GetPage('http://scardevreflection.googlecode.com/svn/trunk/RSBuild.txt');
if not (RSBuild = StrToInt(GetNumbers(v))) then UpdateHooks;
DeclarePlayers;
For i := 0 to howmanyplayers - 1 do
begin
Players[I].Strings[1] := LowerCase(Players[I].Strings[1];
Players[I].Strings[3] := LowerCase(Players[I].Strings[3];
end;
LoginPlayer;
Wait(800+Random(200));
end;


I'll do that but I have one question.
if (Players[CurrentPlayer].Strings[1] = 'Even') then
Would I have to make that 'even'? And everything else that Strings[1] & Strings[3]? (Make em all lowercase)?

ZephyrsFury

2009-06-25 04:49:44

From: TRiLeZ
I'll do that but I have one question.
if (Players[CurrentPlayer].Strings[1] = 'Even') then
Would I have to make that 'even'? And everything else that Strings[1] & Strings[3]? (Make em all lowercase)?


You make them whatever you want users of your script to enter in DeclarePlayers. You could however go:


if (Lowercase(Players[CurrentPlayer].Strings[1]) = 'even')) then

That way no matter what case people type it in, your statement will work.

senrath

2009-06-25 04:49:46

From: TRiLeZ
I'll do that but I have one question.
if (Players[CurrentPlayer].Strings[1] = 'Even') then
Would I have to make that 'even'? And everything else that Strings[1] & Strings[3]? (Make em all lowercase)?


Yeah. That's generally a better way to do it (having all string comparisons in lowercase, and forcing any user input to lowercase) so that it doesn't matter if they were to write Even or even.

Edit: Ninja'd!

TRiLeZ

2009-06-25 05:01:09

Strings[1] and Strings[3] are now not case sensitive :)
I was gonna do this one day, but didnt then I forgot to and now I have finally did it :)

Griff

2009-06-25 05:07:24

From: TRiLeZ
I have examined my way and your way and its makes sence to me that your way works better so I changed my way to your way. As I stated in my last post. Thanks for telling me how to fix the problem.


That's the kind of good attitude I was talking about in an earlier post. Good work fixing that. You will make a valuable member :)

TRiLeZ

2009-06-25 05:15:19

When i get annoyed, my attitude goes bad for a while sometimes. I usually get annoyed when Im playing COD 5 with tons of noobs which makes me loose and die a whole bunch of times and not gain any exp.
I usually have a good attitude when Im on villavu.
COD 5 made me have a bad attitude today. Sorry about that.

ZaSz

2009-06-25 06:32:02

Whoops I forgot to finish the ) on my version add the ")"'s before both the ";"'s
so it will compile lol

Naike

2009-07-05 04:16:04

Bump.

and btw, yes..

Wizzup?

2009-07-05 04:34:05

From: ZephyrsFury
You're just lucky if it works because thats not he way to do it. The and statement is used to compare two boolean statements or as a bitwise operator. You can't go:


if 1 < (2 and 3) then

Its just not how its supposed to work.


Actually, you can, if you know what you are doing. In this case you perform an and operation on 2 and 3, and then result to true if it is greater than 1.

Hobbit

2009-07-08 20:03:54

16 Yes
4 No

IN!

Welcome to members.