[S]paz
2008-03-10 03:46:23
ok this is now very annoying, i made this simpley cos i was bored but its turned into something else as its rele starting to annoy me. Despite have activeleft procedure it still executes and terminates the script
so even tho the time form mark is not 900000 it will still log out then terminate script…. why??
another thing is that the stats dont get sent. All i get sent was the time is chopped for, but the vars dont
any suggestions
~Spaz
program powerzchopperz;
{.include srl/srl/misc/smart.scar}
{.include srl/srl.scar}
{.include srl/srl/skill/woodcutting.scar}
var
x, y, active, stats, TreeDDTM, axe : integer;
chopped, loads, totchopped, totloads : integer;
q, smart, log : integer;
const
NumOfPlayers = 3; // Number of users.
tree = 2122071;
tree1 = 3367516;
YourSRLId = '';
YourSRLpass = '';
Procedure DeclarePlayers;
Begin
HowManyPlayers := NumOfPlayers;
NumberOfPlayers( HowManyPlayers );
CurrentPlayer := 2;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Active:=True;
Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :='';
Players[2].Active:=True;
{ Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :='';
Players[3].Active:=false;
Players[4].Name :='';
Players[4].Pass :='';
Players[4].Nick :='';
Players[4].Active:=false;
Players[5].Name :='';
Players[5].Pass :='';
Players[5].Nick :='';
Players[5].Active:=false; }
Writeln( IntToStr ( HowManyPlayers ) + ' Player[s]' );
End;
Procedure sendstats;
begin
SRLRandomsReport;
end;
procedure WhereTreeDDTM;
var
TreeMP: TDTMPointDef;
TreeSP: Array [0..4] of TDTMPointDef;
TreeSkel: TDTM;
begin
TreeMP.x := 883;
TreeMP.y := 332;
TreeMP.AreaSize := 1;
TreeMP.AreaShape := 0;
TreeMP.Color := 1135423;
TreeMP.Tolerance := 225;
TreeSP[0].x := 883;
TreeSP[0].y := 332;
TreeSP[0].AreaSize := 1;
TreeSP[0].AreaShape := 0;
TreeSP[0].Color := 1135423;
TreeSP[0].Tolerance := 225;
TreeSP[1].x := 889;
TreeSP[1].y := 326;
TreeSP[1].AreaSize := 1;
TreeSP[1].AreaShape := 0;
TreeSP[1].Color := 993368;
TreeSP[1].Tolerance := 10;
TreeSP[2].x := 876;
TreeSP[2].y := 327;
TreeSP[2].AreaSize := 1;
TreeSP[2].AreaShape := 0;
TreeSP[2].Color := 993368;
TreeSP[2].Tolerance := 10;
TreeSP[3].x := 870;
TreeSP[3].y := 336;
TreeSP[3].AreaSize := 2;
TreeSP[3].AreaShape := 0;
TreeSP[3].Color := 993368;
TreeSP[3].Tolerance := 10;
TreeSP[4].x := 882;
TreeSP[4].y := 346;
TreeSP[4].AreaSize := 1;
TreeSP[4].AreaShape := 0;
TreeSP[4].Color := 993368;
TreeSP[4].Tolerance := 10;
TreeSkel.MainPoint := TreeMP;
TreeSkel.SubPoints := TreeSP;
TreeDDTM := AddDTM(TreeSkel);
end;
function Checkifneartrees : boolean;
begin
If DTMRotated(TreeDDTM, x, y, mmx1, mmy1, mmx2, mmy2) then
result := true;
end;
procedure report;
var
i:integer;
begin
cleardebug;
for i:=0 to howmanyplayers-1 do
begin
writeln(inttostr(i)+': '+players[i].nick+' | '+left(booltostr(players[i].active),1)+' | '+inttostr(chopped)+' chopped | '+inttostr(loads)+' loads done');
end;
writeln('|||||||||||||||||||||||||||||||||||||||||||||');
writeln('\powerzchoperz');
writeln('\started at '+inttostr(q)+'');
writeln('\ran for '+TimeRunning);
writeln('\chnopped '+inttostr(totchopped)+' logs');
writeln('\loads done '+inttostr(totloads)+'');
writeln('//////////////////////////////////////////////');
end;
procedure minirep;
begin
case random(3) of
0: disguise('done '+inttostr(loads)+' loads');
1: disguise('chopped '+inttostr(chopped)+' logs');
2: disguise(+inttostr(active)+' active left');
end;
end;
procedure Findmyrandoms;
begin
sendstats;
FindNormalRandoms;
ftwait(2);
Findtalk;
FindLamp('Woodcutting');
end;
procedure choptrees;
var
gx, gy : integer;
begin
if not (loggedin) then exit;
repeat
If FindObjCustom(x, y, ['hop', 'ree', 'tree'], [tree, tree1], 4) then
mmouse(x, y, 1, 1);
If IsUptext('ree') then
getmousepos(gx, gy);
begin
Findmyrandoms;
FindEnt(x, y, true);
Mouse(x, y, 3, 3, false);
chooseoption('hop');
repeat
Findmyrandoms;
FTwait(4);
until FindBlackChatMessage('You get some');
minirep;
end;
until (invfull);
ReportVars[0] := ReportVars[0] + 28; //logs cut
sendstats;
end;
procedure dropthem;
var
i: Integer;
begin
if not (LoggedIn) then Exit;
GameTab(4);
for i := 1 to 28 do
begin
if ExistsItem(i) then
DropItem(i);
end;
minirep;
ReportVars[1] := ReportVars[1] + 1; //loads done
begin
writeln('done reporting');
Findmyrandoms;
sendstats;
end;
end;
procedure ActiveLeft;
var
i: Integer;
begin
active := 0;
for I := 0 To HowManyPlayers - 1 do
begin
if (Players[i].active = True) then active := active + 1;
If (Active = 0) then
begin
WriteLn('All Players done :)');
exit;
end;
If (Active > 0) then
WriteLn('' + IntToStr(Active) + ' Players Remaining.');
end;
end;
procedure setup;
begin
SetupSRL;
DeclarePlayers;
Activateclient;
LoginPlayer;
ScriptID:='710'
SRLID := YourSRLId;
SRLPassword := YourSRLPass;
if (SRLID = '') or (SRLPassword = '') then
begin
ClearDebug;
Writeln('SRL Stats ID not found. Please register.');
Wait(1000);
Writeln('Loading registration page...');
Wait(1000);
OpenWebPage('http://stats.srl-forums.com/index.php?action=register');
TerminateScript;
end;
q:=GetSystemTime;
SetAngle(True);
WheretreeDDTM;
FindAxe;
end;
Procedure Initialisation;
begin
repeat
cleardebug;
Writeln('SMART initialising please wait');
wait(500);
cleardebug;
Writeln('SMART initialising please wait.');
wait(500);
cleardebug;
Writeln('SMART initialising please wait..');
wait(500);
cleardebug;
Writeln('SMART initialising please wait...');
wait(500);
smart := smart + 1
until (smart > 5)
end;
begin
Initialisation;
setup;
{Marktime(log);}
repeat
repeat
choptrees;
until (invfull) or {(TimefromMark(log) > 900000)}
if (InvFull) then
chopped:=chopped + 27;
loads:=loads + 1;
totchopped:=totchopped + 27;
totloads:=totloads + 1;
dropthem;
report;
{if (TimefromMark(log) > 900000) then
Nextplayer(true);
writeln('Preventing randoms');}
until (Active < 1);
end.so even tho the time form mark is not 900000 it will still log out then terminate script…. why??
another thing is that the stats dont get sent. All i get sent was the time is chopped for, but the vars dont
any suggestions
~Spaz