okokokok
2013-06-06 04:32:25
Yo guys,
I've been trying to script sth. Just because i'm too lazy to do it myself in rs.
Now i've got two problems (script is for OSR):
- The script randomly starts to walk giving the following message:
No direction found, setting manually
Running W
- When i'm on a lootpile the script doesn't right click. ????
Script:
I've been trying to script sth. Just because i'm too lazy to do it myself in rs.
Now i've got two problems (script is for OSR):
- The script randomly starts to walk giving the following message:
No direction found, setting manually
Running W
- When i'm on a lootpile the script doesn't right click. ????
Script:
program GiantKiller;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$i SRL-OSR\SRL\misc\debug.simba}
procedure AntiBan;
begin
FindNormalRandoms;
Case Random (500) of
0..15: RandomRClick;
50..65: PickUpMouse;
90..105: RandomRClick;
115..120: RandomMovement;
160..180: ExamineInv;
230..250:
begin
HoverSkill('random', false);
sleepandmovemouse(276 + Random(100));
PickUpMouse;
ChooseOption('Cancel');
SetAngle(SRL_ANGLE_HIGH);
end;
300..320: BoredHuman;
350..390: PickUpMouse;
420..450: RandomRClick;
280..299: RandomMovement;
460..480: SleepAndMoveMouse(3000 + Random(500));
end;
end;
function GiantColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.05, 0.25);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 4353950, MSX1, MSY1, MSX2, MSY2, 25);
if (Length(arP) = 0) 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
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 3.74) and (X <= 47.00) and (Y >= 3.65) and (Y <= 46.76) and (Z >= 1.86) and (Z <= 30.60) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
function BoneColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.12, 0.08);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 11645370, MSX1, MSY1, MSX2, MSY2, 18);
if (Length(arP) = 0) 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
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 23.63) and (X <= 72.12) and (Y >= 23.75) and (Y <= 75.21) and (Z >= 24.44) and (Z <= 81.23) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
Function Moving: Boolean;
var
MovingBox: Tbox;
begin
MovingBox := IntToBox(259, 133, 272, 151);
Result := (AveragePixelShift(MovingBox, 500, 300) > 80);
end;
Function InFight: Boolean;
var
InFightBox: Tbox;
begin
InFightBox := IntToBox(260, 137, 277, 185);
Result := (AveragePixelShift(InFightBox, 500, 300) > 100);
end;
procedure Fight;
var x,y,i: Integer;
begin
SetAngle(SRL_ANGLE_HIGH);
ClearDebug;
AntiBan;
If not InFight then
begin
If FindObjCustom(x,y,['Giant'],[GiantColor],5) then
begin
repeat
Writeln('Found Giant');
MMouse(x,y,0,0);
Wait(50 + (random(50)));
Mouse(x,y,0,0,false);
ChooseOption('ttack');
Writeln('Fucking it hard #1');
until (InFight)
end
else
If FindObjCustom(x,y,['Giant'],[GiantColor],5) then
begin
repeat
Writeln('Found Giant');
MMouse(x,y,0,0);
Wait(50 + (random(50)));
Mouse(x,y,0,0,false);
ChooseOption('ttack');
Writeln('Fucking it hard #2');
until (InFight)
end
else
If FindObjCustom(x,y,['Giant'],[GiantColor],5) then
begin
repeat
Writeln('Found Giant');
MMouse(x,y,0,0);
Wait(50 + (random(50)));
Mouse(x,y,0,0,false);
ChooseOption('ttack');
Writeln('Fucking it hard #3');
until (InFight)
end;
Writeln('Fighting fucking failed');
end;
end;
procedure Looting;
var x,y: Integer;
begin
SetAngle(SRL_ANGLE_HIGH);
ClearDebug;
AntiBan
If not(InFight) then
begin
If FindObjCustom(x,y,['ake'],[BoneColor],5) then
begin
MMouse(x,y,0,0);
Mouse(x,y,0,0,false);
Wait(150 + Random(50));
ChooseOption('ake big');
Writeln('Picked up sjit #1');
end;
Writeln('Looting Failed');
end;
end;
procedure OneRun;
begin
AntiBan;
repeat
Fight;
Looting;
until (InFight);
end;
begin
SetupSRL;
ClearDebug;
begin
repeat
OneRun;
until(false);
end;
end.