Log in

View Full Version : Hey need some help on first script



axel2
09-15-2006, 11:41 PM
So im writing this woodcutter script. Its going to cut oaks, then go to the general store and sell them. Anyways, i cant figure out how to make it so it knows when the inventory is full and once the inventory is full to switch to the procedure to walk to the store. Suggestions anyone?
edit::
program OakCutter;
{.include SRL\SRL.scar}

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/////////////////////////////Axels first script////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
{Cuts Oaks behind the general store in Lumbridge and sells to the store }
{-----------------------------------------------------------------------------}

Var Bitmap:Integer;

Procedure DeclarePlayers;
begin
HowManyPlayers :=2;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:=0;

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

Players[1].Name :='sototallyswe';
Players[1].Pass :='';
Players[1].Nick :='ally';
Players[1].Active:=False;
end;

Procedure DeclareBMPS;

begin
Bitmap:= BitmapFromString(11, 12, 'z78DA95916B0EC32' +
'00C83AF140849E0278FEEFE471ACCED96AD9AD462C94291F5 2510' +
'0A34D5B8F5C6DA8CB56A4812F263FB68EB4B232ED554479D4 98D3' +
'CB48945234730B16109045A276C71A9CB122A47AF0F01959F 1912' +
'55CF814B67A1921A33F1FB2E617C1316B9919528D98483C19 17F7' +
'1087C53CE07F38BF0EA0B02BC566941E185D283021C04B8FF 0124' +
'AF13700721D712F33EF35D82DFC5DD57ECFFE308854B2F9C5 5E6E' +
'2AF10B03BE1D97A9C397EE3789DDFB29216D99007C1733CCD 33E1' +
'A8F8A427FCA39DE5934F9B6CAB55');

End;

Procedure CutOak;
begin
If (FindcolorTolerance(x,y,4486295,50,42,455,281, 10)) or (findcolor(x,y,5075056,50,42,455,281))Then;
wait(random(50)+500)
MMouse(x,y, 5, 5);
wait(random(100)+200)
Mouse(x,y,5,5,false);
wait(random(200)+500)
if FindcolorTolerance(x,y,16776960,40,70,427,275, 10)then MMouse(x,y, 5, 5)
Mouse(x,y,5,5,true);
wait(random(2000)+25000)
end;

Procedure ClickBMPS;
begin
wait(300+random(32))
MMouse(x,y, 5, 5);
wait(32+random(16))
Mouse(x,y,5,5,true);
end;

Procedure FindBMPS;
begin
if(FindBitmap(Bitmap,x,y))then
ClickBMPS;
end;

begin
SetupSRL;
DeclarePlayers;
DeclareBMPS;
repeat
CutOak;
until(not(loggedin) or inventoryfull)
FindBMPS;
end.



Yeah so it basically sucks, Im having someone help me out and we are redoing alot of it. But suggestions are still wanted since i am still learning to script. This one isnt even close to being finished

t3h ub3r k1tten
09-16-2006, 12:11 AM
heres a good way to do it, use the InventoryFull boolean, and have a repeat loop
Remember! Always break out of your loops! Shown here

repeat
// YourOakChop;
//YourRandomcheck;
until(not(loggedin) or inventoryfull)
// Yourwalktobank;
// Yourbank;


The procedures with // infront of them youll have to write yourself
Any other questions/errors, feel free to ask

axel2
09-16-2006, 12:13 AM
thanks ill try it out

axel2
09-16-2006, 12:31 AM
yeah that didnt work. It stopped trying to chop the tree but it didnt go the the bitmap i selected. hmm....

Mutant Squirrle
09-16-2006, 01:08 AM
bitmaps dont always work for bankwalking if thats what your trying to do. You would want to use a findcolor procedure probably unless your making it cut the logs then thats a different story

bobert5696
09-16-2006, 01:33 AM
post script plz