SRL Archive - Senior Scripts and Snippets

SeagullKiller


weequ

2012-02-21 18:00:31

Weequ's SeagullKiller
  • Fast
  • Reliable
  • Walks back to the center if too far.
  • Antiban
  • Multiplayer
  • Failsafes
  • No progress report yet.

Hey I made this script to train level 3's :) Been tested for hours, should be pretty stable now. Please keep in SSRL+ ;)

Start at the northern seagulls of port sharim.


program SeagulKiller;
{$i srl/srl/misc/Smart.simba}
{$i SRL/SRL.simba}
{$i SRL/SRL/misc/paintsmart.simba}

const
SmartWorld = 11;
MaxCombatTime = 10000;


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

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Active := True;

Players[1].Name := '';
Players[1].Pass := '';
Players[1].Active := True;

Players[2].Name := '';
Players[2].Pass := '';
Players[2].Active := True;

Players[3].Name := '';
Players[3].Pass := '';
Players[3].Active := True;
end;



procedure AntiBan;
begin
case Random(8) of
0..3: SleepAndMoveMouse(500+Random(Random(7000)));
3..6: PickUpMouse;
7: GameTab(RandomRange(tab_Combat, tab_Notes));
end;
if Random(2) = 0 then GameTab(tab_Inv);
end;


Function GridCoords16ExMOD(Xmod, Ymod: integer; Grid16: TPoint): TPoint;//Modified from SRL
var
Yh, yM, X, Y: Extended;
begin
X := Grid16.x+0.0;
Y := Grid16.y+0.0;
yM := 36.0;
Yh := Abs(Y + yM);
Result.x := Round( (263.5+Xmod) + (X*9.75/(12.8-(Yh/yM*3.15))) * 9.75);
Result.y := Round( (182.0+Ymod) + Y * (6.3 + ((Yh/yM)*2.4)));
end;


Function MMtoMSExMOD(Xmod, Ymod: integer; MM: TPoint): TPoint;//Modified from SRL
begin
Result := GridCoords16ExMOD(Xmod, Ymod, Point(MM.x-MMCX, MM.y-MMCY));
end;


function FindCenter(var x: Integer; var y: Integer): Boolean;
var
DTM: Integer;
begin
DTM := DTMFromString('mWAAAAHicY2FgYOACYmEGCOCC0mxAzA7ETEAcHBTA0NE3B4wj7GQYRIFiyJgBqg6GQQAAABsFoA==');
Result := FindDTM(DTM, x, y, mmx1, mmy1, mmx2, mmy2);
FreeDTM(DTM);
if Result then
begin
x := x+2;
y := y+23;
end;
end;


function WalkCenter: Boolean;
var
x, y: Integer;
begin
Result := FindCenter(x, y);
if not Result then Exit;
if Distance(x, y, MMCX, MMCY) < 13 then Exit;
Mouse(X-3, Y-3, 7, 7, True);
Wait(600);
Flag;
Wait(500+Random(1000));
end;


function Attack: Boolean;
var
I, x, y, ax, ay: Integer;
Dots, TPA: TPointArray;
MSDot: TPoint;
MSBox2: TBox;
begin
if not FindCenter(x, y) then Exit;
Dots := GetMiniMapDotsIn('npc', Max(x-14, MMX1), Max(y-23, MMY1), Min(x+22, MMX2), Min(y+25, MMY2));
if Length(Dots) = 0 then Exit;
SortTPAFrom(Dots, IntToPoint(MMCX, MMCY));
MSBox2 := IntToBox(MSX1-20, MSY1-20, MSX2+20, MSY2+20);
for I := 0 to Length(Dots) -1 do
begin
MSDot := MMtoMSExMod(1, -13, Dots[I]);
if not PointInBox(MSDot, MSBox2) then Continue;
SetColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.47, 0.13);
SMART_DrawBox(IntToBox(MSDot.X-25, MSDot.Y-25, MSDot.X+25, MSDot.Y+25));
FindColorsTolerance(TPA, 9278612, Max(MSDot.X-20, MSX1), Max(MSDot.Y-20, MSY1), Min(MSDot.X+20, MSX2), Min(MSDot.Y+20, MSY2), 6);
SetColorToleranceSpeed(1);
If Length(TPA) < 3 then Continue;
MiddleTPAEx(TPA, x, y);
if FindColor(ax, ay, 10240, Max(X-5, MSX1), Max(Y-30, MSY1), Min(X+5, MSX2), Min(Y-10, MSY2))
or FindColor(ax, ay, 132923, Max(X-5, MSX1), Max(Y-30, MSY1), Min(X+5, MSX2), Min(Y-10, MSY2)) then Continue;
MMouse(X, Y, 0, 0);
if not WaitUptext('eagul', 200) then Continue;
Mouse(X, Y, 0, 0, True);
Result := DidClick(True, 400);
Break;
end;
end;


procedure CombatWait;
var
HPBarDTM, x, y, TimeMark: Integer;
begin
HPBarDTM := DTMFromString('mQwAAAHicY2ZgYGAEYnMGTJADxNbsTGCMBwAAL94BMA==');
TimeMark := GetSystemTime;
while not FindDTM(HPBarDTM, x, y, MSCX-110, MSCY-90, MSCX+110, MSCY+80) do
begin
if GetSystemTime-TimeMark > MaxCombatTime then Break;
if Random(200) = 0 then AntiBan;
if (GetSystemTime-TimeMark > 1000) and not FindColor(x, y, 10240, MSCX-80, MSCY-80, MSCX+80, MSCY+80) then Break;
Wait(100);
end;
FreeDTM(HPBarDTM);
end;


