SRL Archive - First Scripts

powerminner...


thebob142

2008-05-25 03:52:27

program PowerMiner;

{.include SRL/SRL.scar}

const
RockColour1= 1111111;
RockColour2= 2222222;

var x, y, Tries: integer; Copper: integer; Tin: integer; Iron: integer;



procedure DeclarePlayers;
begin
HowManyPlayers := 3;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:= 0

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 := False;

Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := False;
end;

Procedure AntiRandoms;
begin
If(FindFight)then
RunAway('N', True, 1,15000);
FindNormalRandoms;
FindLamp('Mining');
end;

procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(6) of
1: RandomRClick;
2: HoverSkill('Random', False);
3: RandomMovement;
4: BoredHuman;
5: AlmostLogout;
6: DoEmote(400 +Random(90));
end;
end;

procedure DTMs;
begin
Copper := DTMFromString('78DA63F467606030644001E74A8CC1342394C' +
'F1802243418B002143546D865E16A4076991330C70BD33D18E678' +
'02096D026AFCB0B99911D3CD9AF8D500000AA60575');

Tin := DTMFromString('78DA6334676060086740010DE5650C5C409A1' +
'188FF0301A3039011C58006189148206D05246208A8B100120904' +
'D41812A1460FD3CD58CD8924A0C60848641050E348845DC640229' +
'0801A4B2011845F0D001AE30BCB');

Iron := DTMFromString('78DA63AC676060B06240015EBA4A0C5C409A1' +
'188FF030163339061C2801530C2E84E20614C404D2B90B0C12E0B' +
'57530B249C09A8A9C47433865D65D8DC83C51C3D02E6346053836' +
'64E3990B0C5AF06007CCE0BCB');
end;




{*******************************************************************************
Function w_WizzupGas(cx,cy: integer): Boolean;
By: Wizzup?
Description: Wizzup?'s gas finding!
*******************************************************************************}
Function w_WizzupGas(cx,cy: integer): Boolean;

Var
CTS, I, Le, T, Time: Integer;
P, P2: TPointArray;
C, C2: TIntegerArray;
R, G, B: Integer;
H, S, L: Extended;
X, Y, Z: Extended;
GP: TPoint;

Begin
if not(LoggedIn)then Exit;
Result := False;

Time := GetSystemTime;

CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.16, 0.46);
GP.X := cx;
GP.Y := cy;
GP.Y := GP.Y - 20;
try
FindColorsTolerance(P, 9083807, GP.x - 25, GP.y - 25, GP.X + 25, GP.Y + 25, 15);
except
end;
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);

If Length(P) < 60 Then
Exit;

try
C := GetColors(P);
C2 := C;
ClearSameIntegers(C);
except
Writeln('Memory leakage! Restart scar!!');
TerminateScript;
end;


If Length(C) < 40 Then // Maybe lower the value.
//If Length(C) < 60 Then
Begin
Exit;
End;

SetLength(C, 0);
SetLength(C, Length(C2));
SetLength(P2, Length(P));

Le := High(C2);

For I := 0 To Le Do
Begin
ColorToRGB(C2[i], R, G, B);
//If ((R - G) <= 6) And (G - B > 7) Then
If ((R - G) <= 10) And (G - B > 7) Then
Begin
ColorToHSL(C2[i], H, S, L);
If (H > 11.5) And (H < 16.0) And (S < 16.0) And (S > 2.0) And (L > 42.0) And (L < 71.0) Then
Begin
ColorToXYZ(C2[i], X, Y, Z);
If (X >= 18.0) And (X <= 45.0) And (Y >= 20.0)
And (Y <= 48.0) And (Z >= 15.0)
And (Z <= 47.0) And (Abs(X - Y) < 3.0)
And (Abs(X - Z) < 5.0) And (Abs(Y - Z) < 6.5)
Then
Begin
C[T] := C2[i];
P2[T] := P[i];
T := T + 1;
End;
End;
End;
End;
SetLength(C, T);

ClearSameIntegers(C);

