Log in

View Full Version : error on script



haseotod
10-01-2008, 07:36 AM
i recived this error when running the following script


Line 305: [Error] (16568:5): Unknown identifier 'AlmostLogout' in script

from this script

program Chickenz;
{.include SRL\SRL.scar}
{.include SRL\SRL/skill/fighting.scar}


{
*This Script is designed to fight in Lumbridge chicken pen.
*If it dies, or get lost it teles to lumbridge and walks back to pen.
*Checks hitpoints after time to time.
*Good Chicken finding.
*Picks feathers
*Detects if character is not infight
*ReLocating
*Antiban
*and SRL antirandoms ofcourse!

Please post Your proggies =]

32 bit true color and V-Bright


LLLLLLLLLLL CCCCCCCCCCCCC KKKKKKKKK KKKKKKK
L:::::::::L CCC::::::::::::C K:::::::K K:::::K
L:::::::::L CC:::::::::::::::C K:::::::K K:::::K
LL:::::::LL C:::::CCCCCCCC::::C K:::::::K K::::::K
L:::::L C:::::C CCCCCC KK::::::K K:::::KKK
L:::::L C:::::C K:::::K K:::::K
L:::::L C:::::C K::::::K:::::K
L:::::L C:::::C K:::::::::::K
L:::::L C:::::C K:::::::::::K
L:::::L C:::::C K::::::K:::::K
L:::::L C:::::C K:::::K K:::::K
L:::::L LLLLLL C:::::C CCCCCC KK::::::K K:::::KKK
LL:::::::LLLLLLLLL:::::L C:::::CCCCCCCC::::C K:::::::K K::::::K
L::::::::::::::::::::::L CC:::::::::::::::C K:::::::K K:::::K
L::::::::::::::::::::::L CCC::::::::::::C K:::::::K K:::::K
LLLLLLLLLLLLLLLLLLLLLLLL CCCCCCCCCCCCC KKKKKKKKK KKKKKKK

Lumbridge Chicken Killer


Written by:

_ _ _
| \ | | ___ __ _ __ _ __ _| |
| \| |/ _ \/ _` |/ _` |/ _` | |
| |\ | __/ (_| | (_| | (_| | |
|_| \_|\___|\__, |\__,_|\__,_|_|
|___/

Credits to Yakman for InLumby, Tarajunky for Writestatus, Mick for new playerreport and SRL devs for the SRL include ^^

Big Thanks to Killerdou who helped me to learn TPoint stuff
EDIT: Not, blackmailer... }

var
x, y, Deathss, NfmGetLoc, TeleNow, StartTime, FeatherDTM,
PlayerTime, Oh, AtcStart, FeatherPicked, ffrt, MonsterKills, HpTime,
RplayerTime, DeadBar, PenC, TheRoadC, ChurnBMP, RockCol, FightingTime,
FPickingTime, ChickenText, CheckMyHP: integer;

Versionnumber : string;

WaitNewb, WaitNoob : Extended;

RedColor : array[0..4] of integer;

TeleWait, WeAreInLumb, FirstCheck, Xzdw, WasAttacked : boolean;

CircleRoadDTM, DTMArea, TBridgeDTM, RockDTM : Integer;
RoadMP, TBridgeMP, RockMP : TDTMPointDef;
RoadSP, TBridgeSP, RockSP : array[0..2] of TDTMPointDef;
RoadDtmSkelett, TBridgeSkelett, RockSkelett : TDTM;

Function Calibrate : boolean; forward;

const
//================================================== =============//
StartPlayer = 0;
TotalPlayers = 6; //How many players are you using?
TimeForPlayer = 10; // Time for Each Player In Minutes(Random 5 minutes will be added).
Playerspeed = 15; // Mouse speed, random 3 will be added...
MaxFightTime = 15000; //maximum time what taks you to kill chicken
PickTheFeathers = True; // (-.-)
CheckForHp = True; //If Hp is lower than 100% then it rans away...(chickens hit only 0's)
HPCheckTime = 30; // How ofter to check for hp? (in seconds) // only needs setting if CheckForHp = True;
Remote_Control = False; // Use it? Use false if you don't know what it is...
MonsterTol = 9; //If Script won't find the nearest monster or doesn't find them at all then increase it(I recomend 7 or higher)
//================================================== =============//

procedure DeclarePlayers;
begin
SRLId:= '2369';
SRLPassword:= 'ywd2k8NDtB';
RCMaster := '';
CurrentPlayer := StartPlayer;
NumberOfPlayers(TotalPlayers);

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='' ;
Players[0].Skill:=''; //Strength, Attack, Random, Defense
Players[0].Active:=True;

Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Skill:=''; //Strength, Attack, Random, Defense
Players[1].Active:=false;

Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :='';
Players[2].Skill:=''; //Strength, Attack, Random, Defense
Players[2].Active:=false;

Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :='';
Players[3].Skill:=''; //Strength, Attack, Random, Defense
Players[3].Active:=false;

Players[4].Name :='';
Players[4].Pass :='';
Players[4].Nick :='';
Players[4].Skill:=''; //Strength, Attack, Random, Defense
Players[4].Active:=false;

Players[5].Name :='';
Players[5].Pass :='';
Players[5].Nick :='';
Players[5].Skill:=''; //Strength, Attack, Random, Defense
Players[5].Active:= false;

WaitNewb := (547.7225575051661134569697828008 * 547.7225575051661134569697828008);

end;

procedure LoadRoadCircle;
Begin
DTMArea := 2;
TheRoadC:= FindRoadColor;

RoadMP.x:=659;
RoadMP.y:=86;
RoadMP.areasize:=1;
RoadMP.areashape:=0;
RoadMP.color:=TheRoadC;

RoadSP[0].x:=650;
RoadSP[0].y:=88;
RoadSP[0].areasize:=DTMArea;
RoadSP[0].areashape:=0;
RoadSP[0].color:=TheRoadC;

RoadSP[1].x:=665;
RoadSP[1].y:=100;
RoadSP[1].areasize:=DTMArea;
RoadSP[1].areashape:=0;
RoadSP[1].color:=TheRoadC;

RoadSP[2].x:=667;
RoadSP[2].y:=79;
RoadSP[2].areasize:=DTMArea;
RoadSP[2].areashape:=0;
RoadSP[2].color:=TheRoadC;

RoadDTMSkelett.MainPoint:=RoadMP;
RoadDTMSkelett.SubPoints:=RoadSP;
CircleRoadDTM:=AddDTM(RoadDTMSkelett);
End;

procedure LoadTBridge;
Begin
DTMArea := 1;
TheRoadC:= FindRoadColor;

TBridgeMP.x:=682;
TBridgeMP.y:=79;
TBridgeMP.areasize:=1;
TBridgeMP.areashape:=0;
TBridgeMP.color:= TheRoadC;

TBridgeSP[0].x:= 651;
TBridgeSP[0].y:= 77;
TBridgeSP[0].areasize:=DTMArea;
TBridgeSP[0].areashape:=0;
TBridgeSP[0].color:= TheRoadC;

TBridgeSP[1].x:=680;
TBridgeSP[1].y:=67;
TBridgeSP[1].areasize:=DTMArea;
TBridgeSP[1].areashape:=0;
TBridgeSP[1].color:= FindWaterColor;

TBridgeSP[2].x:=682;
TBridgeSP[2].y:=87;
TBridgeSP[2].areasize:=DTMArea;
TBridgeSP[2].areashape:=0;
TBridgeSP[2].color:= FindWaterColor;

TBridgeSkelett.MainPoint:=TBridgeMP;
TBridgeSkelett.SubPoints:=TBridgeSP;
TBridgeDTM:=AddDTM(TBridgeSkelett);
End;

procedure LoadRock;
Begin
DTMArea := 5;
RockCol:= FindRockColor;

RockMP.x:=644;
RockMP.y:=58;
RockMP.areasize:=1;
RockMP.areashape:=0;
RockMP.color:=2462580;
RockMP.Tolerance:=50;

RockSP[0].x:= 645;
RockSP[0].y:= 58;
RockSP[0].areasize:=DTMArea;
RockSP[0].areashape:=0;
RockSP[0].color:= RockCol;

RockSP[1].x:=640;
RockSP[1].y:=62;
RockSP[1].areasize:=DTMArea;
RockSP[1].areashape:=0;
RockSP[1].color:= RockCol;

RockSP[2].x:=648;
RockSP[2].y:=65;
RockSP[2].areasize:=DTMArea;
RockSP[2].areashape:=0;
RockSP[2].color:= RockCol;

RockSkelett.MainPoint:=RockMP;
RockSkelett.SubPoints:=RockSP;
RockDTM:= AddDTM(RockSkelett);
End;



//=== Tara's Writestatus==//

Procedure WriteStatus(word:string);
var Sec,rate:integer;
begin
Sec:= (1+((Getsystemtime-StartTime)/1000));
Rate:=(3600*(MonsterKills))/(Sec);
Status('Kill rate - '+IntToStr(rate)+'/hr --- '+word);
end;

//Some word database by Tarajunky
procedure TalkToMeBaby;
begin
if not loggedin then exit;
case random(150) of
0 : Typesend('Hey');
1 : Typesend('can i have your feathers');
2 : Typesend('haha');
3 : Typesend('gotta lvl my prayer soon');
4 : Typesend('im training my hitpoints');
5 : Typesend('ure a noob');
6 : Typesend('begone newbs');
7 : Typesend('pray lvls');
8 : Typesend('cook lvls');
9 : Typesend('I really want a zombi random');
10 : Typesend('i hate pures');
11 : Typesend('chickens are wussy like ...');
12 : Typesend('chickens cant kill u');
13 : Typesend('prayer takes forever');
14 : Typesend('stop it');
15 : Typesend('lol');
16 : Typesend('stupid eggs in the way');
17 : Typesend('get lost noob');
18 : Typesend('dont be stoopid');
19 : Typesend('i hate stupid random events');
20 : Typesend('i like feathers');
21 : Typesend('i luv this game');
22 : Typesend('rofl');
23 : begin
Typesend('ahh!');
wait(2000 + random(3000));
Typesend('I just broke an egg!');
end;
24 : Typesend('Str lvls?');
25 : Typesend('Dutch?');
end;
FTwait(4);
end;


Procedure Ban;
Begin
if not loggedin then exit;
case random(30) of
0: Setrun(true);
1: case random(4) of
0 : HoverSkill('Attack', false);
1 : HoverSkill('Strength', false);
2 : HoverSkill('Defence', false);
3 : HoverSkill('Hitpoints', false);
end;
2: AlmostLogout;
3: HoverSkill('random', false);
4: MMouse(random(600),random(400),0,0);
5: mmouse(msx1+random(msx2),msy1+random(msx2),0,0);
6: begin
x := random(600);
y :=random(400);
FindColorSpiralTolerance(x,y,1 + random(16581374), msx1, msy1, msx2, msy2,30);
Mouse(x,y,1,1,false);
ChooseOption('xamine');
end;
7: gameTab(1+random(12));
8: begin
pickupmouse;
wait(5000+ random(10000));
pickupmouse;
end;
9: SleepAndMoveMouse(5000 + random(5000));
10: RandomRClick;
11: TalkToMeBaby;
end;
end;

procedure FindnormalrandomsTime;
var time1, time2 : longint;
begin
if not loggedin then exit;
wait(100);
Time1 := getsystemtime
findnormalrandoms;
time2:= getsystemtime
writestatus('FNRandoms took '+inttostr(time2 - time1)+'ms');
wait(100);
end;

//===Max flag time is decreased to 5 sec===//
function MyFlag: Boolean;
var
timeout, x, y: Integer;
begin
if (FindColor(x, y, 255, MMX1, MMY1, MMX2, MMY2)) then
begin
Result := True;
repeat
wait(100);
timeout := timeout + 1;
until (not FindColor(x, y, 255, MMX1, MMY1, MMX2, MMY2)) or (timeout > 49);
writestatus('Flag ended');
FTwait(1);
Wait(250);
end;
end;


function FindPencolor : Boolean;
var px, py, Tries : integer;
begin
if not loggedin then Exit;
if PenC > 0 then exit;
Tries := 0;
if FindSymbolIn(px, py, 'Churn', mmx1, 50, mmx2, mmx2) then
begin
repeat
PenC:= GetSymbolColorIn(px, py, 'Churn', mmx1, 50, mmx2, mmy2)
Writeln('ChurnSymbolColor by GetSymbolColor = '+intToStr(penc));
if PenC > 0 then break;
if not LoggedIn then Exit;
wait(1000);
until(Tries > 2);
end else
begin
repeat
PenC:= AutoColorThis(ChurnBmp, 9, mmX1, 60, mmX2, mmY2);
Writeln('ChurnSymbolColor by AutoColorBMP = '+intToStr(penc));
if penc > 0 then break;
Tries:= Tries + 1;
if not LoggedIn then Exit;
wait(1000);
until(Tries > 2);
end;
if PenC > 0 then
begin
Writeln('Churn symbol found at '+IntToStr(px)+','+IntToStr(py));
Result:= True;
Exit;
end else
begin
result:= false;
Writeln('Churn color by auto color not found... Ok, let''s try DDTM...');
Exit;
end;
end;

function FindRoadCircle(var ax, ay : integer) : boolean;
begin
LoadRoadCircle;
wait(100);
result:=FindDTM(CircleRoadDTM, ax, ay ,MMX1,MMY1,MMX2,MMY2);
if result then
WriteStatus('Circle DDTM Sucessfully created and found');
end;

function FindTBridge(var tix, tiy : integer) : boolean;
begin
LoadTBridge;
wait(100);
Result:=FindDTM(TBridgeDTM, tix, tiy ,MMX1,MMY1,MMX2,MMY2);
if result then
Writeln('TBridge DDTM Sucessfully created and found');
writeln('');
end;

function FindRock(var rix, riy : integer) : boolean;
begin
LoadRock;
wait(100);
Result:=FindDTM(RockDTM, rix, riy ,MMX1,MMY1,MMX2,MMY2);
if result then
Writeln('Rock DDTM Sucessfully created and found');
writeln('');
end;

Function ClickPen : Boolean;
var px, py, rcx, rcy : integer;
begin
if not loggedin then exit;
FindPenColor;
if PenC > 0 then
if FindColor(px , py , PenC, mmx1, 50, mmx2, mmy2) then
begin
Mouse(px + 20 ,py - 18 ,3,3,true);
ftwait(2);
flag;
Result:=True;
Exit;
end else
begin
Result:= False;
Exit;
end;
writeln('Going for Circle DTM');
wait(1000);
if FindRoadCircle(rcx, rcy) then
begin
Mouse(rcx - 30 , rcy - 5 ,3 ,3 ,true);
Flag;
result:= True;
end else result := false;
end;

function OpenGate : boolean;
var dx ,dy :integer;
begin
if not loggedin then exit;
MyFlag;
if FindObjCustom(dx,dy, ['Gate'],[1072263, 268839, 937072, 736859],5) then
begin
if IsUpText('pen') then
begin
Mouse(dx,dy,0,0,true);
WriteStatus('Opened Door');
result := true
FTWait(1);
FFlag(0);
end else
if IsUpText('lose') then result:= true;
end else exit;
end;

//Finds and wields any wieldable items in slot 1,2,3,4
procedure Equip;
var slott : TPoint;
var i : integer;
begin
if not loggedin then exit;
gametab(4);
wait(1000);
for i := 1 to 4 do
begin
if ExistsItem(i) then
begin
MMouseItem(i);
wait(500);
if IsUpTextMultiCustom(['ield','ear']) then
begin
slott := Itemcoords(i);
Mouse(slott.x, slott.y, 0, 0, True);
end;
end;
end;
end;

function InLumby : boolean; //Yakman
var x,y,watersymbolcolor:integer;
begin
if not loggedin then exit;
if not(WaterSymbolColor>0) then
begin
if FindSymbol(x, y,'water') then
begin
WaterSymbolColor:=GetSymbolColor(x, y,'water');
Writeln('WaterSymbolColor = '+intToStr(WaterSymbolColor));
Wait(1000);
CloseWindow;
ftwait(4);
end else
begin
result:=false;
exit;
end;
end;
if FindColor(x,y,WaterSymbolColor,MMX1,MMY1,MMX2,MMCY ) then
if FindColor(x,y,WaterSymbolColor,MMX1,MMCY,MMX2,MMY2 ) then
begin
result:=true;
WeAreInLumb := True;
Players[CurrentPlayer].loc := 'Lumby';
end;
end;

Function WalkFromLumby : boolean;
var wflx, wfly, WFLFail : integer;
begin
If not Inlumby then Exit;
Equip;
Setrun(false);
RadialRoadWalk(FindRoadColor,90,45,60,0,0);
if FindTBridge(wflx, wfly) then Mouse(wflx,wfly,3,3,true)
else
begin
Logout;
Players[CurrentPlayer].loc := 'Lost on way back to pen';
Result:= False;
Exit;
end;
RadialRoadWalk(FindRoadColor,20,135,65,0,0);
ftwait(4);
RadialRoadWalk(FindRoadColor,300,420,65,0,0);
ftwait(4);
MarkTime(WFLFail);
repeat
RadialRoadWalk(FindRoadColor,290,430,60,0,0);
ftwait(4);
if TimeFromMark(WFLFail) > 90000 then
begin
Players[CurrentPlayer].loc := 'Lost on way back to pen';
Result:=False;
Logout;
Exit;
end;
until(FindRoadCircle(wflx, wfly));
RadialRoadWalk(FindRoadColor,420,300,20 +random(5),0,0);
if FindRoadCircle(wflx, wfly) then Mouse(wflx,wfly,3,3,true);
Flag;
ftwait(8);
Opengate;
if ClickPen then
begin
Result:= True;
WeAreInLumb := False
deathss := deathss + 1;
FindNormalRandoms;
Setrun(true);
end else
begin
Result:= False;
Players[CurrentPlayer].loc := 'Lost on way back to pen';
Logout;
exit;
end;
end;

//=== Fills inv with some garbage to avoid randoms ===//
procedure PickUp;
begin
if InvFull then exit;
if not loggedin then exit;
FindNormalRandoms;
MyFlag;
if FindObjCustom( x, y, ['chic','eathe','ones'], [8619428, 10855857, 403717], 4) then
begin
repeat
mouse(x,y,0,0,true);
FTWait(2);
MyFlag;
until(not IsUpTextMultiCustom(['chic','eat','ones']))or(invfull);
end;
end;

Function Findfeather(var fex, fey : integer) : boolean;
var FeatherPoints : TPointArray;
var FeatherMid : TPoint;
var fwx, fwy : integer;
begin
if FindColorSpiralTolerance(fex, fey, 403717, MSX1, MSY1, MSX2, MSY2, 5) then
FindColorsSpiralTolerance(mscx,mscy,FeatherPoints, 403717 ,fex - 15,fey-15,fex+15,fey+15,6);
if length(featherPoints)>20 then exit;
if length(featherPoints)>0 then
begin
FeatherMid:=MiddleTPA(FeatherPoints);
fex := FeatherMid.x;
fey := FeatherMid.y;
Result := FindColorTolerance(fwx, fwy, 12632264, fex - 10, fey - 10, fex + 10, fey + 10, 9);
end;
end;

procedure PickFeather;
var fx, fy : integer;
begin
If not loggedin then exit;
Gametab(4);
if InvFull and not FindDTM(FeatherDTM,fx,fy,MIX1,MIY1,MIX2,MIY2) then DropItem(12 + random(12));
fx := MMCX;
fy := MMCY
if Findfeather(fx ,fy) then
begin
MMouse(fx - 6 ,fy - 3 ,12 ,6 );
GetMousePos(fx,fy);
wait(100 + random(50));
if IsUpText('eather') then
begin
Mouse(fx, fy, 0,0, true)
featherpicked := featherpicked + 1;
ReportVars[1]:= ReportVars[1] + 10;
end else
begin
Mouse(fx, fy, 0,0, false)
ChooseOption('eather');
featherpicked := featherpicked + 1;
ReportVars[1]:= ReportVars[1] + 10;
end;
end;
FindNormalRandomsTime;
MyFlag;
ftwait(1);
Wait(50)
end;

function MisClick : boolean;
begin
wait(25);
if FindColor(x, y, 65535, msx1, msy1, msx2, msy2) then
begin
writestatus('Oops! MisClicked...');
fflag(0);
result :=true;
end;
end;


//===Teleports to lumby===//
procedure TeleLumby;
var Lumb : integer;
begin
if not LoggedIn then exit;
if not Tabexists(7) then
begin
LogOut;
Exit;
end;
Lumb:= BitmapFromString(11, 13, 'z78DAA592510A00210844' +
'AFB4E6B6F91B6CDEFF48CBE68F302881094388F3485396BCC AB29' +
'53AB5A6B98AABBFFE43E81D734C15D48893BB725A44E0CEF7 B350' +
'A3F7A05777588FA6968938DEEBEB916077E478EF090139110 1232' +
'2D4BBA84FB2FE9BF58DAA6FF5073394C120');
begin
repeat
Gametab(7)
FTwait(10);
if FindBitmapToleranceIn(lumb, x, y, MIX1, MIY1, MIX2, MIY2, 50) then
begin
Mouse(x+3,y+3,1,1,true);
Ftwait(6);
FindNormalRandoms;
repeat
if IsChatBlackTextAnyLine('need to wait another') then
begin
Telewait := true;
exit;
end;
FTwait(10);
until(inlumby);
Exit;
end;
until(False);
end;
end;

{Gets HP percent using MM stat info}
function GetPercentMyWay : integer;
var
ColorRate : string;
MyCurrentHP, PlayerHPLvl : integer;
begin
If not LoggedIn then exit;
MyCurrentHP := GetMMLevels('hp', ColorRate);
if MyCurrentHp < 0 then
GetSkillInfo('hitpoints', true);

PlayerHPLvl := Players[CurrentPlayer].level[8];
if PlayerHPlvl < 10 then
GetSkillInfo('hitpoints',False);

if (MyCurrentHP < 0) or (PlayerHPlvl < 10) then
begin
Result := -1;
Writeln('Failed at getting hp percent');
FindNormalRandomsTime;
Exit;
end;
Result := (MyCurrentHP * 100) / PlayerHPlvl;
//writeln(inttostr(result));
end;

function GetHPMyWay : integer;
var
MyCurrentHP : integer;
ColorRate : string;
begin
if not LoggedIn then Exit;
MyCurrentHP := GetMMLevels('hp', ColorRate);
if MyCurrentHP < 0 then
MyCurrentHP := GetSkillInfo('hitpoints', true);
if MyCurrentHP < 0 then
begin
Result := -1;
Writeln('Failed at getting hp');
FindNormalRandomsTime;
Exit;
end;
Result := MYCurrentHP;
end;


Procedure CheckHP;
var hx, hy : integer;
begin
If not LoggedIn then Exit;
if not CheckforHP then Exit;
If Firstcheck then
begin
MarkTime(HpTime);
FirstCheck := False;
end;
If TimeFromMark(HpTime) > (CheckMyHP * 1000) then
begin
FirstCheck := False;
MarkTime(HpTime);
CheckMyHP := HPCheckTime + random(15);
if (GetPercentMyWay < 100) then
begin
if Players[CurrentPlayer].integers[1] > GetHpMyWay then Players[CurrentPlayer].integers[1]:= GetHPMyWay else begin Players[CurrentPlayer].integers[1]:= GetHPMyWay Exit; end;
if Inlumby then exit;
Writeln('Sheet! HP is lower than 100%, we are being attacked, running away');
if FindRoadCircle(hx, hy) then
begin
Mouse(hx, hy, 3 ,3 ,true);
Flag;
FTwait(2);
OpenGate;
if Inlumby then Exit;
RadialWalk(FindRoadColor, 340, 430, 65, 0, 0);
Retaliate(True);
FTWait(20 + random(20));
FindNormalrandomsTime;
repeat
wait(1000);
FindNormalRandomsTime;

If not LoggedIn then Exit;
if GetPercentMyWay < 20 then
begin
repeat
Mouse(680 - 5, 35 - 5, 10, 10, true);
Wait(500 + random(1000));
until(not Infight)
Logout;
if not LoggedIn then exit;
end;

until(not InFight);
Gametab(1 + random(13));
wait(12500 + random(7500));
If not LoggedIn then Exit;
If InLumby then
begin
writeln('Oops, we died, going back to pen');
Exit;
end;
RadialWalk(FindRoadColor, 170, 250, 65, 0, 0);
if FindRoadCircle(hx, hy) then Mouse(hx, hy, 3, 3,true)
else
begin
Writeln('Ahh, we can''t find way back to Pen, Calibrating...');
Calibrate;
Exit;
end;
OpenGate;
if ClickPen then
writeln('Sucessfully ran away from fighting random event')
else
Calibrate;
end else
begin
Writeln('Running away, btw, we''re blind');
if Inlumby then exit;
MouseFlag(655-4, 115-4, 8, 8);
Retaliate(True);
FTWait(10 + random(10));
FindNormalRandomsTime;
repeat
wait(1000);
FindNormalRandomsTime;
If not LoggedIn then Exit;

if GetPercentMyWay < 20 then
begin
repeat
Mouse(680 - 5, 35 - 5, 10, 10, true);
Wait(500 + random(1000));
until(not Infight)
Logout;
if not LoggedIn then exit;
end;

until(not InFight);
wait(7500 + random(7500));
If InLumby then
begin
writeln('Oops, we died, going back to pen');
Exit;
end;
MouseFlag(630-4, 50-4, 8, 8);
Writeln('Well, we may be lost, but we ran away from fighting random event, Calibrating');
Calibrate;
end;
end;
end;
end;

function WeAreNearPen : boolean;
var PenPoint : TPointArray;
var PlayerPoint : TPoint;
var nx, ny : integer;
begin
if FindRoadCircle(nx, ny) then
begin
SetArrayLength(PenPoint, 1);
PenPoint[0].x := nx - 25;
PenPoint[0].y := ny - 5;
PlayerPoint.X := MMCX;
PlayerPoint.Y := MMCY;
Result := NearbyPointInArray(PlayerPoint,25,PenPoint);
end else Result := False;
end;

Function Calibrate : boolean;
var cax, cay, waterr, Cal, Waterwalks : integer;
begin
If not loggedin then exit;
Writestatus('Calibrating...');
Waterwalks := 0;
for cal := 0 to 3 do
begin
case Cal of

0 : If Inlumby then Exit;

1 : if FindRoadCircle(cax, cay) then
begin
Mouse(cax, cay, 3, 3,true);
Flag;
Opengate;
if ClickPen then
begin
Result := True;
exit;
end else
begin
Result := False;
Players[CurrentPlayer].loc := 'Lost';
end;
end;

2 : begin
Waterr := FindWaterColor;
if Waterr > 0 then
begin
if FindSymbolIn(cax, cay, 'farming spot', MMCX, MMY1, MMX2, MMY2) then
if FindColor(cax, cay, Waterr, MMX1, MMY1, MMCX, MMY2) then
begin
repeat
Waterwalks := Waterwalks + 1;
RadialWalk(Waterr, 170, 260, 35 + Random(10), 6, 0);
if ClickPen then
begin
Result := True;
exit;
end else
begin
Result := False;
Players[CurrentPlayer].loc := 'Lost';
end;
if Waterwalks > 2 then
begin
Result := false;
Players[CurrentPlayer].loc := 'Lost';
end;
Until(False);
end;
end;
end;

3 : if FindRock(cax, cay) then
begin
Mouse(cax, cay, 3, 3, True);
Flag;
FTwait(2);
RadialRoadWalk(FindRoadcolor, 270, 90, 60, 0, 0);
if FindRoadCircle(cax, cay) then
begin
Mouse(cax, cay, 3, 3,true);
Flag;
Opengate;
FTWait(4);
if ClickPen then
begin
Result := True;
exit;
end else
begin
Result := False;
Players[CurrentPlayer].loc := 'Lost';
end;
end;
end;

end;
end;
end;


procedure WorkWhileFight;
begin
if not LoggedIn then exit;
if not InFight then exit;
repeat
if timefrommark(atcstart) > maxfighttime then exit;
ftwait(1);
writestatus('Time from attack '+inttostr(timefrommark(atcstart))+'/'+inttostr(maxfighttime));
until (not infight) or (FindDTM(DeadBar,x,y,180,115,330,225));
writestatus('Fight ended');
end;

Function FindChickenNotAttacked(var cx, cy : Integer): Boolean;
var
Chickenpoints1, ChickenPoints2, CombinedPoints : TpointArray;
CC : TPoint;
i, c, xx, yy :integer;
var UnderAtc : Array [0..1] of Integer;
begin
UnderAtc[0] := 65280;
UnderAtc[1] := 255;
For C := 0 to 2 do
begin
writestatus('Trying to find monster');
for i := 0 to 4 do
begin
if WasAttacked then
begin
cx := Random(515);
cy := Random(336);
Status('Randomized startpoint, x = '+inttostr(cx)+', y = '+inttostr(cy));
end else
begin
cx:= mscx
cy :=mscy
end;
Wait(1);
if (FindColorSpiralTolerance(cx, cy, redcolor[i], MSX1, MSY1, MSX2, MSY2, MonsterTol)) then break;
end;
begin
FindColorsSpiralTolerance(mscx,mscy,Chickenpoints1 ,3693944,cx - 15,cy-15,cx+15,cy+15, MonsterTol);
FindColorsSpiralTolerance(mscx,mscy,Chickenpoints2 ,9089736,cx - 15,cy-15,cx+15,cy+15, MonsterTol);
CombinedPoints:=CombineTPA(Chickenpoints1, Chickenpoints2);
if length(combinedpoints) > 100 then exit;
if length(combinedpoints) > 2 then
begin
writestatus(inttostr(length(combinedpoints))+' match');
CC:=MiddleTpa(Combinedpoints)
for i := 0 to 1 do
if FindColor(xx, yy, UnderAtc[i], cc.x - 15, cc.y - 15, cc.x + 15, cc.y + 15) then
begin
WasAttacked := True;
Exit;
end else WasAttacked := false;
Mousespeed:= Playerspeed + 2 + random(3);
MMouse(cc.x - 5,cc.y - 5, 10, 10);
Mousespeed:= Playerspeed;
wait(75 + random(50));
if IsUpText('hick') then
begin
GetMousePos(cx,cy);
Result:= True;
Break;
end;
end;
end;
end;
end;

//=== My ultimate attack procedure ===//

Procedure CheckAndAttack;
begin
if not LoggedIn then exit;
if not FindChickenNotAttacked(x, y) then
begin
NfmGetLoc := NfmGetLoc + 1;
TeleNow := TeleNow + 1;
if TeleNow > 49 then
begin
TeleLumby;
Telenow := 0;
exit;
end;
if NfmGetLoc > 14 then
If not WeAreNearPen then
begin
if Calibrate then
begin
writeln('Found location...');
NfmGetLoc := 0;
end else Telenow := Telenow + 5;
end else
if Inlumby then
begin
NfmGetloc := 0;
Exit;
end;
Exit;
end else
begin
TeleNow :=0;
NfmGetLoc := 0;
WeAreInLumb := False;
Players[CurrentPlayer].loc := 'Pen';
if random(10) < 9 then
begin
Mouse(x, y, 0, 0, True);
if MisClick then Exit;
end else
begin
Mouse(x, y, 0, 0, False);
if not ChooseOption('ttack') then Exit;
end;
WriteStatus('Attacked Chicken');
end;
FindNormalRandomsTime;
MyFlag;
Marktime(atcstart)
WriteStatus('Getting into fight loop');
repeat
FTwait(1);
if InFight then break;
if (FindDTM(DeadBar,x,y,180,115,330,225)) then
begin
oh := oh + 1;
monsterkills:= monsterkills + 1;
ReportVars[0]:= ReportVars[0] + 1;
Players[CurrentPlayer].integers[0]:= Players[CurrentPlayer].integers[0] + 1;
writestatus('1 hit k0''ed');
exit;
end;
if timefrommark(atcstart) > 5000 then
begin
writestatus('Monster missed');
exit;
end;
until(infight);
FindNormalRandomsTime;
writestatus('We are in the fight');
monsterkills:= monsterkills + 1;
Players[CurrentPlayer].integers[0]:= Players[CurrentPlayer].integers[0] + 1;
ReportVars[0]:= ReportVars[0] + 1;
WorkWhileFight;
end;


////////////////////////////////////////////////////|
////////////Loading and setting up stuff////////////|
////////////////////////////////////////////////////|


Procedure PlayerReport; //"Non-laggy" playerreport by Mick, thanks for this...
Var
Active, ReportLine: string;
Rand: TStringArray;
LI, LL, LN, L1, L2, L3, L8, LW, LK, I: Byte;
Begin
LI := Length(IntToStr(High(Players)));
SetLength(Rand, GetArrayLength(Players));
for I := 0 to High(Players) do
begin
If Players[I].Rand <> '' Then
Rand[I] := '; Rand: ' + Players[I].Rand
else Rand[I] := '';
if Length(Players[I].Loc + Rand[I]) > LL then LL := Length(Players[I].Loc + Rand[I]);
if Length(Players[I].Nick) > LN then LN := Length(Players[I].Nick);
if Length(IntToStr(Players[i].level[1])) > L1 then
L1 := Length(IntToStr(Players[i].level[1]));
if Length(IntToStr(Players[i].level[2])) > L2 then
L2 := Length(IntToStr(Players[i].level[2]));
if Length(IntToStr(Players[i].level[3])) > L3 then
L3 := Length(IntToStr(Players[i].level[3]));
if Length(IntToStr(Players[i].level[8])) > L8 then
L8 := Length(IntToStr(Players[i].level[8]));
if Length(IntToStr(Players[i].Worked)) > LW then
LW := Length(IntToStr(Players[i].Worked));
if Length(IntToStr(Players[i].integers[0])) > LK then
LK := Length(IntToStr(Players[i].integers[0]));
end;
For I := 0 To High(Players) Do
Begin
If Players[i].Active = True Then
Active := 'T'
Else
Active := 'F';
wait(10);
ReportLine := (
(IntToStr(I) + Replicate(' ',LI-Length(IntToStr(I)))) + ' : ' +
+(Players[I].nick + Replicate(' ', LN-Length(Players[I].Nick)))+
' - ' + Active + ' ' +
(Players[I].Loc + Rand[I] + (Replicate(' ', LL-Length(Players[I].Loc+Rand[I]))))
+' ATC ' +( Replicate(' ', L1 - Length(IntToStr(Players[i].level[1]))) + IntToStr(Players[i].level[1]) )
+', STR '+( Replicate(' ', L2 - Length(IntToStr(Players[i].level[2]))) + IntToStr(Players[i].level[2]) )
+', DEF '+( Replicate(' ', L3 - Length(IntToStr(Players[i].level[3]))) + IntToStr(Players[i].level[3]) )
+', HP ' +( Replicate(' ', L8 - Length(IntToStr(Players[i].level[8]))) + IntToStr(Players[i].level[8]) ) + '. '
+'W: ' +( Replicate(' ', LW - Length(IntToStr(Players[i].Worked))) + IntToStr(Players[i].Worked) ) + ' min. '
+'K: ' +( Replicate(' ', LK - Length(IntToStr(Players[i].integers[0]))) + IntToStr(Players[i].integers[0]) ) + '. ');
WriteLn(ReportLine);
End;
End;


procedure Proggy;
begin
SrlRandomsReport;
Disguise(timerunning);
writeln('');
writeln('');
writeln('Lumbridge Chicken Killer '+versionnumber+' by Negaal');
writeln('===============================');
writeln('Worked: '+timerunning);
writeln('Chickens killed: '+inttostr(monsterkills)+' | 1 Hit K0''s: '+inttostr(oh));
writeln('Kill rate: '+IntToStr((3600*(MonsterKills))/(1+((Getsystemtime-StartTime)/1000)))+'/hr');
if PickTheFeathers then writeln('Feathers picked up '+inttostr(featherpicked)+' times, ~ '+inttostr(featherpicked * 10));
writeln('Walked back from lumby: '+inttostr(deathss));
writeln('===============================');
writeln('');
PlayerReport;
writeln('');
writeln('===============================');
end;

//=== Loads Deformable Template Models ===//

procedure LoadDTMs;
begin;
DeadBar := DTMFromString('78DA63CC626460E8624001FFA134238C6E2 7A' +
'C0600A9BB040A');

ChurnBMP := BitmapFromString(9, 5, 'beNpjZNywd5+HPreFCjcDAyMQA' +
'dnx3pJA1D9nLlDKPSQULlIQIg4kU4uLIVJOHh5A2fDUNAgCig NFIF' +
'IQWWQEFAciRjCAsOEIJAQA/how5w=='); WaitNoob := WaitNewb;

ChickenText:=DTMFromString('78DA63B4616060E0644001 0F1FB132B801694' +
'620FE0F048C764086106E3520C0E802247809A80944A861C4 A526' +
'1C48081050138F700F132E356908BB70A90100A6C41502');

FeatherDTM := DTMFromString('78DA8DCCBB0E40401085E119EF4A8490487 8A' +
'DED3DCD12240A9746BFFE1285D993CC9CE6CBD12A1159E495 DE39' +
'09B472816881F1F2893E3E9D6126C3A4983562E788D8B90C9 3634' +
'EC39498DD303566334C8B990DD36146C33498E1DFDC908F17 32');
end;


//=== Chooses Attack mode ===//

procedure SetAttackMode;
begin
if not loggedin then exit;
gametab(1);
ffrt := 1+random(4);
if ffrt = 5 then ffrt := 3;
case lowercase(players[currentplayer].skill) of
'Attack','attack','att','atc' : setfightmode(1);
'Strength', 'strength','str' : setfightmode(2);
'Defence','defence','defense','def' : setfightmode(4);
'Random','random': setfightmode(ffrt);
'Controlled','controlled': setfightmode(3);
else writeln('ERROR selecting attack mode');
end;
Retaliate(True);
end;

Procedure DoChats;
Begin
SetChat('friends',1);
SetChat('friends',2);
SetChat('friends',3);
End;

var
nostats : longint;
TheWaiter : Extended;

procedure SetUp;
begin
wait(1000);
VersionNumber := 'v0.14_Pub';
ClearDebug;
Xzdw := False;
SetupSRL;
ReinCarnate := True;
DeclarePlayers;
LoadDTMs;
RplayerTime := TimeForPlayer;
if (SRLId = '') or (SRLPassword = '') then
begin
Xzdw := True;
MarkTime(NoStats);
Writeln('Please enter SRL Stats ID...');
writeln('Don''t got SRL stats account?');
writeln('Press F4 to register.');
repeat
if IsFKeyDown(4) then
begin
OpenWebPage('http://www.stats.srl-forums.com/?action=register');
TerminateScript;
end;
TheWaiter := round(abs((timefrommark(nostats)-WaitNoob)div(1000)))
status('You have to wait '+floattostr(TheWaiter)+' sec before script starts'); //Thx raymond for floattostr
wait(10);
until(Timefrommark(nostats)>round(WaitNoob));
end else Xzdw := True;
ScriptID :='533';
marktime(starttime);
activateclient;
wait(2000);

RedColor[0]:=1055610; //Red head colors
RedColor[1]:=923758;
RedColor[0]:=1187992;
RedColor[1]:=857964;
RedColor[0]:=1121934;
if not Xzdw then TerminateScript;
end;

var FailingTime : LongInt;

procedure Playersetup;
begin
MouseSpeed :=Playerspeed + random(3);
CheckMyHP := HPCheckTime + random(15);
LoginPlayer;
MarkTime(FailingTime);
repeat
wait(100);
until(LoggedIn) or (TimeFromMark(FailingTime) > 30000);
Wait(3000 + random(7000));
FindNormalrandomstime;
wait(2000);
Gametab(1);
wait(2000);
SetAttackMode;
GetAllLevels;
Players[CurrentPlayer].integers[1]:=GetHPMyWay;
SetAngle(True);
MakeCompass('N');
DoChats;
SetRun(true);
FTWait(2);
SetRun(true);
SetBar('Brightness',4);
FindNormalrandomstime;
Telenow := 0;
PenC := 0;
if (not InLumby) then
if (not ClickPen)then
Calibrate;
TeleWait := false;
WeAreInLumb := false;
FirstCheck := True;
RPlayerTime := RPlayerTime + Random(5);
MarkTime(PlayerTime)
end;

function SwitchPlayers : Boolean;
begin
If WaitNoob = round(345.776) xor round(345.776) then TerminateScript;
if(TimeFromMark(playertime) / 60 / 1000 > RPlayerTime)then
begin
Result := True;
WriteLn('Time is up');
end else
Result := False;
end;

Function Countplayers : integer;
var PlayersLeft, C : integer;
begin
C := 0;
For PlayersLeft := 0 To TotalPlayers - 1 Do
If Players[PlayersLeft].Active = True then
C := C + 1;
Result := C;
end;

procedure RepeatMe;
var
I : integer;
begin
Setup;
repeat;
Playersetup;
repeat
if Inlumby then WalkFromLumby;
Ban;
if Remote_Control then RC;
Proggy;

{===Fighting===}
MarkTime(FightingTime);
repeat
FindNormalRandomsTime;
Wait(100);
CheckHp;
CheckAndAttack;
if PickTheFeathers then
If random(5) = 0 then
PickFeather;
PickUp;
if (WeAreInLumb) or (TeleWait) or (not loggedIn) then break;
until TimeFromMark(FightingTime) > 60000

TalkToMeBaby;

{===Feather picking===}
Marktime(FPickingTime);
repeat
if (not PickTheFeathers) or (not LoggedIn) or (WeAreInLumb) or (TeleWait) then break;
writestatus('Picking feathers');
PickFeather;
FindNormalRandomsTime;
until ((TimeFromMark(FPickingTime) > 30000) or (not(Findfeather(x , y)))) // <-- lol :p

until (not(LoggedIn)) or (SwitchPlayers) or (TeleWait);
For I:=0 to 2 do
case I of
0 : If Not LoggedIn then
writeln('breaked out from loop: Not Loggedin');
1 : If Telewait then
writeln('breaked out from loop: TeleWait');
2 : if SwitchPlayers then
writeln('breaked out from loop: SwicthPlayers');
end;
Writeln('We got '+inttostr(Countplayers)+' active players left');
NextPlayer(LoggedIn);

until false;

Writeln('All players are done');
FreeDtm(DeadBar);
FreeDtm(CircleRoadDTM);
FreeBitmap(ChurnBMP);
FreeDtm(ChickenText);
FreeDtm(FeatherDTM);
FreeDtm(CircleRoadDTM);
FreeDtm(TBridgeDTM);
FreeDtm(RockDTM);

end;

begin
RepeatMe;
end.

any help would be great :D
thanks

William
10-11-2008, 10:18 PM
i get same error but on alot of scripts..

TViYH
10-11-2008, 11:51 PM
Download the latest revision of SRL using the Subversion Repository.