SRL Archive - First Scripts

My attempts at making a fighter realize it is indeed fighting.


eh big

2013-02-24 21:33:56

So over the past couple days I have been trying to make the bot realize that I was indeed fighting something so here is my feeble attempts it seems to realize its fighting 80 percent of the time.

Program testP07;

{$I SRL/SRL.Simba}
{$I P07Include.Simba}

//LOGIN INFO STUFF
Procedure P07_DeclarePlayer;
Begin
P07_PlayerName:='username';
P07_PlayerPass:='password';
End;
const
player_mom= 6056309;//monster color


Function IsFighting: Boolean;
var
PBox: TBox;
Begin
PBox := IntToBox(238, 169, 279, 217);
Result := (AveragePixelShift(PBox, 250, 350) > 15);
End;
function fight:boolean;
var
x, y:integer;
tmpCTS,i, L,Counter,Fighter: Integer;
begin
if IsFighting then
begin
repeat
until (not IsFighting)
end;
if FindColorTolerance(X, Y, player_mom, 6, 0, 514, 484, 5) then
mmouse(x, y,1,1);
wait(randomrange(200,400))
if (P07_IsUpTextMultiCustom(['Giant', 'Attack'])) then
clickmouse (x, y, mouse_left);
Wait(RandomRange(800, 1200));
While IsFighting do
Wait(RandomRange(400, 800));
if not IsFighting then
End;

begin

P07_DeclarePlayer;
SetupP07Include;
ActivateClient;
Wait(2000);
If (Not P07_LoggedIn) Then
P07_LogInPlayer;
repeat
fight;
until(false);

End.

Hazzah

2013-02-24 22:35:39

Try
 [ simba][/ simba]
Remove the spaces

It makes reading these things so much easier.

eh big

2013-02-24 22:49:32

ah that it does thanks

Runehack123

2013-02-24 23:32:41

repeat
until (not IsFighting)
end; << Repeat what? Add a wait…Add some antiban…You can't just repeat nothing.

Also, having player_mom= 6056309;//monster color as a global constant is bad practice. This should be local.
Always local > global

And as for those variables you never use >> tmpCTS,i, L,Counter,Fighter: Integer;
I don't understand why they are there?

Best of luck in finishing this,
Runehack123 :o

eh big

2013-02-25 00:53:26

took the stuff out that you mentioned, the reason I had the repeat there was to try and make sure the bot checked for a hp bar before it started the next sequence. but as you can see i am not sure how to do that.


Program testP07;

{$I SRL/SRL.Simba}
{$I P07Include.Simba}

//LOGIN INFO STUFF
Procedure P07_DeclarePlayer;
Begin
P07_PlayerName:='username';
P07_PlayerPass:='password';
End;


Function IsFighting: Boolean;
var
PBox: TBox;
Begin
PBox := IntToBox(238, 169, 279, 217);
Result := (AveragePixelShift(PBox, 250, 350) > 15);
End;
function fight:boolean;
var
x, y:integer;
begin
While IsFighting Do Wait(2000+Random(50));
if FindColorTolerance(X, Y, 6056309, 6, 0, 514, 484, 5) then
mmouse(x, y,1,1);
wait(randomrange(200,400))
if (P07_IsUpTextMultiCustom(['Giant', 'Attack'])) then
clickmouse (x, y, mouse_left);
Wait(RandomRange(800, 1200));
While IsFighting do
Wait(RandomRange(400, 800));
if not IsFighting then
End;

begin

P07_DeclarePlayer;
SetupP07Include;
ActivateClient;
Wait(2000);
If (Not P07_LoggedIn) Then
P07_LogInPlayer;
repeat
fight;
until(false);

End.

eh big

2013-02-26 19:35:47

Alright so finally after a few days figured it out ha! fights giant rats and Waits until the rat is dead to move onto the next one whoohoo



Program Giantrat_killer;

{$I SRL/SRL.Simba}
{$I P07Include.Simba}

//LOGIN INFO STUFF
Procedure P07_DeclarePlayer;
Begin
P07_PlayerName:='username';
P07_PlayerPass:='password';
End;
const
player_mom= 9671304;//Giant rat

Function IsFighting: Boolean;
var
PBox: TBox;
Begin
PBox := IntToBox(238, 169, 279, 217);
Result := (AveragePixelShift(PBox, 250, 350) > 15);
End;
Procedure fight;
var
x, y:integer;
begin
if FindColorTolerance(X, Y, player_mom, 6, 0, 514, 484, 5) then
begin
mmouse(x, y,1,1);
wait(randomrange(200,400))
if (P07_IsUpTextMultiCustom(['Giant', 'Attack'])) then
clickmouse (x, y, mouse_left);
Wait(RandomRange(800, 1200));
repeat
Wait(RandomRange(400, 800));
until (not IsFighting)
End;
End;
Begin

P07_DeclarePlayer;
SetupP07Include;
ActivateClient;
Wait(2000);
If (Not P07_LoggedIn) Then
P07_LogInPlayer;
repeat
fight;
until(false);

End.

kiwiownage

2013-02-27 03:21:32

Is that IsFighting boolean working? if so can I steal it? <3

Le_don

2013-02-27 07:55:49

Good job on the fighter.