Premix
2013-03-13 19:54:34
So I have been looking at Yohojo's video tuts to make a script. I made one powerminer for iron in Al Kharid. in other words, i did my best so far. Now I'm stuck as the script won't sign in the player, or search for colors. The only thing the script does is fixing camera angle and camera degrees. I'm very new to this, so I would like some advice and tips on how to improve this and how to make the script do something. xD
program PremixPowerminer;
{$i srl/srl.simba}
{$i P07Include.simba}
Procedure P07_DeclarePlayer;
Begin
P07_PlayerName:='';
P07_PlayerPass:='';
end;
Procedure AntiBan;
begin
if P07_LoggedIn then
begin;
case random(250) of
0: P07_HoverSkill('Mining', random(5000));
2: P07_MakeCameraAngleHigh;
3: P07_MakeCompassSouth;
5: P07_MakeCompassWest;
6: P07_DropInventorySlot(14);
7: P07_DropInventorySlot(22);
8: sleepandmovemouse(3000);
end;
end;
end;
function RockColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.10, 0.74);
if not (FindColorsTolerance(arP, 1713730, MSX1, MSY1, MSX2, MSY2, 11)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
Result := arC[i];
//Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
//Writeln('AutoColor failed in finding the color.');
end;
function Mining;
var
x, y, PlusOne: integer;
begin
PlusOne:= InvCount + 1;
x:=MSCX;
y:=MSCY;
if FindObjTPA(x, y, RockColor, 5, 1, 50, 50, 250, ['Min']) then
begin
WriteLN('Found iron!');
GetMousePos(x, y);
case Random(2) Of
0: Mouse(x, y, 6, 6, True);
1: begin
Mouse(x, y, 6, 6, False);
WaitOption('Mine', 500);
end;
end;
if not FindObjTPA(x, y, RockColor, 5, 1, 50, 50, 250, ['Min']) then
WriteLn('Check colors.');
repeat
Antiban;
Wait(2000);
If InvCount=PlusOne then
WriteLn('Got one iron.');
until (InvCount=PlusOne);
end;
end;
begin;
ActivateClient;
SetupSRL;
SetupP07Include;
P07_DeclarePlayer;
P07_MakeCompassDegree(270);
P07_MakeCameraAnglehigh;
repeat
Mining;
until(not P07_LoggedIn);
TerminateScript;
end.