SRL Archive - Archive

SRLKing - SRL Member Application


King

2013-02-09 00:51:26

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


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?
Main


What is your general programming knowledge?
I know basic Java, C+ and Moderate Pascal


Are you a member of any other communities?
I have accounts on Sythe and Powerbot


Tell us about yourself…
From: SRLKing
Hi, I'm Thomas DeWaters. I'm 16 years old and live in Howell MI. I play varsity baseball (Pitch) and love technology. I want to be an Orthopedic surgeon and Attend University of Chicago for pre-med, then Johns Hopkins for med school. I play call of duty, love to hangout with my girlfriend and lurk the SRL forums(;



Please show us one (or multiple) of your scripts.
//http://villavu.com/forum/showthread.php?t=95161

//Link to my thread for setup instructions, uploading a video as we speak for setup.

//E* Updated with member suggestions, still working on all that was said(:

program KingsWaterfiends; //Made by SRLKing V0.5
{$Define smart8}
{$i srl/srl.simba}
{$I SRL/srl/skill/fighting.Simba}
{$i sps/sps.simba}
{$i ObjectDTM\ObjDTMInclude.simba}
{$i 3DProjection.simba}

type
MSObject = record
Col, Tol, TPADist, MinCount: Integer;
Hue, Sat: Extended;
Uptext: TStringArray;
MMDot: string;
end;

type
ProggyVars = record
CurrentXP, OriginalXP, OriginalCrimson, OriginalBlue, OriginalGreen, OriginalGold, Crimson, Blue, Green, Gold: Integer;
XPGain, LoadsDone, XPPerHour: array of Integer;
TimeGone, LoadsPerHour, CharmsPerHour1, CharmsPerHour2, CharmsPerHour3, CharmsPerHour4: array of Integer;
CrimsonGain, BlueGain, GreenGain, GoldGain: array of Integer;
end;

var
LoadsToDo, GamesNecklace, ROD, BunyipPouch: Integer;
MonstersKilled, x, y, t, b, InvCounts, CurrentHP: Integer;
ReplaceGamesNecklace, ReplaceRingofDuelling, ReplaceSummoningPouch, OutOfPotions: Boolean;
colorsign: string;
WaterFiend: MSObject;
Proggy: ProggyVars;
BreakRounds, TotalBreaks: Integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '*********'; //Username to log in
Pass := '*********'; //Password to log in
Active := True; //Will we be using this player?
Pin := '*********'; //Pin
Nick := ''; //NickName for progress reports(Will be added)
end;
end;

{ with Players[1] do // Uncomment to add players
begin
Name := '*********';
Pass := '*********';
Active := True;
Pin := '*********';
Nick := '';
end;
end;

with Players[2] do
begin
Name := '*********';
Pass := '*********';
Active := True;
Pin := '*********';
Nick := '';
end;
end;

with Players[3] do
begin
Name := '*********';
Pass := '*********';
Active := True;
Pin := '*********';
Nick := '';
end;
end; }

const
//-------------------Script Settings-------------------//

TripsToDo = 5; //Trips to make to the cave and back

FoodType = 'Shark'; //Exact name of the food being used

Potions = 'True';//True = Will use False = will not use

PotionToUse = 'Ranging potion'; //Name of the potion exactly as seen in game

LevelToPot = 95; //Level to redrink pots at.

HpToEatAt = 5000; // Hp to eat at

FoodToBring = 20; // Amount of food to bring

FoodBound = '-'; //key that is bound to your food slot.

PotionBoundKey = '0'; //Key that is bound to your ranging potion/overload ect.

Bunyip = 'True';//True = use summoning, False = dont use summoning

RechargeSummoningLevel = 30;// Level to recharge summoning points at

UseUltimateAbilities = 'False';//True, does not use Threshold and uses ultimate abilities,
//False Uses threshold and not ultimate abilities
UseFairyRing = 'True';// Teleport using fairy rings and bank in zanaris? Not implemented yet.


//-------------------Ability Settings-------------------//

// Use 750 if no wait time is listed (Ex Piercing shot), If a wait time is listed (Rapid Fire, multiply the number of
// Seconds by a thousand and add 200, that will be the wait time)

Basic1 = 1; //What slot for basic ability number 1
UseTimeBasic1 = 750;// Time in miliseconds (1000 = 1 Second) to use the ability

Basic2 = 2; //What slot for basic ability number 2
UseTimeBasic2 = 750;// Time in miliseconds (1000 = 1 Second) to use the ability

Basic3 = 3; //What slot for basic ability number 3
UseTimeBasic3 = 3200;// Time in miliseconds (1000 = 1 Second) to use the ability

Basic4 = 4; //What slot for basic ability number 4
UseTimeBasic4 = 750;// Time in miliseconds (1000 = 1 Second) to use the ability

ThreshHold1 = 5; //What slot for ThreshHold ability number 1
UseTimeThreshHold1 = 750;// Time in miliseconds (1000 = 1 Second) to use the ability

ThreshHold2 = 7; //What slot for ThreshHold ability number 3
UseTimeThreshHold2 = 6200;// Time in miliseconds (1000 = 1 Second) to use the ability

Ultimate1 = 8; //What slot for Ultimate ability number 1
UseTimeUltimate1 = 6200;// Time in miliseconds (1000 = 1 Second) to use the ability

Ultimate2 = 9; //What slot for Ultimate ability number 2
UseTimeUltimate2 = 750;// Time in miliseconds (1000 = 1 Second) to use the ability

//-----------------Break Setting's-------------------------------------------//

BreakAfter = 24;// When to start our break in minutes

BreakFor = 30; //How long to break for in minutes

RandomAddBreak =15;// Time to add to randomize each break in minutes



procedure LoadFigures;
begin
with WaterFiend do
begin
Col := 5390364;
Tol := 9;
TPADist := 10;
Hue := 0.31;
Sat := 1.98;
UpText := ['ack Water'];
MMDot := 'yellow';
MinCount := 40;
end;
end;

function MakeBox(x1, y1, x2, y2: Integer): TBox;
begin
Result.X1 := x1;
Result.Y1 := y1;
Result.X2 := x2;
Result.Y2 := y2;
end;

function FindMSObjects(var Coords: TPointArray; Obj: MSObject): Boolean;
var
cts, Len, i, c: Integer;
TPA: TPointArray;
ATPA: TPointArrayArray;
begin
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Obj.Hue, Obj.Sat);
Result := False;
c := 0;
if FindColorsTolerance(TPA, Obj.Col, MSX1, MSY1, MSX2, MSY2, Obj.Tol) then
begin
Result := True;
ATPA := SplitTPA(TPA, Obj.TPADist);
Len := Length(ATPA);
SetLength(Coords, Len);
for i := 0 to Len - 1 do
begin
if Length(ATPA[i]) > Obj.MinCount then
begin
Coords[c] := MiddleTPA(ATPA[i]);
Inc(c);
end;
end;
end;
SetLength(Coords, c) ColorToleranceSpeed(cts);
SetColorSpeed2Modifiers(0.2, 0.2);
end;

