SRL Archive - First Scripts

FalconY


ogustuce

2012-02-23 17:07:33

lol i tried to start writing a falcony script but i think my knowledge is too basic(I mean VERY basic). i keep getting identifier error >.< winch i dont really understand the meaning. w/e heres is what it look like (INCOMPLETE) I think my structure is the problem lol
FEEL FREE TO GIVE ME HINTS,TIPS =D apreciated

 
program Ogy's Falcony;
{$i srl/srl.simba}
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;

procedure FalconGuy;

var x, y: integer;

begin
if FindObj(x, y, 'alk-to', 3251357, 35) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('alcony');
end;


begin
repeat
if(FindColorTolerance(x, y, 3956331, 0, 0, 700, 500, 5))then
begin
Mouse(x,y,1,1,True);
Wait(2000);
end;
begin
if(FindColorTolerance(x, y, 4212298, 0, 0, 700, 500, 5))then
Mouse(x,y,1,1,True);
end;

begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
end;
begin;
end;
end.

ogustuce

2012-02-23 17:08:39

btw, how do i had a 'simba code' into a post lol?

Nebula

2012-02-23 17:10:57

[SIMBA*] [*/SIMBA]


Without the *'s

ogustuce

2012-02-23 17:14:08

hmm, i dont get it?

its like:

[*SIMBA] [*/SIMBA]
code

or

[*SIMBA] [*/SIMBA]
code
[*SIMBA] [*/SIMBA]
? (without the *'s)

BraK

2012-02-23 17:20:15

Remove the * for using Simba tags with Code.

ogustuce

2012-02-23 17:28:32

kk go it so its
[*SIMBA]
code
[*/SIMBA]
(without the *'s)
thanks =)

Savvy

2012-02-23 18:22:48

program OgysFalcony; // NO ' mate
{$i srl/srl.simba}
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;

procedure FalconGuy; //your procedure had no ending before brother

var x, y: integer;

begin
if FindObj(x, y, 'alk-to', 3251357, 35) then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('alcony');
end;


begin
repeat
if(FindColorTolerance(x, y, 3956331, 0, 0, 700, 500, 5))then
begin
Mouse(x,y,1,1,True);
Wait(2000);
end;
begin
if(FindColorTolerance(x, y, 4212298, 0, 0, 700, 500, 5))then
Mouse(x,y,1,1,True);
end;
Until(false);
end;
end;


Begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
End.// final end is with . not ;
there ya go mate, compiled successfully

ogustuce

2012-02-23 19:09:19

oh thanks

ogustuce

2012-02-23 19:29:12

why doesnt the script try to click on the yellow hairs of the falcon guy?

code line:
begin
repeat
if(FindColorTolerance(x, y, 3318436, 0, 0, 700, 500, 30))then
begin
Mouse(x, y, 2, 2, false);
ChooseOption('alcony');
end;

ogustuce

2012-02-23 19:33:08

maybe i need higher tolerence? or i got wrong coordinates?

ogustuce

2012-02-23 19:51:43

nvm, i figured

ogustuce

2012-02-23 20:12:11

is there a way to make the script press a button on the keyboard? like the space bar or no.1

Ashaman88

2012-02-23 20:37:49

typesend('blah');

ogustuce

2012-02-23 20:42:34

kk thanks, but is there a way to make it press '1' without pressing 'enter' after rather than press '1' then press 'enter' ??

ogustuce

2012-02-23 20:47:39

is there a place where i can see all the stuff u can put into ( ) after a 'until' ?

ogustuce

2012-02-23 21:56:44

oki, i got this updated but its still far from being perfect. but its a start =)


program Falcony;
{$DEFINE SMART}
{$i srl/srl.simba}

var x,y,stuck:integer;

Procedure DeclarePlayers;

begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;


Procedure SpottedKebbit;
begin
repeat
if(FindColorTolerance(x, y, 3956331, 0, 0, 700, 500, 5))then
begin
wait(1000 + random(50));
Mouse(x,y,1,1,True);
Wait(2000);
end;
until(true);
end;

procedure GetCaughtKebbit;
begin
repeat
if(FindColorTolerance(x, y, 5725796 , 0, 0, 700, 500, 5))then
begin
wait(1000 + random(50));
Mouse(x,y,1,1,True);
Wait(2000);
end;
until(true);
end;

begin
Smart_Server := 86;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;

SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;

ClickNorth(SRL_ANGLE_HIGH);


repeat

if not (LoggedIn)then
begin
TerminateScript;
end;

SpottedKebbit;
GetCaughtKebbit;

if (Stuck > 3)then
begin
WriteLn('We are stuck, logging out')
Logout;
TerminateScript;
end;


until(AllPlayersInactive);

end.

espritje

2012-02-24 03:58:59

try to adde some antiban?

masterBB

2012-02-24 05:04:36

SendKeys('1', 50); note that 50 is the time between key presses.

You can put anything of the type Boolean in an until(x); , for example:
program new;

var
coins:Integer;

procedure PickUpCoins;
begin
//Find them
//Click them
Inc(Coins); //increase coins by one
end;

