SRL Archive - First Scripts

Draynor willow chopper + banker.


owned1112

2007-10-07 11:57:33

This is my first script. The walking is REALLY buggy, but please comment. :)
edit: Recommended to start with compass east and highest angle.

program New;
{.include /SRL/SRL.scar}
{.include /SRL/SRL/skill/WoodCutting.scar}
var
x,y,i2,watercolor2,willowcolora,willowcolorb,willowcolorc:integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;


Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Loc := '';
Players[0].Active := True;
Players[0].Integers[1] := 0;
Players[0].Integers[2] := 30; //Loads to do before switching players




NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
WillowColorA := 2319190;
WillowColorB := 2319190;
WillowColorC := 1791306;
end;
function AllPlayersInactive(number : integer) : boolean;
var thisi : integer;
thisi2 : integer;
begin;
thisi := 0;
thisi2 := 0;
for thisi := 0 to number do
begin;
if(Players[thisi].Active = True) then
begin;
Result:=False;
end else
begin;
thisi2:= thisi2 +1;
if(thisi2=number) then
result:=true;
end;
end;
end;
procedure Proggy;
begin;
writeln('Player: ' + Players[CurrentPlayer].name);
writeln('Chopped approximately: ' + inttostr(Players[CurrentPlayer].Integers[1]) + ' willows');
end;
function FindFastRandoms: Boolean; //By WT-Fakawi.
var
i: Integer;
begin
for i := 1 to 8 do
begin
case I of
1: if FindDead then
Result := True;
2: if FindMod then
Result := True;
3: if FindMime then
Result := True;
4: if FindMaze then
Result := True;
5: if FindQuiz then
Result := True;
6: if FindDemon then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
7: begin
if InBlack then
begin
Result := True;
Players[CurrentPlayer].loc := 'InBlack';
Logout;
Exit;
end;
end;
8: RC;
end;
wait(1);
end;
end;
procedure FindRandoms;
begin;
if not loggedin then exit;
FindFastRandoms;
FindNormalRandoms;
end;
procedure Chop;
begin;
if not loggedin then exit;
if findcolor(x,y,WillowcolorA,0,0,1400,1400) or
findcolor(x,y,willowcolorB,0,0,1400,1400) or
findcolor(x,y,willowcolorC,0,0,1400,1400) then
begin;
disguise('Chopping...')
MMouse(x,y,3,3);
if isuptext('hop') then
begin;
GetMousePos(x,y);


Mouse(x,y,0,0,true);
Flag;
wait(4000 + random(1000));
end else
begin;
i2 := 0;
while(i2 < 39) do
begin;
if findcolortolerance(x,y,WillowcolorA,0,0,1400,1400,25) or
findcolortolerance(x,y,willowcolorB,0,0,1400,1400,25) or
findcolortolerance(x,y,willowcolorC,0,0,1400,1400,25) then
begin;
MMouse(x,y,1,1);
if isuptext('hop') then
begin;
GetMousePos(x,y);
Mouse(x,y,0,0,true);
Flag;
end;
end else
wait(4000 + random(1000));
end;
end;

end else
i2 := i2 + 1;
if(i2 = 39) then
begin;
Players[currentplayer].loc := 'lost';
Players[currentplayer].active := False;
nextplayer(true);
end;
end;
procedure ToBank;
begin;
if not LoggedIn then exit;
disguise('Going to bank');
findsymbol(x,y,'bank');
Mouse(x,y,1,1,true);
Flag;
end;
procedure ToWillow;
begin;
if not loggedin then exit;
wait(1000 + random(50))
makecompass('E');
disguise('Going to willow')
HighestAngle;
watercolor2:=FindWaterColor;
if(findcolor(x,y,watercolor2,0,0,1400,1400)) then
begin;
wait(2000 + random(100));
mouse(x,y,1,1,true);
wait(100 + random(100));
Flag;
MakeCompass('E');
FindSymbol(x,y,'fish');
Mouse(x,y,1,1,true)
Flag;
end else
begin;
writeln('Cant find watercolor. Next Player.');
NextPlayer(true);
end;
end;
procedure BankWillows;
begin;
if not loggedin then exit;
disguise('Starting banking procedure')
if(invFull) then
begin;
ToBank;
Disguise('Opening bank and banking.')
OpenBankQuiet('db');
DepositAll;
MakeCompass('E');
Players[currentplayer].Integers[1] := Players[currentplayer].Integers[1] + 1;
if(Players[currentplayer].Integers[1] >= Players[currentplayer].Integers[2]) then
begin;
Proggy;
Players[currentplayer].Active := False;
nextplayer(true);
end;
end;
end;
begin
SetupSRL;
MouseSpeed:=10;
DeclarePlayers;
wait(1000 + random(50));
ActivateClient;
if not LoggedIn then LoginPlayer;
repeat
MakeCompass('E');
ToWillow;
FindRandoms;
repeat
if findcolor(x,y,WillowcolorA,0,0,1400,1400) or
findcolor(x,y,willowcolorB,0,0,1400,1400) or
findcolor(x,y,willowcolorC,0,0,1400,1400) then
begin;
MMouse(x,y,1,1);
FindEnt(x,y,true)
end;
Chop;
FindRandoms;
until(invFull)
FindRandoms;
BankWillows;
until(AllPlayersInactive(1))
end.