If Length(C) < 25 Then
Begin
Exit;
End;
Result := True;
End;

{*******************************************************************************
Function MKFindGas:boolean;
By: MasterKill
Description: FindGas by MasterKill.
*******************************************************************************}
Function MKFindGas:boolean;
begin
if not LoggedIn then Exit;
if (FindColorTolerance (x, y, 10596274, 0, 0, 500, 500, 1))
or (FindColorTolerance (x, y, 8950933, 0, 0, 500, 500, 1))
or (FindColorTolerance (x, y, 9017755, 0, 0, 500, 500, 1))
or (FindColorTolerance (x, y, 7900302, 0, 0, 500, 500, 1)) then result:= true;
end;


{*******************************************************************************
procedure AntiGas;
By: The[Cheese]
Description: Finds and handles gas.
*******************************************************************************}
procedure AntiGas;
begin
if not(LoggedIn)then Exit;
if((w_WizzupGas(269, 188)) or (MKFindGas))then
begin
ReportVars[6] := ReportVars[6] + 1;
Inc(Players[CurrentPlayer].Integers[22]);
case Random(5) of
0: TypeSend('Ugh dumb gas');
1: TypeSend('omg i hate gas');
2: TypeSend('who passed the gas?');
3: TypeSend('plz dont kill my pick gas!');
4: TypeSend('lol gas is annoying.');
5: TypeSend('ahh gas!');
end;
wait(20000 + Random(10000));
repeat
wait(100);
until not((w_WizzupGas(269, 188)) or (MKFindGas));
end;
end;


procedure RockMining;
begin
if not LoggedIn then Exit;
AntiRandoms;
AntiGas;
AntiBan;
if (not (FindObjCustom(x, y, ['Mi', 'ne'], [RockColour1, RockColour2], 7))) then
Wait(100+random(100));
Tries := Tries + 1;
if(Tries = 20) then
begin
Logout;
Exit;
end else
AntiGas;
AntiRandoms;
AntiBan;
if FindObjCustom(x, y, ['Min', 'ine'], [RockColour1, RockColour2], 7) then
repeat
case (Random(2)) of
0: begin Mouse(x, y, 4, 4, False); ChooseOption('ine');
end;
1: begin Mouse (x, y, 4, 4, True);
AntiRandoms;
end;
end;
until (InvFull);
end;

procedure DropTheOre;
begin
if FindDTM(Tin, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 5, 5, false);
ChooseOption('rop');
end;

if FindDTM(Iron, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 5, 5, false);
ChooseOption('rop');
end;


if FindDTM(Copper, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 5, 5, false);
ChooseOption('rop');
end;
end;

begin
SetupSRL;
DeclarePlayers;
LoginPlayer;
ActivateClient;
DTMs;
DropTheOre;
FreeDTM(Tin);
FreeDTM(Iron);
FreeDTM(Copper);
repeat
RockMining;
AntiBan;
until (False)
end.

This is v 1.2 i fixed the login and it now has dtms for dropping iron,tin, and copper

Mark

2008-05-25 08:34:05

Nice script just had quick read of it not bad so far but
as you might be doing already get a prog on it also your are getting a error
[Runtime Error] : Out Of Range in line 1211 in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar
if you need any help ill try my best i can help you with a prog if u want me to edit your script i will be happy to just private me

anyway gratz on script

CRU1Z1N……..

PvH

2008-05-25 09:35:05

just a question..
what of this script is yours?
i see credits everywhere..
the cheese, wizzup, masterkill and so on..
anyway.. congrats on first script;)

thebob142

2008-05-25 11:03:35

From: CRU1Z1N
Nice script just had quick read of it not bad so far but
as you might be doing already get a prog on it also your are getting a error
if you need any help ill try my best i can help you with a prog if u want me to edit your script i will be happy to just private me

anyway gratz on script

CRU1Z1N……..


odd i never get an error

thebob142

2008-05-26 01:20:23

v 1.2 released

maxwell1170

2008-05-28 20:28:02

it doesnt work for me

epichalfblud

2008-06-10 15:42:45

pretty good