function NoFood:Boolean;
var
CountedFood;
begin
CountedFood := 5; //your function found 5 food
Result := CountedFood > 0;
end;

begin
repeat
coins := 0;
repeat;
PickUpCoins
until(coins > 100);

repeat
FightKalphiteQueen;
until(NoFood);

until(Invfull);
end.

VillaVuFTW

2012-02-24 06:08:31

I would use TPAs to find everything.. if I were you.. it would make things a lot more smoother :33 and more accurate.

ogustuce

2012-02-24 21:05:09

im beginner scrupter =p idk how to make TPAs but ill look it up

ogustuce

2012-02-27 21:09:46

alright, heres an updtade PLEASE FEEL FREE TO HELP ME
NOT FINISHED

my biggest problem is to find a unique color for the spotted kebbit


program ogyFalcony;
{$DEFINE SMART}
{$i srl/srl.simba}

var
x,y,stuck:integer;
MyTPA : TPointArray;
MyPoint : TPoint;

Procedure DeclarePlayers;

begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;





Procedure SpottedKebbit;
var
x, y, i : Integer;
begin
repeat
FindColorsTolerance(MyTPA, 3360859, MSx1, MSy1, MSx2, MSy2, 2);
if Length(MyTPA) = 0 then FindColorsTolerance(MyTPA, 3360859, MSX1, MSY1, MSX2, MSY2, 2);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i] MMouse (MyPoint.x, MyPoint.y, 3, 3);
if (IsUpTextMultiCustom(['potted','ebbit'])) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
ChooseOption('atch');
Wait(500+random(250));
end;
wait(350+random(200));
end;
until(false);
end;

procedure GetCaughtKebbit;
var
x, y, i : Integer;
begin
repeat
FindColorsTolerance(MyTPA, 9544615, MSx1, MSy1, MSx2, MSy2, 3);
if Length(MyTPA) = 0 then FindColorsTolerance(MyTPA, 9544615, MSX1, MSY1, MSX2, MSY2, 3);
for i := 0 to High(MyTPA)do
begin
MyPoint := MyTPA[i] MMouse (MyPoint.x, MyPoint.y, 3, 3);
if (IsUpTextMultiCustom(['yr','alcon'])) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
wait(500+random(200));
ChooseOption('etrieve');
Wait(500+random(250));
end;
wait(350+random(200));
end;
until(false);
end;


begin
Smart_Server := 86;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;

SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;

ClickNorth(SRL_ANGLE_HIGH);


repeat

if not (LoggedIn)then
begin
TerminateScript;
end;

SpottedKebbit;

GetCaughtKebbit;

if (Stuck > 3)then
begin
WriteLn('We are stuck, logging out')
Logout;
TerminateScript;
end;


until(AllPlayersInactive);

end.

ogustuce

2012-02-27 21:16:26

and how do you set the mouse speed?

ogustuce

2012-02-29 01:30:17

UPDATED
i switched to DTMs winch makes it easier. still alot of work to but its progressing =)

program ogyFalcony;
{$DEFINE SMART}
{$i srl/srl.simba}

var
x,y,stuck,Spotted,Falcon,tried :integer;
MyTPA : TPointArray;
MyPoint : TPoint;
aFound: Extended;

Procedure DeclarePlayers;

begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;

procedure SetDTM;
begin
Spotted := DTMFromString('mbQAAAHicY2VgYNjECMEbgXgrEG8GYl2guAEQqwOxPhBrAXFKiDmDk5UOQ0a4FUNejC1DSrgTAxdQHB0zYsFgAACgMQkw');
Falcon := DTMFromString('mQwAAAHicY2ZgYDgIxMeAeD8QN0FxKxCbGukxWJkbMdjbmDPwA/kgzArEjEgYCAAThQXj');
end;

procedure FrDTM;
begin
FreeDTM(Spotted);
FreeDTM(Falcon);
end;

procedure ClickOnSpotted(PX:Integer; Click: Boolean);
begin
if FindDTMRotated(PX, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Mouse(x, y, 3, 3, Click);
end;
end;


procedure ClickOnFalcon(PX:Integer; Click: Boolean);
begin
if FindDTMRotated(PX, x, y, MSX1, MSY1, MSX2, MSY2, -Pi, Pi, Pi/30, aFound) then
begin
Mouse(x, y, 3, 3, Click);
end;
end;




begin
Smart_Server := 86;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;

SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;

ClickNorth(SRL_ANGLE_HIGH);


repeat

if not (LoggedIn)then
begin
TerminateScript;
end;

repeat

repeat
SetDTM;
MouseSpeed := 18;
ClickOnSpotted(Spotted, False);
wait(200+random(200));
ChooseOption('atch');
wait(3200+random(150));
FrDTM;
until(tried = 10)

repeat
SetDTM;
MouseSpeed := 18;
ClickOnFalcon(Falcon, False);
wait(200+random(150));
ChooseOption('etrieve');
wait(3000+random(250));
FrDTM;
until(tried = 10)

until(invfull);

if (Stuck > 3)then
begin
WriteLn('We are stuck, logging out')
Logout;
TerminateScript;
end;


until(AllPlayersInactive);

end.