purepkking20

2007-10-07 16:53:09

it went 2 cutting then got suck when i had a full load

7Jam

2007-10-07 20:14:23

Same thing happened to as with Purepk. Ecept it stopped right out of bank and just stood there.

owned1112

2007-10-08 01:05:36

I didn't want leechers to view this >_>.
But anyway, fix the problem yourself. If you have ANY common sense, you would probably look at procedure ToBank;. Try adding:

MakeCompass('N');
In the beginning of the procedure.

peter911

2007-10-13 06:56:45

From: purepkking20
it went 2 cutting then got suck when i had a full load


i have same problem

niqje

2007-10-13 13:23:53

it isnt working for me to >_>

Sir R. M8gic1an

2007-10-13 20:45:16

pretty damn good first script. I looked it over, corrected very few things but left you many pointers as how it could be done in different ways, and telling you what you should fix. hope you find that helpful. serious gratz on your first script. btw i also added standards.


program choppernbanker; // always give a program name
{.include /SRL/SRL.scar}
{.include /SRL/SRL/skill/WoodCutting.scar}
var
x, y, i2, watercolor2:integer; //i'd switch i2 to h for example

const
WillowColorA = 2319190; //these are better as constables, because they don't change,
WillowColorB = 2319190; // we only put things as variables when we intend to make them
WillowColorC = 1791306; // change during the script

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

Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Loc := '';
Players[0].Active := True;
Players[0].Integers[1] := 0;
Players[0].Integers[2] := 30; //Loads to do before switching players

NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
// why did u have the wilow colors in declare players?
end;

function AllPlayersInactive(number : integer) : boolean;
var
thisi : integer;
thisi2 : integer;
begin;
thisi := 0;
thisi2 := 0;
for thisi := 0 to number do
begin;
if(Players[thisi].Active = True) then
begin;
Result:=False;
end else
begin;
thisi2:= thisi2 +1;
if(thisi2=number) then result:=true;
end;
end;
end;

procedure Proggy;
begin;
writeln('Player: ' + Players[CurrentPlayer].name);
writeln('Chopped approximately: ' + inttostr(Players[CurrentPlayer].Integers[1]) + ' willows');
end;

function FindFastRandoms: Boolean; //By WT-Fakawi.
var
i: Integer;
begin
for i := 1 to 8 do
begin
case I of
1: if FindDead then
Result := True;
2: if FindMod then
Result := True;
3: if FindMime then
Result := True;
4: if FindMaze then
Result := True;
5: if FindQuiz then
Result := True;
6: if FindDemon then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
7: begin
if InBlack then
begin
Result := True;
Players[CurrentPlayer].loc := 'InBlack';
Logout;
Exit;
end;
end;
8: RC;
end;
wait(1);
end;
end;

procedure FindRandoms;
begin;
if not loggedin then exit;
FindFastRandoms;
FindNormalRandoms;
end;

