SRL Archive - Senior Scripts and Snippets

Ogre Ranger


The Claw

2011-01-02 23:07:25

Simple and straightforward script, got me 85-99 range. Works for crossbows and short/long-bows, havent tried with any other range weapon. Was going to add in seed telegrabbing but got too lazy. :p

Kills Ogres at King Lathas' Training Ground. Gets 35-40k xp/hour, and requires Biohazard quest I think. You don't need food, because you always stand outside the cage, you can use Ava's accumulator or just let the arrows go away. You can also melee (with a halberd) or mage them, but you would have to edit the script. Wear a ring of life.

Putting it here now cause I'm done with it and someone might find it useful. Might clean it up a bit and move to public later I guess.

program new;

{$DEFINE SMARt}
{$DEFINE Simba}
{$i includes\srl\srl.scar}
{$i reflection\reflection.simba}

const
DoIdles = False;

var
ogrecount, lastogre, noogres, overalltimer, Idles, NotAttackings, Breakouts, TotalBreakouts: Integer;
IdleTimer, IdleMark: Array [0..5] of Integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);

Players[0].name := '';
Players[0].pass := '';
Players[0].nick := '';
Players[0].active := true;
Players[0].BoxRewards := ['oins', 'amp']
end;

function Idle: Boolean;
var
z, c, i, x, y: Integer;
begin
if TimeFromMark(OverallTimer) > 10 * 60000 then
begin
ClearReport;
MarkTime(OverallTimer);
for i := 0 to 5 do
begin
IdleTimer[i] := Random((i + 1) * i) + 1 + Random(3);
AddToReport('IdleTimer[' + IntToStr(i) + '] = ' + IntToStr(IdleTimer[i]));
end;
end;
for i := 0 to 5 do
if TimeFromMark(IdleMark[i]) > (IdleTimer[i] * (60000 + Random(30000))) then
begin
AddToReport('Performing idle number ' + IntToStr(i));
Inc(Idles);
case i of
0,3: begin MMouse(RandomRange(0, 760), RandomRange(0, 500), 0, 0); Wait(Random(1500) + Random(500)); end;
1: begin
MMouse(RandomRange(0, 760), RandomRange(0, 500), 0, 0);
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
Wait(Random(3000));
MMouse(RandomRange(0, 760), RandomRange(0, 500), 0, 0);
Wait(Random(2000));
end;
2: Wait(Random(15000));
4: BoredHuman;
5: HoverSkill('magic', False);
end;
MarkTime(IdleMark[i]);
Result := True;
end;
end;


function FindAndClickOgre: Boolean;
var
Ogre: TNPC;
OgrePoint: TPoint;
NPCs: TNPCArray;
i: integer;
begin
NPCs := GetNPCs;
for i := 0 to High(NPCs) do
begin
if (Pos('Ogre', NPCs[i].Name) > 0) then
if (not NPCs[i].Fighting) (*and (not NPCs[i].Moving)*) then
begin
OgrePoint := TileToMSEx(NPCs[i].Tile, NPCs[i].Pixel.x/512, NPCs[i].Pixel.y/512, NPCs[i].Height/2);
if (OgrePoint.x > 0) and (OgrePoint.y > 0) then
begin
MMouse(OgrePoint.x, OgrePoint.y, 5, 5);
//Wait(500 + random(250));
if IsUpText('gre') then
begin
GetMousePos(OgrePoint.x, OgrePoint.y);
Mouse(OgrePoint.x, OgrePoint.y, 0, 0, true);
Result := True;
//Status('Clicked Ogre');
Exit;
end;
end else
Continue;
end else
Continue;
end;
end;

function Attacking: Boolean;
var
Player: TMe;
begin
Player := GetMe;
//Writeln(inttostr(player.animation));
if not (Player.Animation = -1) then
begin
Result := True;
NotAttackings := 0;
end else
begin
Inc(NotAttackings);
if NotAttackings > 3 then
begin
Result := False;
NotAttackings := 0;
//Inc(Breakouts);
end else
Result := True;
end;
end;