function FindRedBar: Boolean;
var
RedBarDTM1, RedBarDTM2, RedBarDTM3: Integer;
begin
Result := False;
RedBarDTM1 := DTMFromString('mlwAAAHicY2dgYDBnZmCQBWIZKB0ExQpA3AiUr2OA0C1QDOPvZOBgsGZnwsBdDIwM+AAjHgwFAAvPB5w={mlwAAAHicY2dgYDBnZmCQBWIZKB0ExQpA3AiUr2OA0C1QDOPvZOBgsGZnwsBdDIwM+AAjHgwFAAvPB5w=}');
RedBarDTM2 := DTMFromString('mlwAAAHicY2dgYDBnZmCQBWIZKB0ExQpA3AiUr2OA0C1QDOPvZOBgsGZnwsBdDIwM+AAjHgwFAAvPB5w={mlwAAAHicY2dgYDBnZmCQBWIZKB0ExQpA3AiUr2OA0C1QDOPvZOBgsGZnwsBdDIwM+AAjHgwFAAvPB5w=}');
RedBarDTM3 := DTMFromString('mbQAAAHicY2VgYFAHYicg5oay1YCYEwmzATEPEO9k4GCwZmdCwXJAcS40zIgFgwEAz+gDEA==');
if FindDTM(RedBarDTM1, X, Y, MSX1, MSY1, MSX2, MSY2) or FindDTM(RedBarDTM2, X, Y, MSX1, MSY1, MSX2, MSY2) or FindDTM(RedBarDTM3, X, Y, MSX1, MSY1, MSX2, MSY2) then
begin
SMART_DrawBoxEx(false, false, IntToBox(X - 30, Y - 10, X + 30, Y + 10), ClYellow);
Wait(50);
SMART_ClearCanvasArea(IntToBox(0, MSY1, 520, MSY2 + 50));
Result := True;
end;
FreeDTM(RedBarDTM1);
FreeDTM(RedBarDTM2);
FreeDTM(RedBarDTM3);
end;

procedure Looting();
begin
if (FindRedBar) then
begin
wait(RandomRange(1100, 1200));
if (FindRedBar) then
wait(RandomRange(150, 200));
MMouse(X + random(1), Y + 21, 0, 0);
wait(RandomRange(800, 1200));
ClickMouse2(False);
WaitOptionMulti(['ake Crims', 'ake Gold c', 'ake Green', 'ake Blue c', 'ake Sea', 'ake Water or', 'ake Snap', 'ake Shar', 'ake Mithril', 'une elm'], 1000);
wait(RandomRange(400, 600));
repeat
wait(RandomRange(200, 400));
until (not IsMoving)
repeat
wait(RandomRange(500, 750));
MMouse(262, 178, 0, 0);
ClickMouse2(False);
until (not (WaitOptionMulti(['ake Crims', 'ake Gold c', 'ake Green', 'ake Blue c', 'ake Sea', 'ake Water or', 'ake Snap', 'ake Shar', 'ake Mithril', 'une elm'], 1000)));
end
else
begin
exit;
writeln('No Red Bar Detected');
end;
end;

{******************************************************************************* //Credit to Echo_
function BreakHandler(BreakIn, BreakFor, randBreakIn, randBreakFor: Integer): Boolean;
By: Echo_
Description: Takes brakes according to the minute values entered
*******************************************************************************}
function BreakHandler(BreakIn, BreakFor, randBreakIn, randBreakFor: Integer): Boolean;
var
w, x, y, z: Integer;
begin
if not LoggedIn then Exit;

w := (BreakIn * 60000);
x := (BreakFor * 60000);
y := RandomRange(-randBreakIn * 60000, randBreakIn * 60000);
z := RandomRange(-randBreakFor * 60000, randBreakFor * 60000);

if (HowManyPlayers = 1) then
begin
if (GetTimeRunning < ((w) + (y) + BreakRounds)) then Exit
else
if (GetTimeRunning > ((w) + (y) + BreakRounds)) then
begin
Writeln('Taking a break for about ' + IntToStr(BreakFor) + ' minutes.');
Logout;
Wait((x) + (z));
Writeln('Logging in.');
LoginPlayer;
Result := LoggedIn;
FindNormalRandoms;
IncEx(BreakRounds, (w) + (x));
IncEx(TotalBreaks, 1);
Writeln('The next break will occur in about ' + IntToStr(BreakIn) + ' minutes.');
end;
end;

if (HowManyPlayers > 1) then
begin
if (GetTimeRunning < ((w) + (y) + BreakRounds)) then Exit
else
if (GetTimeRunning > ((w) + (y) + BreakRounds)) then
begin
Writeln('Taking a break for about ' + IntToStr(BreakFor) + ' minutes.');
Logout;
IncEx(BreakRounds, (w));
IncEx(TotalBreaks, 1);
NextPlayer(True);
Exit;
while (LoggedIn) do Wait((x) + (z));
NextPlayer(True);
end;
end;
end;

function FindMSObjectsByDot(var Coords: TPointArray; Obj: MSObject): Boolean;
var
BoxArr: TBoxArray;
Len, Len2, i, j, c: Integer;
TPA, TPA2: TPointArray;
begin
TPA := GetMMDotsOnMS2(Obj.MMDot, False);
Len := Length(TPA);
SetLength(BoxArr, Len);
for i := 0 to Len - 1 do
BoxArr[i] := MakeBox(TPA[i].x - 70, TPA[i].y - 70, TPA[i].x + 70, TPA[i].y + 70);
if FindMSObjects(TPA2, Obj) then
begin
Len2 := Length(TPA2);
SetLength(Coords, Len2);
c := 0;
for i := 0 to Len2 - 1 do
for j := 0 to Len - 1 do
if PointInBox(TPA2[i], BoxArr[j]) then
begin
Coords[c] := TPA2[i];
Inc(c);
Break;
end;
SetLength(Coords, c);
Result := (c > 0);
end;
end;

