SRL Archive - Research & Development Lounge

NO reason!


TheSantaMan

2007-09-08 14:32:24

ok this feather picking procedure should work. The colors are there but it just doesn't move the mouse to the colors. Look at this script. If anyone wants to test great. I just don't understand why the script sometimes skips the progress report, and always misses the feather picking procedure


  program Jesus45Chickenmassacre;
{.include SRL\SRL.scar}
{.include srl/srl/skill/Fighting.scar}

///////////////////////////////////////////////////////////////
// /////// ////// ////// // // ////// //
// // /// // // // // //
// // // ////// //// // // ///// //
// // // /// // // // // //
// ///// /////// ////// ///// ////// //
///////////////////////////////////////////////////////////////

//specail thanks to drnewheart, for help :)

{========================================================
[ Jesus45 ChickenMassacre ]
[ ]
[ Description: This is V.1 of Jesus45's chicken ]
[ Massacre. Drag the CrossHairs ]
[ Over the Runescape client, setup ]
[ Users below and options then hit ]
[ play button. Happy Autoing :) ]
==========================================================}

{FILL OUT OPTIONS HERE} {PLAYER SETUP BELOW}


const
FightingStyle = 2; // 1 = attack 2 = strength 3,4 = defense
WantToPickUpFeathers = true; // True to pick up feathers, false to not.
ChickenKills = 5; //how many chickens you want to kill.



Var////////////////////////////////////////////////////////
ChickensKilled: integer;// DONT CHANGE !! //
x,y,Mark1: integer; // DONT CHANGE !! //
Feather: integer; // DONT CHANGE !! //
///////////////////////////////////////////////////////

{*************************************************************}
procedure DeclarePlayers; //
begin //
HowManyPlayers := 6; //Number of PLAYERS. active or not. //
NumberOfPlayers(HowManyPlayers); //
CurrentPlayer := 0; //Player to start on. //
{*************************************************************}


{SET ALL USERS CORRECTLY}

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := ''; // 3 letters of your username
Players[0].Active := True;

Players[1].Name := 'UserName';
Players[1].Pass := 'Password';
Players[1].Nick := '3-4 letters of UserName';
Players[1].Active := False;

Players[2].Name := 'UserName';
Players[2].Pass := 'Password';
Players[2].Nick := '3-4 letters of UserName';
Players[2].Active := False;

Players[3].Name := 'UserName';
Players[3].Pass := 'Password';
Players[3].Nick := '3-4 letters of UserName';
Players[3].Active := False;

Players[4].Name := 'UserName';
Players[4].Pass := 'Password';
Players[4].Nick := '3-4 letters of UserName';
Players[4].Active := False;

Players[5].Name := 'UserName';
Players[5].Pass := 'Password';
Players[5].Nick := '3-4 letters of UserName';
Players[5].Active := False;

NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;
{************************************************************************}
{ Logs In Player If Not Already Logged In }
{************************************************************************}
Procedure Log;
begin
LoginPlayer;
Wait(500);
end;


{************************************************************************}
{ Sets the color brightness to highest }
{************************************************************************}
Procedure ReallyBrightColor;
Begin
begin
GameTab(11);
Wait(500+random(12));
end;
If GetColor(712, 226) <> 16777215 Then
Begin
Mouse(712, 226, 2, 2, True);
Wait(300+random(50));
End;
end;

{************************************************************************}
{ Anti ban & Anti random }
{************************************************************************}
Procedure JesusNoBanPlz; // Took alot of advice from JAD on
begin
if(not(LoggedIn))then // the anti ban (thanks).
ReallyBrightColor;
begin
case random(3) of

1: PickUpMouse;

2: begin
TypeSend('wow im almost up a str lvl');
Wait(1000+random(500));
GameTab(4)
end;

3: begin
HoverSkill('Strength',false);
Wait(1000+random(200));
GameTab(4)
end;
end;
end;
end;


{************************************************************************}
{ Anti Randoms }
{************************************************************************}
Procedure Randoms;
Begin
FindNormalRandoms;
end;

{************************************************************************}
{ FightStyle }
{************************************************************************}
Procedure FightStyle(Style:string);
begin
case Style of
'1': SetFightMode(1);
'2': SetFightMode(2);
'3': SetFightMode(3);
'4': SetFightMode(4);
end;
Wait(500+random(200));
end;

/////////////////////////////////////////////////////////////////////////////
Procedure AttackChicken;
Begin
FightNPC(5796737,5928324,3627637,3627637,5928324,7904432,15,15);
ChickensKilled:= ChickensKilled+1;
end;
{*******************************************************************}
{ Picks Up Feathers. }
{*******************************************************************}
function PickUpFeathers(Color1,Color2,Color3 :Integer): Boolean;

var
P: Integer;
var Color: array[1..3] of Integer;
begin

Color[1]:= 10790340;
Color[2]:= 9728;
Color[3]:= 9869499;


for P := 1 to 3 do
begin
If (WantToPickUpFeathers = True) then
if FindColorSpiral(x,y, Color[P],MSX1,MSY1,MSX2,MSY2)then
begin
Result := True;
Mouse(x,y,0,0,False);
ChooseOption('fea');
Wait(500+random(150));
end else
Writeln('Missed the feathers');
end;
end;