function LoginPlaya: Boolean;
begin
Result := LoginPlayer;
if not Result then Exit;
ClickNorth(SRL_ANGLE_HIGH);
SetRun(True);
end;


function MainLoop: Boolean;
var
WalkCenterFails: Integer;
begin
Result := False;
if IsFKeyDown(9) then TerminateScript;
if Attack then
begin
if Random(16) = 0 then AntiBan;
Wait(3600);
CombatWait;
end else
begin
Wait(200);
if (GetColor(487, 40) = 2994685) then Mouse(485, 38, 5, 5, True);//Close p2p advert
while not WalkCenter do
begin
if WalkCenterFails > 9 then Exit;
WriteLn('WalkCenter Failed! Attempt '+IntToStr(WalkCenterFails+1)+'/10');
Wait(1000);
case (WalkCenterFails mod 4) of
0:
begin
if not WaitFunc(@LoggedIn, 50, 3000) then LoginPlaya;
end;
1:
begin
MakeCompass('N');
end;
2:
begin
FindNormalRandoms;
end;
3:
begin
if ExitToLobby then LoginPlaya;
end;
end;
Inc(WalkCenterFails);
end;
end;
Result := True;
end;


procedure CrashSMART;
begin
Writeln('You are using CRASHSMART, so we are going to reload your client after the RS update!');
SmartgetFieldObject(1488,'crash'); // will crash SMART (and Simba).
// IF THIS DOES NOT CRASH YOUR SIMBA, YOU ARE NOT USING THE PROPER PLUGIN
// AN ACCESS VIOLATION HERE IS NOT THE CRASH; MAKE SURE YOU MOVED THE EDITED PLUGIN
Wait(5000);
WriteLn('CRASHSMART Failed: Make sure you are using the proper plugin!');
WriteLn('Read more about this feature at villavu.com/forum/showthread.php?t=67864');
TerminateScript;
end;


begin
Smart_Server := SmartWorld;
SRL_Procs[srl_OnRSUpdate] := @CrashSMART;
SetupSRL;
SmartSetRefresh(100);
DeclarePlayers;
MouseSpeed := 15;
repeat
LoginPlaya;
Retaliate(True);
repeat
until(not MainLoop);
Logout;
Players[CurrentPlayer].Active := False;
CurrentPlayer := NextPlayerIndex;
until(AllPlayersInActive);
end.

YoHoJo

2012-02-21 18:26:38

xp/hr with a good account?
Sweet, thanks!

weequ

2012-02-21 18:29:59

From: YoHoJo
xp/hr with a good account?
Sweet, thanks!
I'm not sure but I remember getting like 8k xp/hr with a powerbot script. I should add progress report so we would know :p

I also think the monsters spawn faster in a crowled server.

YoHoJo

2012-02-21 18:33:02

D: Oh, not as good as I thought, but that's nice for low level guys!

weequ

2012-02-21 18:35:07

From: YoHoJo
D: Oh, not as good as I thought, but that's nice for low level guys!
Yeah this is only good for leveling up your armies or leveling up your pure without eating. I think seagulls are faster xp than chickens especially since chickens are currently pretty crowded or so I heard.

Kyle Undefined

2012-02-21 18:36:32

Will run this on my level 4, need to get his defense up.

weequ

2012-02-21 19:05:14

From: Kyle Undefined
Will run this on my level 4, need to get his defense up.
Thanks. Make sure to redownload if you downloaded before this post. I fixed a weird error where a function was sometimes returning true by default making the failsafes to not work properly.

Kyle Undefined

2012-02-21 19:06:36

Haven't downloaded it yet, waiting till I get home from the office :) Taking a break from crafting lol. 73 crafting from spinning bowstrings is good enough :p

Kyle Undefined

2012-02-22 01:09:02

Hey man, was going to run this but it keeps erroring out saying that "FindCenter" is not valid, and I don't see it in the script at all.

weequ

2012-02-22 04:09:26

From: Kyle Undefined
Hey man, was going to run this but it keeps erroring out saying that "FindCenter" is not valid, and I don't see it in the script at all.
Damn I must have removed it by accident. Please redownload.

Kyle Undefined

2012-02-22 10:29:17

Sweet, running it now! It sometimes tries to attack a seagull when it's still fighting another one, but it's running great!

weequ

2012-02-22 11:29:37

From: Kyle Undefined
Sweet, running it now! It sometimes tries to attack a seagull when it's still fighting another one, but it's running great!
After fighting a long time because there is a timeout which is a constant value. It sometimes rarely does that to me too though.

There is still room for improvements like attacking moving seagulls. I should make it move the mouse like 90% towards the seagull then recheck and possibly correct the location of the seagull.

Kyle Undefined

2012-02-22 11:33:05

Yeah, it's running fine though. I agree about the moving seagulls, it misclicks them a lot :p just got 20 def lol.

Ran until I got the "Client Token" message, which was a little pass 6 hours. Great script!

Just finished another session, had 4 defense before I used your script.