function FindArrow: Boolean;
var
tmpCTS: integer;
ArrowTPA: TPointArray;
begin
if not LoggedIn then
exit;
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(1.88, 1.16);
if FindColorsTolerance(ArrowTPA, 13032391, 706, 230, 730, 247, 16) then
begin
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
Result := True;
end
else
begin
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
Result := False;
end;
end;

function Fighting: Boolean;
begin
if not LoggedIn then
exit;
if not (GetCurrentTab = tab_Combat) then
begin
GameTab(tab_Combat);
wait(RandomRange(1000, 1200));
end
else
wait(RandomRange(750, 1000));
if FindArrow then
begin
writeln('We still have a target');
Result := True;
exit;
end
else
begin
Result := False;
writeln('No longer fighting');
exit;
end;
end;

function FindCaveFloor: Boolean;
var
tmpCTS: integer;
FloorTPA: TPointArray;
begin
if not LoggedIn then
exit;
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.11, 0.61);
if FindColorsTolerance(FloorTPA, 4736522, MSX1, MSY1, MSX2, MSY2, 3) then
begin
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
Result := True;
end
else
begin
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
Result := False;
end;
end;

function OpenBankCW: Boolean;
var
b, t, FailCount: Integer;
begin
if not LoggedIn then
Exit;
MarkTime(b);
repeat
MarkTime(t);
writeln('Trying to open the bank');
OpenBankChestEdge(SRL_BANK_CW);
repeat
wait(RandomRange(50, 100));
until (BankScreen or (TimeFromMark(t) > 5000) or PinScreen);
if BankScreen or PinScreen then
begin
writeln('Opened the Bank');
if PinScreen then
begin
InPin(Players[CurrentPlayer].Pin);
writeln('Inputting players pin');
end;
Result := True;
exit;
end;
if not (PinScreen or BankScreen) then
begin
writeln('Failed to find and open the bank');
Inc(FailCount);
if FailCount = 10 then
begin
Players[CurrentPlayer].Active := False;
LogOut;
Exit;
writeln('Could not open the bank');
exit;
end;
end;
until ((TimeFromMark(b) >= 25000) or BankScreen);
exit;
ClearDebug;
end;

function TeleportToCW: Boolean;
begin
if not LoggedIn then
exit;
if (not GameTab(tab_Equip)) then
begin
GameTab(tab_Equip);
end;
MouseBox(682, 369, 714, 401, 2);
WaitUptext('ing of duell', 1000);
ClickMouse2(mouse_right);
WaitOption('Castle Wars', 500);
MarkTime(t);
repeat
wait(RandomRange(50, 75));
until ((FindSymbol(x, y, Symbol_Bank)) or (TimeFromMark(t) >= 25000));
if FindSymbol(x, y, Symbol_Bank) then
begin
result := true;
writeln('We are at the bank');
if FindBlackChatMessage('Your ring of duelling crumbles to dust.') then
begin
ReplaceRingofDuelling := True;
end
else
begin
ReplaceRingofDuelling := False;
end;
if FindSymbol(x, y, Symbol_Bank) then
begin
Mouse(x, y, 2, 2, True);
end;
exit;
end
else
result := false;
writeln('Did not teleport to the bank');
end;

function Eating: Boolean;
begin
if not LoggedIn then
exit;
CurrentHP := GetMMLevels('hp', colorsign);
wait(RandomRange(50, 150));
if CurrentHP < HpToEatAt then
begin
SendKeys(FoodBound, 50, 5);
begin
MarkTime(t);
repeat
wait(RandomRange(30, 60));
until ((CurrentHP < GetMMLevels('hp', colorsign)) or (TimeFromMark(t) >= 6000));
if GetMMLevels('hp', colorsign) > HpToEatAt then
begin
Result := True;
exit;
end
else
begin
if (GetMMLevels('hp', colorsign) < 2000) then
begin
TeleportToCW;
writeln('Banking because we are out of food and low on health');
exit;
end;
Result := False;
exit;
end;
end;
end
else
begin
exit;
end;
end;

function CheckPotLevel: Boolean;
begin
if not LoggedIn then
begin
exit;
end
else if (OutOfPotions = true) then
begin
exit;
end
else if (Potions = 'True') then
begin
if (GetSkillInfo('range', true) < LevelToPot) then
begin
SendKeys(PotionBoundKey, 50, 20);
wait(RandomRange(750, 1000));
if (GetChatBoxText(8, clMessage) = 'You dont have any left!') then
begin
OutOfPotions := True;
exit;
end
else if (GetSkillInfo('range', true) > LevelToPot) then
begin
result := true;
exit;
end
else
begin
result := false;
exit;
end;
end
else
begin
exit;
end;
end
else
begin
exit;
end;
end;

procedure ReturnToMainPoint;
var
ReturnHome: TPoint;
begin
if not LoggedIn then
exit;
ReturnHome := Point(165, 165);
SPS_WalkToPos(ReturnHome);
end;

function FindWaterFiend: boolean;
var
TPA: TPointArray;
i, TPAlen, x, y, FailCount: Integer;
begin
if not LoggedIn then
exit;
if Fighting then
begin
writeln('Already in a fight');
Result := True;
exit;
end
else
repeat
if FindMSObjectsByDot(TPA, WaterFiend) then
begin
TPAlen := Length(TPA);
SortTPAFrom(TPA, Point(MMCX, MMCY));
for i := 0 to TPAlen - 1 do
begin
MMouse(TPA[i].x, TPA[i].y, 5, 5);
if WaitUpTextMulti(WaterFiend.UpText, 150) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
if DidYellowClick then
begin
WriteLn('Missed the waterfiend');
Result := False;
Exit;
end;
if GetColor(x, y) = 65278 then
begin
FFlag(2);
Wait(RandomRange(450, 500));
end
else if Fighting then
begin
Result := True;
exit;
end;
end;
end;
end
else
begin
writeln('Did not find waterfiend');
Inc(FailCount);
end;
until (Fighting or (FailCount >= 5));
if (FailCount >= 5) then
begin
ReturnToMainPoint;
exit;
end;
end;