{******************************************************************}
{ Progress Report. }
{******************************************************************}
Procedure Report; //Specail thanks to drnewheart for the report.
begin
Writeln('***********************************');
Writeln('*****Jesus45''s Chicken Killer*****');
Writeln('****Killed '+(IntToStr(ChickensKilled))+' Chickens!****');
Writeln('****Worked For '+ TimeRunning+'****');
Writeln('****Gained About '+IntToStr(ChickensKilled*3*4)+' Exp!****');
Writeln('***********************************');
end;

{*****************************************************************}
{ Main Loop }
{*****************************************************************}

begin
SetupSrl;
ActivateCLient;
DeclarePlayers;
LoginPlayer;
ReallyBrightColor;
FightStyle(IntTOStr(FightingStyle));
repeat
JesusNoBanPlz;
AttackChicken;
PickUpFeathers(10790340,9728,9869499);
until (ChickensKilled) = (ChickenKills);
Report;
end.
help !!

Harry

2007-09-08 14:35:52

Add wait betweek Mouse and the hose option, like 500=Random(400);

Derek-

2007-09-08 16:06:29

and note that you don't need the (Color1,Color2,Color3 :Integer) in your feather procedure(it isn't doing anything)

function PickUpFeathers(Color1,Color2,Color3 :Integer): Boolean;  //just
function PickUpFeathers: Boolean; //will work


EDIT: So I would change function to this

function PickUpFeathers: Boolean;

var
P, x, y: Integer;
var Color: array[1..3] of Integer;
begin

Color[1]:= 10790340;
Color[2]:= 9728;
Color[3]:= 9869499;

for P := 1 to 3 do
begin
if FindColorSpiral(x,y, Color[P],MSX1,MSY1,MSX2,MSY2)then
begin
Result := True;
MMouse(x,y,0,0);
if IsUpText('fea') then
begin
Mouse(x, y, 0, 0, False);
Wait(300 + Random(200));
ChooseOption('fea');
Wait(500+random(150));
end;
end else
Writeln('Missed the feathers');
end;
end;

That way it wont click anything that isn't a feather.

Macrosoft

2007-09-08 22:13:32

function PickUpFeathers(Color: TIntegerArray): Boolean;
//example of use, PickUpFeathers([0000, 0000, 0000]; you can do any amount of colors now
var
P: Integer;
x, y: Integer;
begin
If (WantToPickUpFeathers = True) then
begin
for P := 0 to GetArrayLength(color) do //P needs to start at 0, because thats how arrays start
begin
If (FindColorSpiral(x,y, Color[P],MSX1,MSY1,MSX2,MSY2)) then
begin
Mouse(x,y,0,0,False);
ChooseOption('fea');
Wait(500+random(150));
Result := True;
Exit;// exits the function if feather is picked up
end else
Writeln('Missed the feathers...Checking next color');
end;
Writeln('Couldnt find feathers');
Result := False;//if it had picked up the feathers, it would have exited, so false
end else
Result:=False;
end;

end;

I changed a few things. You had Color1, Color2, Color3, which did not do anything in the function. I removed those. the colors you had declared in the function were the ones being used. I deleted that and made it so that you can do any amount of colors! Now, Either PickUpFeathers([1023, 1203, 1209, 12093, 1294), or PickUpFeathers([1204, 1049]) will work. Nice eh? Its simple, i just declared it as a tintegerarray, or a tarray of integers. Because we dont know how many colors there will be, i used getarraylength.

You dont need to check if they want to pick up feathers everytime, this slows down the script, so i did that if before the for loop

See the comments I added in the script for reasons of my other changes.

If you want it to remain just 3 colors, you could change it to this

function PickUpFeathers(Color1,Color2,Color3 :Integer): Boolean;

var
P: Integer;
x, y: integer
var Color: array[0..2] of Integer;//arrays start with 0
begin

Color[0]:= Color1; //changed this so the colors equal the input
Color[1]:= Color2;
Color[2]:= Color3;

if(WantToPickUpFeathers = True) then
begin
for P := 0 to 2 do
begin
If(FindColorSpiral(x,y, Color[P],MSX1,MSY1,MSX2,MSY2))then
begin
Result := True;
Mouse(x,y,0,0,False);
ChooseOption('fea');
Wait(500+random(150));
end else
Writeln('Missed the feathers');
end;
end else
Result:=False;
end;

instead of your for loop, i would use findobjectmulti, its more reliable, tell me if you need help using it and ill do it for you. However, findobjectmulti is only for when the feather is on top and apears in the uptext area, i dont want to script it if it isn't lol, cuz im tired.

wow that was time consuming, hope it helped!
P.S. Plus rep is a good way to show appreciation lol

Santa_Clause

2007-09-08 23:35:41

You should probably use a Deformed Bitmap…

ZephyrsFury

2007-09-09 00:23:38

From what I can remember the text for feathers is "Feather" or "Feathers" either way I think the the "F" is supposed to be capital so your ChooseOption might not work.

Also, in your for do loop, the script will continue searching for the next colour even if it finds the feathers because you haven't told it to break yet. You should add Break; after Wait(500 + random(150));

Another reason could be because you don't have tolerances in your colours. Even if you picked the colours just before you ran the script, the main screen could have shifted and the colour changed or something.

Lastly, I'm not a big fan of using FindColorSpiral to find objects. I think FindObj or FindObjCustom would be a lot better because it checks for up text and will move you mouse around to screen to similar colours to find the obj. FindColor will just stay mostly around the same spot on the screen.

Macrosoft

2007-09-09 08:44:15

hes right, use chooseoption('eathers')

that will work better