procedure Chop;
begin;
if not loggedin then exit;
if findcolor(x,y,WillowcolorA,0,0,1400,1400) or
findcolor(x,y,willowcolorB,0,0,1400,1400) or
findcolor(x,y,willowcolorC,0,0,1400,1400) then
begin //you have begin; here, usually we only put begin without the ";"
disguise('Chopping...')
MMouse(x,y,3,3);
if isuptext('hop') then
begin;
GetMousePos(x,y);
Mouse(x,y,0,0,true);
Flag; //when you use flag it'll wait until the flag is gone,
wait(4000 + random(1000)); // i guess this wait is to give it time to chop?
end else
begin;
i2 := 0;
while(i2 < 39) do
begin
if findcolortolerance(x,y,WillowcolorA,0,0,1400,1400,25) or
findcolortolerance(x,y,willowcolorB,0,0,1400,1400,25) or
findcolortolerance(x,y,willowcolorC,0,0,1400,1400,25) then
begin
MMouse(x,y,1,1);
if isuptext('hop') then
begin;
GetMousePos(x,y);
Mouse(x,y,0,0,true);
Flag;
end;
end else
wait(4000 + random(1000));
end;
end;

end else
i2 := i2 + 1;
if(i2 = 39) then
begin;
Players[currentplayer].loc := 'lost';
Players[currentplayer].active := False;
nextplayer(Players[currentplayer].active);
{you had next player (true) here, that means it'd get lost
but it would still try to play again next time. nextplayer(true) means
that the current player will be left to true.
next player false means that you'll switch to next player but that this
one will be left false. and you should only switch the player at the end
of the cycle in the mainloop, so that the next player doesn't start in
this programming loop, looking for the trees.
}
end; .
end;

procedure ToBank;
begin;
if not LoggedIn then exit;
disguise('Going to bank');
findsymbol(x,y,'bank');
Mouse(x,y,1,1,true);
Flag;
end;

procedure ToWillow;
begin;
if not loggedin then exit;
wait(1000 + random(50))
makecompass('E');
disguise('Going to willow')
HighestAngle;
watercolor2:=FindWaterColor;
if(findcolor(x,y,watercolor2,0,0,1400,1400)) then
begin;
wait(2000 + random(100));
mouse(x,y,1,1,true);
wait(100 + random(100)); //the fish symbol will constantly be changing place,
Flag; // do not rely too much on this, although it does work
MakeCompass('E'); // most the time. for other symbols like bank it might
FindSymbol(x,y,'fish'); // totally screw up your script, like it may click the bank script
Mouse(x,y,1,1,true) // and actually go to a wall on the outside part of the bank
Flag;
end else
begin;
writeln('Cant find watercolor. Next Player.');
Players[currentplayer].loc := 'lost';
Players[currentplayer].active := 'False';
NextPlayer(False); //same mistake as before, this should be in the mainloop, and false, not true
end;
end;

procedure BankWillows;
begin;
if not loggedin then exit;
disguise('Starting banking procedure')
if(invFull) then
begin;
ToBank;
Disguise('Opening bank and banking.')
OpenBankQuiet('db');
DepositAll;
MakeCompass('E');
Players[currentplayer].Integers[1] := Players[currentplayer].Integers[1] + 1;
if(Players[currentplayer].Integers[1] >= Players[currentplayer].Integers[2]) then
begin;
Proggy; // this should not be false,
Players[currentplayer].Active := False; // it should be true, because that way,
nextplayer(true); //when all the other players have done
//their loads, it can always come back to this
end; //one and keep on going forever

end;
end;

//mainloop
begin
SetupSRL;
MouseSpeed:=10; // SetupSRL already sets the mousespeed
DeclarePlayers;
wait(1000 + random(50)); // why wait here?
ActivateClient;
if not LoggedIn then LoginPlayer;
repeat
MakeCompass('E');
ToWillow;
FindRandoms;
repeat
if findcolor(x,y,WillowcolorA,0,0,1400,1400) or
findcolor(x,y,willowcolorB,0,0,1400,1400) or
findcolor(x,y,willowcolorC,0,0,1400,1400) then
begin;
MMouse(x,y,1,1);
FindEnt(x,y,true)
end;
Chop;
FindRandoms;
until(invFull)
FindRandoms;
BankWillows;
until(AllPlayersInactive(1))
end.

{your FindRandoms should also be inside the chopping procedure,
because while you're chopping is when it's most likely to get a random
~RMagician
}

~RMagician

Johan92

2007-10-14 09:16:39

w000t

w00000toöoot

Sorry for quadraple posting! omg exuce meeee

Hejhejs