function TeleportToBarb: Boolean;
var
x, y, t, b, Failcount: Integer;
begin
if not LoggedIn then
exit;
if not (GetCurrentTab = tab_Inv) then
begin
GameTab(tab_Inv);
wait(RandomRange(1000, 1500));
end
else
MarkTime(t);
Failcount := 0;
GamesNecklace := DTMFromString('mbQAAAHicY2VgYBAGYgUgVgRiASiWB2JuIJYGYkkgVgViQZE6IMmEguUYMAEjFgwGAIVvAcs=');
if FindDTM(GamesNecklace, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
writeln('Found Necklace');
MMouse(x, y, 2, 2);
wait(RandomRange(150, 200));
if IsUpText('ecklace') then
begin
MarkTime(b);
ClickMouse2(mouse_Right);
WaitOption('Rub', 500);
wait(RandomRange(1500, 2500));
SendKeys('2', 50, 25);
if FindBlackChatMessage('Your games necklace crumbles to dust.') then
begin
ReplaceGamesNecklace := True;
end;
wait(RandomRange(5000, 5500));
repeat
wait(RandomRange(35, 60))
until (FindSymbol(x, y, Symbol_Fish) or (TimeFromMark(b) >= 50000));
result := true;
writeln('We are at the Barbarian outpost');
FreeDTM(GamesNecklace);
exit;
end
else
begin
result := false;
writeln('We are not at the Barbarian outpost');
FreeDTM(GamesNecklace);
Players[CurrentPlayer].Active := False;
LogOut;
exit;
end;
end
else
begin
writeln('Cannot find games necklace');
FreeDTM(GamesNecklace);
Players[CurrentPlayer].Active := False;
LogOut;
exit;
end;
end;

procedure WalkToObelisk;
begin
if not LoggedIn then
exit;
ObjDTM_WalkPath(['139:58:3:5:7:87:48:1:7:113:135:1:7:67:139', '94:88:4:1:7:116:63:1:7:108:75:1:7:100:101:1:7:125:87'], 0, 100, 5, False, True);
end;

function FindObelisk: Boolean;
var
tmpCTS, i, l, r, counter: integer;
ObeliskTPA: TPointArray;
begin
if not (loggedin) then
exit;
MakeCompass('E');
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.33, 0.42);
FindColorsTolerance(ObeliskTPA, 4874597, MSX1, MSY1, MSX2, MSY2, 8);
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
L := High(ObeliskTPA) marktime(counter);
for i := 0 to L do
begin
r := random(L);
wait(randomrange(60, 200));
mmouse(ObeliskTPA[r].x, ObeliskTPA[r].y, 2, 2);
if waituptext('obelisk', 300) then
Break;
if timefrommark(counter) > 3000 then
begin
writeln('Failed to find the Obelisk');
Players[CurrentPlayer].Active := False;
LogOut;
exit;
end;
end;
writeln('Found the Obelisk');
clickmouse2(mouse_right);
WaitOption('Renew', 500);
end;

procedure CheckSummoningPoints;
begin
if not LoggedIn then
exit;
if (GetMMLevels('summon', colorsign) <= RechargeSummoningLevel) then
begin
WalkToObelisk;
FindObelisk;
end
else
begin
exit;
end;
end;

function AtDock: Boolean;
begin
if not LoggedIn then
exit;
Result := ObjDTM_InArea('82:76:5:3:7:86:23:3:7:69:31:5:7:106:104:5:7:98:104:5:7:106:96:4:61:39:63:95:109:98:102:40', True);
end;

function WalkToAncientCavern: Boolean;
begin
if not LoggedIn then
exit;
ObjDTM_WalkPath(['78:134:3:1:7:79:60:1:7:94:110:1:7:75:115:4:44:64:130:67:119:112:53:105', '74:131:4:1:7:75:83:1:7:99:64:3:7:50:99:1:7:83:103', '67:125:5:3:7:31:84:3:7:73:134:1:7:79:87:1:7:67:64:1:7:80:64', '70:140:3:3:7:84:91:3:7:73:119:3:7:66:92'], 0, 100, 5, False, True);
if FindSymbol(x, y, Symbol_Dungeon) then
begin
Mouse(x, y, 2, 2, True);
wait(RandomRange(3000, 4000));
end;
if AtDock then
begin
result := True;
writeln('We are at the dock to the ancient caverns');
exit;
end
else
begin
result := False;
writeln('We did not arrive at the cavern, exiting');
Players[CurrentPlayer].Active := False;
LogOut;
exit;
end;
end;

function DiveIntoPool: Boolean;
begin
if not LoggedIn then
exit;
if AtDock then
begin
MarkTime(t);
MakeCompass('S');
SetAngle(SRL_ANGLE_HIGH);
wait(RandomRange(500, 1000));
Mouse(241, 135, 5, 5, True);
repeat
wait(RandomRange(100, 150));
until (FindCaveFloor or (TimeFromMark(t) > 25000));
result := true;
writeln('Found the cave floor');
exit;
end
else
begin
writeln('Not at the dock');
result := false;
Players[CurrentPlayer].Active := False;
LogOut;
exit;
end;
end;

procedure UseBasicAbility;
begin
if not LoggedIn then
exit;
if (not Fighting) then
begin
exit;
end
else
begin
case Random(3) of
0:
if UseAbility(Basic1) then
begin
MarkTime(t)
repeat
wait(RandomRange(10, 20));
until ((TimeFromMark(t) >= UseTimeBasic1) or not Fighting);
exit;
end;
1:
if UseAbility(Basic2) then
begin
MarkTime(t)
repeat
wait(RandomRange(10, 20));
until ((TimeFromMark(t) >= UseTimeBasic2) or not Fighting);
exit;
end;
2:
if UseAbility(Basic3) then
begin
MarkTime(t)
repeat
wait(RandomRange(10, 20));
until ((TimeFromMark(t) >= UseTimeBasic3) or not Fighting);
exit;
end;
3:
if UseAbility(Basic4) then
begin
MarkTime(t)
repeat
wait(RandomRange(10, 20));
until ((TimeFromMark(t) >= UseTimeBasic4) or not Fighting);
exit;
end;
end;
end;
exit;
end;

procedure UseThreshHoldAbilities;
begin
if not LoggedIn then
exit;
if (not Fighting) then
begin
exit;
end
else
begin
case Random(1) of
0:
if UseAbility(ThreshHold1) then
begin
MarkTime(t)
repeat
wait(RandomRange(10, 20));
until ((TimeFromMark(t) >= UseTimeThreshHold1) or not Fighting);
exit;
end;
1:
if UseAbility(ThreshHold2) then
begin
MarkTime(t)
repeat
wait(RandomRange(10, 20));
until ((TimeFromMark(t) >= UseTimeThreshHold2) or not Fighting);
exit;
end;
end;
end;
exit;
end;