function Calibrate: Boolean;
var
Position: TPoint;
begin
Position := GetMyPos;
if not PointInBox(Position , IntToBox(2522, 3371, 2533, 3377)) then
begin
Position.x := 2527;
Position.y := 3372;
Result := WalkToTile(Position, 2, 0);
FFlag(0);
//do some stuff to calibrate 2521 3377
end else //2533 3369
Result := True;
Writeln('calibrating = ' + BoolToStr(Result));
end;

procedure AttackOgre;
begin
if FindAndClickOgre then
begin
if not ((Inchat('ammo') and Inchat('quiver')) or Inchat('your last one')) then
begin
Wait(700 + Random(200));
while Attacking do
begin
// Idle;
if FindNormalRandoms then MarkTime(lastogre);
Wait(600 + random(200));
//Status('Attacking Ogre');
end;
//Writeln('not attacking');
FindNormalRandoms;
Inc(OgreCount);
MarkTime(LastOgre);
NoOgres := 0;
Calibrate;
end else
begin
Writeln('out of ammo');
TerminateScript;
end;
end else
begin
Inc(NoOgres);
if NoOgres > 100 then
begin
if not FindNormalRandoms then
begin
//Status('no ogres');
TerminateScript;
end else
NoOgres := 0;
end;
end;
end;

procedure GrabSeeds;
var
I : integer;
Items : TGroundItemArray;
ItemPos : TPoint;
Items2: TPointArray;
begin
//FindGroundItems(Items,[536],10);
Items := GetItemsNear(5);
for I := 0 to High(Items) do
begin
Writeln(IntToStr(Items[i].Stack))
//ItemPos := TileToMs(Items[I].Tile, Random(5));
//telegrab it
//MMouse(ItemPos.x, ItemPos.y,3,3);
//Wait(500+random(500));
//R_ChooseOption('ake Bon');
end;
end;

procedure Report;
begin
// ClearDebug;
OgreCount := OgreCount - Breakouts;
TotalBreakouts := TotalBreakouts + Breakouts;
Breakouts := 0;
Writeln('Running for ' + TimeRunning)
Writeln('Killed: ' + IntToStr(OgreCount) + ' at: ' + IntToStr(Round(OgreCount div (( GetTimeRunning div 3600000.0)))) + ' p/h');
Writeln('Gained: ' + FloatToStr(Round(OgreCount * 600 * 0.4)) + ' Range xp at: ' + IntToStr(Round((OgreCount * 600 * 0.4) div (( GetTimeRunning div 3600000.0)))) + ' xp p/h');
Writeln(' ' + FloatToStr(Round(OgreCount * 600 * 0.133)) + ' HP xp at: ' + IntToStr(Round((OgreCount * 600 * 0.133) div (( GetTimeRunning div 3600000.0)))) + ' xp p/h');
if Breakouts > 0 then Writeln('Breakouts: ' + IntToStr(TotalBreakouts));
end;

procedure SetupScript;
var
i: Integer;
begin
Smart_Members:= True;
Smart_Server := 58;
Smart_Signed := False;
SetupSRL;
SetupReflectionEx(True);
DeclarePlayers;
for i := 0 to 5 do
MarkTime(IdleMark[i]);
end;

begin
SetupScript;
LoginPlayer;
repeat
//Attacking;
AttackOgre;
//GrabSeeds;
Report;
FindNormalRandoms;
Wait(500 + Random(200));
until False;
end.

marpis

2011-01-03 00:57:40

I've trained there too from 65 to 90 ranged with Perfecticus' fighter.

The Claw

2011-01-03 06:23:24

No idea what that is, but yea its a good training spot :p

HyperSecret

2011-01-04 10:07:00

I'll give this a try sometime soon (hopefully), atm trying to get my combat stats up.