DeSnob
2010-05-16 13:07:33
I feel something fishy about this proc in my fishing bot (no pun intended) I know it can be shortened but don't know any way to shorten it anymore! Can somebody look at this and just tell me what to do to make it smaller?
{Setting 1 = Stay offline Setting 2 = Log back on Setting 3 = nothing}
procedure WaitR(reason: string; time, randomness, setting: integer; myantiban, randoms, mylogout, error: boolean);
var
waittime: integer;
begin
waittime := time + randomness;
if (error) then Writeln('INFO: **Error** ' + reason + ': ' + IntToStr(waittime)) else
Writeln('INFO: ' + reason + ': ' + IntToStr(waittime));
if (myantiban) then AntiBan;
if (randoms) then FindNormalRandoms;
if (mylogout) then
begin
if (LoggedIn) then
begin
if (LogOut) then Writeln('INFO: WaitR/ Logged out.');
end else
begin Writeln('INFO: **Error** Was already logged out!'); Exit; end;
end;
Wait(time+random(randomness));
case (setting) of
1: if (LoggedIn) then
begin
LogOut;
TerminateScript;
end else
begin
Writeln('INFO: WaitR/ Staying offline. Terminating.');
LogOut;
TerminateScript;
end;
2: begin LogInPlayer; Writeln('INFO: Logged back on.'); end;
3: exit;
end;
end;