procedure UseUltimateAbility;
begin
if not LoggedIn then
exit;
if (not Fighting) then
begin
exit;
end
else
begin
case Random(10) of
0..4:
if UseAbility(Ultimate1) then
begin
MarkTime(t)
repeat
wait(RandomRange(10, 20));
until ((TimeFromMark(t) >= UseTimeUltimate1) or not Fighting);
exit;
end;
5..10:
if UseAbility(Ultimate2) then
begin
MarkTime(t)
repeat
wait(RandomRange(10, 20));
until ((TimeFromMark(t) >= UseTimeUltimate2) or not Fighting);
exit;
end;
end;
end;
exit;
end;

procedure UseAbilities;
begin
if not LoggedIn then
exit;
if (not Fighting) then
begin
exit;
end
else
begin
if (GetAdrenalinePercent < 50) then
begin
writeln('Using Basic Ability');
UseBasicAbility;
exit;
end
else if (GetAdrenalinePercent = 100) then
begin
writeln('Using Ultimate Ability');
UseUltimateAbility;
exit;
end
else
begin
if (UseUltimateAbilities = 'True') then
begin
exit;
end
else if (GetAdrenalinePercent >= 50) then
begin
writeln('Using ThresholdAbility');
UseThreshHoldAbilities;
exit;
end
else
exit;
end;
end;
exit;
end;

procedure FightFiends;
begin
if not LoggedIn then
exit;
CurrentHP := GetMMLevels('hp', colorsign);
begin
if (not Fighting) then
begin
FindWaterFiend;
writeln('looking for a waterfiend');
exit;
end
else if Fighting then
begin
writeln('In a fight');
MarkTime(x);
repeat
Looting;
Eating;
Looting;
UseAbilities;
Looting;
until (not Fighting or (TimeFromMark(x) > 25000000));
Looting;
Inc(MonstersKilled);
end;
end;
end;

procedure ClimbDownStepsCave;
begin
if not LoggedIn then
exit;
MMouse(69, 194, 5, 5);
wait(RandomRange(1000, 2000));
if IsUpText('limb') then
begin
ClickMouse2(True);
MarkTime(b);
repeat
wait(RandomRange(50, 70));
until (IsMoving or (TimeFromMark(b) >= 25000));
MarkTime(t);
repeat
wait(RandomRange(50, 70));
until (not IsMoving or (TimeFromMark(t) >= 25000));
end;
end;

function CheckFamiliarActive: Boolean;
begin
if not LoggedIn then
exit;
if FindColorSpiralTolerance(x, y, 9485404, 691, 153, 720, 180, 19) then
begin
writeln('We have a bunyip still');
result := true;
exit;
end
else
begin
writeln('We do not have a bunyip');
result := false;
exit;
end;
end;

procedure Banking;
begin
if not LoggedIn then
exit;
BunyipPouch := DTMFromString('mbQAAAHicY2VgYBAAYnkgZgJiQSCWhoqJAbEIVI4LiP18TaCqEFiOARMwYsFgAAB+mwHA');
GamesNecklace := DTMFromString('mbQAAAHicY2VgYBAGYgUgVgRiASiWB2JuIJYGYkkgVgViQZE6IMmEguUYMAEjFgwGAIVvAcs=');
if BankScreen then
begin
Deposit(2, 24, true);
repeat
wait(RandomRange(50, 70));
until ((InvCount <= 5) or (TimeFromMark(t) > 6500));
begin
if ((ReplaceGamesNecklace = true) or (not FindDTM(GamesNecklace, x, y, MIX1, MIY1, MIX2, MIY2))) then
begin
InvCounts := InvCount;
SearchBank('Games necklace');
wait(randomrange(1000, 2000));
Withdraw(0, 0, 1);
MarkTime(t);
repeat
wait(randomrange(50, 200));
until ((InvCounts < InvCount) or (TimeFromMark(t) >= 6500));
if InvCounts < InvCount then
end;
FreeDTM(GamesNecklace);
end;
if (ReplaceRingofDuelling = true) then
begin
InvCounts := InvCount;
SearchBank('Ring of duelling');
wait(randomrange(1000, 2000));
Withdraw(0, 0, 1);
MarkTime(t);
repeat
wait(randomrange(50, 200));
until ((InvCounts < InvCount) or (TimeFromMark(t) >= 6500));
if InvCounts < InvCount then
end;
if (CheckFamiliarActive = false) then
begin
ReplaceSummoningPouch := true;
end
else
begin
ReplaceSummoningPouch := False;
end;
if (Bunyip = 'True') and (ReplaceSummoningPouch = true) then
begin
InvCounts := InvCount;
SearchBank('Bunyip pouch');
wait(randomrange(1000, 2000));
Withdraw(0, 0, 1);
MarkTime(t);
repeat
wait(randomrange(50, 200));
until ((InvCounts < InvCount) or (TimeFromMark(t) >= 6500));
if InvCounts < InvCount then
end;
FreeDTM(BunyipPouch);
if (Potions = 'True') then
begin
InvCounts := InvCount;
SearchBank(PotionToUse);
wait(randomrange(1000, 2000));
Withdraw(0, 0, 1);
MarkTime(t);
repeat
wait(randomrange(50, 200));
until ((InvCounts < InvCount) or (TimeFromMark(t) >= 6500));
if InvCounts < InvCount then
end;
begin
InvCounts := InvCount;
SearchBank(FoodType);
wait(randomrange(1000, 2000));
Withdraw(0, 0, FoodToBring);
MarkTime(t);
repeat
wait(randomrange(50, 200));
until ((InvCounts < InvCount) or (TimeFromMark(t) >= 6500));
if InvCounts < InvCount then
end;
CloseBank;
MarkTime(t);
repeat
wait(50)
until ((not BankScreen) or (TimeFromMark(t) >= 6500));
wait(randomrange(500, 1000));
exit;
end;
end;

function AtBank: Boolean;
begin
if not LoggedIn then
exit;
if FindSymbol(x, y, 'bank') then
begin
Result := True;
writeln('We are at the bank');
exit;
end
else
begin
writeln('We are not at the bank');
Result := False;
exit;
end;
end;

procedure WalkToFiends;
begin
if not LoggedIn then
exit;
Mouse(667, 50, 5, 5, True);
MarkTime(b);
repeat
wait(RandomRange(50, 70));
until (IsMoving or (TimeFromMark(b) >= 8000));
MarkTime(t);
repeat
wait(RandomRange(50, 70));
until (not IsMoving or (TimeFromMark(t) >= 8000));
end;