lollollololllollollollollollollolllolllololollollollollollollollollollollollollolllollolollollollollollollollollolllollolloloollolllolllolllloolllllllolllollllloollloolllolll

LOEEDDDEEEAAADLLOOOOOAAEEEADDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLLLLLLLLLLLLLLOOOOOOOOOOOOOOOOLLLLLLSALLASFMKFMFMFLJWYQYopadgklöa<dgnadhdfjerjajklöaöjklgfquisnmdylllllllllllllllllllllllllllllllllquipqweuphjasdfhjm,sdfghklhmndfjkjkaasgjösdnmjiiweopsdfnkladkjlkljadfjkläagkjkafjgkdyyyydydjdtydydhdhdhdadfjköhöashöasdfödföasdfasdöfadhsdf

qwertyuiopadfjjklööä<cvn,ahsdf

W0000t

Harry

2007-10-14 09:28:42

Dude, you are gonna be banned after these spam posts :)

Rikje

2007-10-14 10:14:35

What the hack is he think hes doing?
but indeed HY ban him?:)

Dumpin

2007-10-14 16:14:18

From: owned1112
I didn't want leechers to view this >_>.
But anyway, fix the problem yourself. If you have ANY common sense, you would probably look at procedure ToBank;. Try adding:

MakeCompass('N');
In the beginning of the procedure.


dude, they runned the script for you, and posted what happend and you just say: "I didn't want leechers to view this >_>.
But anyway, fix the problem yourself."

isn't it your script? shouldn't you fix your own script? are you to lazy? it will be good experience if you repair it yourself to, don't blame others..

not bad first script, but please use enters and standards I can barely read it

irishpir8

2007-10-14 16:59:19

it was ok, but it kept on going too far south

Viper8 3

2007-10-14 19:55:30

Yeah, worked fine until I had full load… :/

Geebly

2007-10-22 01:32:35

Too many people stop posting at 10.

Olsm

2007-10-26 11:55:37

sdf

discobibble

2007-10-26 14:53:59

i cant get them to work im new at this though i installed slr but i still get
Line 3: [Error] (3:9): Identifier expected in script

justin time

2007-10-26 23:26:53

I've had same problem with the full load thing. It just stops when it has a full load.

Vanessa

2007-10-27 13:29:11

Mine does 3 loads, then stops @ full load. I've tried changing the detail and brightness and such, but it does it every time.

fert

2007-10-27 14:29:53

great job

Desolater

2007-11-03 13:47:46

Fantastic very nice work

captaintosspot

2007-11-03 14:23:43

hey, its awsome but there are just a few pronlems with randoms. Every time a had a random, for exaple the sandwitch lady, i didnt seem to notice and i get teleported some where.;)

kingy101

2007-11-03 15:28:25

keep getting stuck on getting back to the bank with this script..

uncfan1119

2007-11-03 18:17:41

Looks cool, i'll post a proggy later.

Thanks

EVERSCREAMTODIE

2007-11-03 18:51:19

From: discobibble
i cant get them to work im new at this though i installed slr but i still get
Line 3: [Error] (3:9): Identifier expected in script


same prob here

mental osx

2007-11-04 05:58:23

while "chopping…" the mouse just get's stuck at the top of the screen

and something i think you can also improve is that i should stay with 1 tree when choping till that tree is gone. instead of constantly walking around allways chopping a different tree

wildman123

2007-11-04 06:17:13

works brilliantly, i had it running for 5 hours and got about 4K willows. i used them for firemaking using the autoarson script

flyingkid101

2007-11-04 09:17:13

Yeah i had the same problem that mental osx had

kossa

2007-11-10 09:04:55

good just stuffs up =(

ckpro

2007-11-10 09:55:55

Problem with full load…

qazwsx

2007-11-10 20:01:59

Haha Nice Script But Dont Work For Me

lanky_dude1

2007-11-10 20:39:50

Not Bad, better then my powerminer anywayz…… keep up the good work

rwj4real

2007-12-06 19:24:26

lol nice first script but
So sad.. my comp crashed…

mod cheater

2007-12-06 19:36:10

It is ok but….

U could use some more color picking and u should just go and rewrite the hole thing… this is my opinion….:fiery: :garfield: :fiery:

Pierre14

2007-12-06 21:08:36

cool its not bad for your first script! suggestion fix the full invo problem everyone seems to have:)