procedure EquipROD;
begin
if not LoggedIn then
exit;
ROD := DTMFromString('mlwAAAHicY2dgYBAFYh4gFgNibigtAMRcUCwFxBJAzAvEbEAsDsTCIDUVIJIRK5ZjwA2w64BgKAAAtAEBuQ==');
if FindDTM(ROD, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
wait(RandomRange(1000, 2000));
Mouse(x, y, 5, 5, True);
end
else
begin
FreeDTM(ROD);
writeln('We could not find a ROD to equip');
Players[CurrentPlayer].Active := False;
LogOut;
exit;
end;
FreeDTM(ROD);
end;

procedure Setup;
begin
if not LoggedIn then
exit;
if (not IsActionBarOpen) then
begin
writeln('Opening the action bar');
ToggleActionBar(True);
end;
if (not IsActionBarLocked) then
begin
writeln('Locking the action bar');
ToggleActionBarLock(True);
end;
writeln('Done with setup, action bar is showing and locked');
end;

procedure SummonBunyip;
begin
if not LoggedIn then
exit;
BunyipPouch := DTMFromString('mbQAAAHicY2VgYJACYmkglgBidSDmAmJRIGYDYiWouBgQV9SkAkkmFCzHgAkYsWAwAACwEQJz');
begin
if not (GetCurrentTab = tab_Inv) then
begin
GameTab(tab_inv);
wait(randomrange(250, 500));
end;
if (Bunyip = 'True') then
begin
if FindDTM(BunyipPouch, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 0, 0, false);
WaitOption('Summon', 500);
wait(randomrange(1000, 1500));
if (CheckFamiliarActive = True) then
begin
writeln('Summoned Bunyip');
FreeDTM(BunyipPouch);
exit;
end
else
begin
writeln('Did not summon bunyip');
FreeDTM(BunyipPouch);
exit;
end;
end
else
begin
writeln('Could not find the Bunyip pouch, exiting summoning');
FreeDTM(BunyipPouch);
exit;
end;
end
else
begin
FreeDTM(BunyipPouch);
exit;
end;
end;
end;

procedure LoadProggyVariables;
begin
proggy.OriginalXP := GetXPBar(1);
proggy.OriginalCrimson := GetAmountBox(InvBox(25));
proggy.OriginalBlue := GetAmountBox(InvBox(26));
proggy.OriginalGreen := GetAmountBox(InvBox(27));
proggy.OriginalGold := GetAmountBox(InvBox(28));
Proggy.Crimson := GetAmountBox(InvBox(25));
Proggy.Blue := GetAmountBox(InvBox(26));
Proggy.Green := GetAmountBox(InvBox(27));
Proggy.Gold := GetAmountBox(InvBox(28));
Proggy.CurrentXP := GetXPBar(1);
end;

procedure ProggyReport;
begin
Proggy.TimeGone[CurrentPlayer] := (GetTimeRunning / 1000);
Proggy.CrimsonGain[CurrentPlayer] := (Proggy.Crimson - proggy.OriginalCrimson);
Proggy.BlueGain[CurrentPlayer] := (Proggy.Blue - proggy.OriginalBlue);
Proggy.GreenGain[CurrentPlayer] := (Proggy.Green - proggy.OriginalGreen);
Proggy.GoldGain[CurrentPlayer] := (Proggy.Gold - proggy.OriginalGold);
Proggy.XPGain[CurrentPlayer] := (proggy.CurrentXP - proggy.OriginalXP);
Proggy.XPPerhour[CurrentPlayer] := (3600 * (Proggy.XPGain[CurrentPlayer])) / ((Proggy.TimeGone[CurrentPlayer]));
Proggy.LoadsPerhour[CurrentPlayer] := (3600 * (proggy.LoadsDone[CurrentPlayer])) / ((Proggy.TimeGone[CurrentPlayer]));
Proggy.CharmsPerHour1[CurrentPlayer] := (3600 * (Proggy.CrimsonGain[CurrentPlayer])) / ((Proggy.TimeGone[CurrentPlayer]));
Proggy.CharmsPerHour2[CurrentPlayer] := (3600 * (Proggy.BlueGain[CurrentPlayer])) / ((Proggy.TimeGone[CurrentPlayer]));
Proggy.CharmsPerHour3[CurrentPlayer] := (3600 * (Proggy.GreenGain[CurrentPlayer])) / ((Proggy.TimeGone[CurrentPlayer]));
Proggy.CharmsPerHour4[CurrentPlayer] := (3600 * (Proggy.GoldGain[CurrentPlayer])) / ((Proggy.TimeGone[CurrentPlayer]));
end;

procedure SetArrayLengths;
begin
SetArrayLength(proggy, HowManyPlayers);
end;

procedure Progressreport;
var
i: Integer;
begin
if not LoggedIn then
begin
exit;
end;
GameTab(tab_Inv);
if Proggy.LoadsDone[CurrentPlayer] mod 5 = 0 then
ClearDebug;
ProggyReport;
LoadProggyVariables;
begin
Writeln('******************************************************************');
Writeln('*/////////-------------- Kings Waterfiends ---------------\\\\\\\*');
Writeln('*/////////----------____________________________----------\\\\\\\*');
Writeln('******************************************************************');
Writeln('');
for i := 0 to HowManyPlayers - 1 do
begin
Writeln('*/////////--------- Progress Report for: ' + Players[i].Nick + ' --------\\\\\\\\\*');
Writeln('*///////// Loads done: ' + IntToStr(proggy.LoadsDone[i]) + ' //// ' + IntToStr(Proggy.LoadsPerHour[i]) + ' Loads/Hour');
Writeln('*///////// XP gained: ' + IntToStr(Proggy.XPGain[i]) + ' //// ' + IntToStr(Proggy.XPPerHour[i]) + ' XP/Hour');
Writeln('*///////// Crimson charms: ' + IntToStr(Proggy.CrimsonGain[i]) + '//// ' + IntToStr(Proggy.CharmsPerHour1[i]) + ' Crimson Charms/Hour');
Writeln('*///////// Blue charms: ' + IntToStr(Proggy.BlueGain[i]) + '//// ' + IntToStr(Proggy.CharmsPerHour2[i]) + ' Blue Charms/Hour');
Writeln('*///////// Green charms: ' + IntToStr(Proggy.GreenGain[i]) + '//// ' + IntToStr(Proggy.CharmsPerHour3[i]) + ' Green Charms/Hour');
Writeln('*///////// Gold charms: ' + IntToStr(Proggy.GoldGain[i]) + '//// ' + IntToStr(Proggy.CharmsPerHour4[i]) + ' Gold Charms/Hour');
Writeln('');
end;
end;
end;

procedure Login;
begin
ClearDebug;
{$IFDEF SMART}
{$IFDEF SIMBAMAJOR980}
SMART_SERVER := 6;
SMART_MEMBERS := TRUE;
SMART_SIGNED := TRUE;
SMART_SUPERDETAIL := FALSE;
{$ELSE}
SRL_SIXHOURFIX := TRUE;
SMART_FIXSPEED := TRUE;
{$ENDIF}
{$ENDIF}
DeclarePlayers;
LoginPlayer;
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
end;
begin
SRL_SixHourFix := True;
SetupSRL;
ObjDTM_Setup;
SPS_Setup(RUNESCAPE_OTHER, ['ancient_cavern']);
DeclarePlayers;
SetArrayLengths;
Login;
LoadFigures;
Setup;
repeat
repeat
OpenBankCW;
Banking;
if (ReplaceRingofDuelling = True) then
begin
EquipROD;
end
else
CheckSummoningPoints;
TeleportToBarb;
WalkToAncientCavern;
DiveIntoPool;
ClimbDownStepsCave;
WalkToFiends;
SummonBunyip;
MakeCompass('N');
repeat
FightFiends;
ProgressReport;
CheckPotLevel;
BreakHandler(BreakAfter, BreakFor, RandomAddBreak, RandomAddBreak);
until (AtBank or (CurrentHP < 2000));
Inc(LoadsToDo);
Inc(Proggy.LoadsDone[CurrentPlayer]);
if not LoggedIn then
LoginPlayer;
until ((LoadsToDo = TripsToDo) or not (LoggedIn));
NextPlayer(Players[CurrentPlayer].Active);
until (false);
end.

Press Play

2013-02-09 01:15:16

Had a quick look through the script and it looks good :) It looks like you have a good knowledge of the SRL include. One thing - I would've liked to see a record (or even the TUser record) for you progress report variables.
procedure SetArrayLengths;
begin
SetLength(TimeGone,HowManyPlayers);
SetLength(XPPerHour,HowManyPlayers);
SetLength(LoadsPerHour,HowManyPlayers);
SetLength(XPGain,HowManyPlayers);
SetLength(LoadsDone,HowManyPlayers);
SetLength(CrimsonGain,HowManyPlayers);
SetLength(BlueGain,HowManyPlayers);
SetLength(GreenGain,HowManyPlayers);
SetLength(GoldGain,HowManyPlayers);
SetLength(CharmsPerHour1,HowManyPlayers);
SetLength(CharmsPerHour2,HowManyPlayers)
SetLength(CharmsPerHour3,HowManyPlayers)
SetLength(CharmsPerHour4,HowManyPlayers)
end;
Could have been turned into,
procedure SetArrayLengths;
begin
SetLength(PlayerReport, HowManyPlayers);
end;
Also, in my opinion, would have looked neater.

Another question. A lot of the functions are credited, so I'm not sure how much of them is your own work. Utilising other member's work is good and shows knowledge, but how much knowledge - how can I know?

For now, I won't vote. Later on, I will have a look at your posts and decide afterwards :)

King

2013-02-09 01:26:41

From: -daazndagger-
Had a quick look through the script and it looks good :) It looks like you have a good knowledge of the SRL include. One thing - I would've liked to see a record (or even the TUser record) for you progress report variables.
procedure SetArrayLengths;
begin
SetLength(TimeGone,HowManyPlayers);
SetLength(XPPerHour,HowManyPlayers);
SetLength(LoadsPerHour,HowManyPlayers);
SetLength(XPGain,HowManyPlayers);
SetLength(LoadsDone,HowManyPlayers);
SetLength(CrimsonGain,HowManyPlayers);
SetLength(BlueGain,HowManyPlayers);
SetLength(GreenGain,HowManyPlayers);
SetLength(GoldGain,HowManyPlayers);
SetLength(CharmsPerHour1,HowManyPlayers);
SetLength(CharmsPerHour2,HowManyPlayers)
SetLength(CharmsPerHour3,HowManyPlayers)
SetLength(CharmsPerHour4,HowManyPlayers)
end;
Could have been turned into,
procedure SetArrayLengths;
begin
SetLength(PlayerReport, HowManyPlayers);
end;
Also, in my opinion, would have looked neater.

Another question. A lot of the functions are credited, so I'm not sure how much of them is your own work. Utilising other member's work is good and shows knowledge, but how much knowledge - how can I know?

For now, I won't vote. Later on, I will have a look at your posts and decide afterwards :)
I never really looked over records, however I can implement them!(: Also a lot of functions are credited because I used ReadySteadyGo's 3D projection include and some of it had to be actually included in the script rather than the include to get it working again(: Any questions shoot! I love the advice and reason btw!

Echo_

2013-02-09 04:18:38

I've never heard of a programming language called C+.

The script looks nice, I just see some unnecessary repetition in some spots (-daazndagger- pointed one out). Another example, the MakeBox function is unnecessary because Simba has a function called IntToBox that does the exact same thing.

function IntToBox(xs, ys, xe, ye: Integer): TBox;

I'm a hold off on voting for now, I don't know how others will feel about the script using a lot of other people's functions.

Benny

2013-02-09 04:51:05

Currently my only hesitation is just that there is a lack of activity around. I like the concept of the script as i think you have put in good effort.

I would only ask that you are more active around the forums.

I'm going to read through the script later and then decide!
Good luck otherwise!

i luffs yeww

2013-02-09 06:19:49

You need to work on your standards, for one. It was hard for me to give a proper look over it as it looks a bit ugly as is. That's not the biggest deal, but it's definitely very important to work on.

Other than that, there was a bit of poor practice that I saw. For one, you have several static waits from what I saw. Relating to that, your WaitOption calls tend to wait until a constant time. This isn't the worst thing, but I think it shows very complete knowledge of what's happening if one uses randomness in those calls. To me it shows that you understand what it does, and that you're thinking about timing and antiban together. You also had a few time-based failsafes (which are fantastic to have, and it means a lot to me that you have those), but the amount of time you wait can be extreme in a few cases. In your OpenBankCW function, you wait up to 70 seconds before exiting the loop. That seems like a bit much for opening a bank to me. (You also actually have a writeln in your Stuck function that outputs false information (says it waited 50 seconds, but the TimeFromMark check is only 30. This instance isn't a big deal, but it's poor for debugging and you're giving the user false information, albeit harmless in this case, this is poor practice.)

Another thing is that you seem to not have an entirely full knowledge of the language/library in a few spots. As people have said, there was at least one function that you made (used, actually - you gave credit to ReadySteadyGo) that already exists. And as far as the language, you have far more begin..end blocks than needed in several places, you have at least one if..then statement where you check if a bool equals true (which isn't necessary - you can just say `if bool then` rather than `if bool = true then`), and you have several Exit calls at the very end of functions, which aren't needed at all.

There may be a few other things to mention, but it's late and this is all I had time for. I won't vote (rarely do I vote; it's nothing against you), but take note of what people have said so far. Being more active is always a huge plus, as long as the activity is productive. Try to help people with their problems, try to give out general knowledge, etc. and you'll have a much better chance if you don't get in this time. And definitely work on what everyone so far has said.

:) Hope that helped a bit. Good luck.

King

2013-02-09 09:36:39

From: i luffs yeww
You need to work on your standards, for one. It was hard for me to give a proper look over it as it looks a bit ugly as is. That's not the biggest deal, but it's definitely very important to work on.

Other than that, there was a bit of poor practice that I saw. For one, you have several static waits from what I saw. Relating to that, your WaitOption calls tend to wait until a constant time. This isn't the worst thing, but I think it shows very complete knowledge of what's happening if one uses randomness in those calls. To me it shows that you understand what it does, and that you're thinking about timing and antiban together. You also had a few time-based failsafes (which are fantastic to have, and it means a lot to me that you have those), but the amount of time you wait can be extreme in a few cases. In your OpenBankCW function, you wait up to 70 seconds before exiting the loop. That seems like a bit much for opening a bank to me. (You also actually have a writeln in your Stuck function that outputs false information (says it waited 50 seconds, but the TimeFromMark check is only 30. This instance isn't a big deal, but it's poor for debugging and you're giving the user false information, albeit harmless in this case, this is poor practice.)

Another thing is that you seem to not have an entirely full knowledge of the language/library in a few spots. As people have said, there was at least one function that you made (used, actually - you gave credit to ReadySteadyGo) that already exists. And as far as the language, you have far more begin..end blocks than needed in several places, you have at least one if..then statement where you check if a bool equals true (which isn't necessary - you can just say `if bool then` rather than `if bool = true then`), and you have several Exit calls at the very end of functions, which aren't needed at all.

There may be a few other things to mention, but it's late and this is all I had time for. I won't vote (rarely do I vote; it's nothing against you), but take note of what people have said so far. Being more active is always a huge plus, as long as the activity is productive. Try to help people with their problems, try to give out general knowledge, etc. and you'll have a much better chance if you don't get in this time. And definitely work on what everyone so far has said.

:) Hope that helped a bit. Good luck.


I will definitely work on everything you pointed out! Thank you!

From: -Benny
Currently my only hesitation is just that there is a lack of activity around. I like the concept of the script as i think you have put in good effort.

I would only ask that you are more active around the forums.

I'm going to read through the script later and then decide!
Good luck otherwise!


I will be more active! I've just been fairly busy around this time with exams and Ap prep, but I have more time now, that's why I finally was able to finish it(:

From: Echo_
I've never heard of a programming language called C+.

The script looks nice, I just see some unnecessary repetition in some spots (-daazndagger- pointed one out). Another example, the MakeBox function is unnecessary because Simba has a function called IntToBox that does the exact same thing.

function IntToBox(xs, ys, xe, ye: Integer): TBox;

I'm a hold off on voting for now, I don't know how others will feel about the script using a lot of other people's functions.


I meant C sharp, it was like 1 am when I applied(:, I can also replace the 3D Object finding with ATPA finding!

Echo_

2013-02-09 13:34:28

Another thing I noticed, you call this code:
InPin(Players[0].Pin);

Then a couple lines later you call:
Players[CurrentPlayer].Active := False;

You really shouldn't use a constant index for the players array, unless your targeting a player other than the CurrentPlayer. Idk if this script is multiplayer, but each player may have a different pin and using the first line would cause the script to fail.

Also this script should probably have breakhandling, I wrote one a while back that you can use.
http://villavu.com/forum/showthread.php?t=62216

King

2013-02-09 14:58:43

From: Echo_
Another thing I noticed, you call this code:
InPin(Players[0].Pin);

Then a couple lines later you call:
Players[CurrentPlayer].Active := False;

You really shouldn't use a constant index for the players array, unless your targeting a player other than the CurrentPlayer. Idk if this script is multiplayer, but each player may have a different pin and using the first line would cause the script to fail.

Also this script should probably have breakhandling, I wrote one a while back that you can use.
http://villavu.com/forum/showthread.php?t=62216


I will put in breakhandling(: I must have just missed that! I was setting it up for multiplayer late at night!

riwu

2013-02-11 07:04:42

Some codes could be shortened, eg.

if FindColorsTolerance(ArrowTPA, 13032391, 706, 230, 730, 247, 16) then
begin
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
Result := True;
end
else
begin
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
Result := False;
end;

can be shorten to:

Result:= FindColorsTolerance(ArrowTPA, 13032391, 706, 230, 730, 247, 16);

SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);

Also, you are not utilizing the TPA if you are just checking if there's one pixel of color. The 3D projection is good so just improve on TPA usage and learn more advanced TPA functions (check the wizzyplugin tut ;))

King

2013-02-11 10:48:50

From: riwu
Some codes could be shortened, eg.

if FindColorsTolerance(ArrowTPA, 13032391, 706, 230, 730, 247, 16) then
begin
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
Result := True;
end
else
begin
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
Result := False;
end;

can be shorten to:

Result:= FindColorsTolerance(ArrowTPA, 13032391, 706, 230, 730, 247, 16);

SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);

Also, you are not utilizing the TPA if you are just checking if there's one pixel of color. The 3D projection is good so just improve on TPA usage and learn more advanced TPA functions (check the wizzyplugin tut ;))


We happen to have bad a snow day, so I will do(:! Thankyou!

King

2013-02-16 14:46:38

@riwu thanks for the help, I'm coding some today!

Hobbit

2013-02-26 11:08:15

Didn't quite make it this time but please take the advice given above to improve your script.

Feel free to try again in 4 weeks. :)

Closed