SRL Archive - Help and Support

Help With WoodCutter Walking Procedure, Bitmaps and more.. Plz Help


da_professa

2006-11-25 00:27:20

Hey,
Lately I have been working on my normal log cutter + Banker. I have a few questions, I 'll make it as easy for u guyz to read and answer as possible.

About Script

This script starts off at varrock west bank. Lowest bank slot.. It will first make map perfect north, then just walk a little bit thorough some random set points, since there are normal trees everywhere. It is supposed to cut logs and bank em

Problem 1

I need a better way of walking to the trees. Is there a better way that u guyz can think of. Yesterday I saw that if u go all the way south there is water.. Should i just make it keep going south east until it gets the water..

Problem 2

I do not really understand how to use the tree bitmaps to find the tree color.. Like I posted in previous topic (juniors), the script seem to find the bitmap in paint, but not in runescape. Most scripts that I have checked, I notice that they use deformed bitmap. I don't understand diformed bitmaps. It would be GREAT help if you could just help me with that.

Problem 3

I want to make a procedure in which while waiting it checks for Ent, and if good randoms. Is it possible to do it..

Problem 4

Multi Players.. HOw do I say if this happens then go to next player, and don't use this player again.. Or in other cases if total loads reached then next player and do come back to this player….

Other Ideas

I want this to be the best script I make. It will be in the free section, and I want it to be an overnight script.. I know there are many things in there that are not fail proof, I will work on them as soon as I have all my procedures up and running. Plz post any ideas and help that you may have for me.. If its a link to a tutorial, or if its complete criticism, I'll like.. I just don't want 20 views and 0 replies..

Thx a lot guyz!!

Almost Forgot to post script.. Here it is (don't laugh ;))
{Normal Log Cutter than banks}

// Note To self.. USe Broken Axe thing.. ALSO BANKING AFTER INV FULL>> LOG DTM........ Ask About waiting while checking for ent..
program normalcuts;

{.include SRL/SRL.scar}
{.include SRL/srl/extended/xmapwalk.scar}
{.include SRL/srl/skill/woodcutting.scar}


// SET THESE UP!!//
const
Treecolor1 = 4345174; // Don't Really Need To Touch It.. Also Uses Other Method To Find Tree :D
Treecolor2 = 2908240; // Don't Really Need To Touch It.. Also Uses Other Method To Find Tree :D
Treecolor3 = 4020312; // Don't Really Need To Touch It.. Also Uses Other Method To Find Tree :D
//Waittoclick = ; Will be added In next version
rundirection = 'S';
Tolerancetree = 5;
StartPlayer = 0;
SkillUp = 'Strength';//For Genie
TotalLoads =10; // Number of Loads to do before switching players
// -----------------------------//

var logdtm, treebmp, Tree1, PlayersAmount, BrokenAxeMask, treecolor12, banked : integer;
var AxeThere : Boolean;

//Setup Players//
Procedure DeclarePlayers;
begin
PlayersAmount := 1;//Number Of Players you will be playing with
NumberOfPlayers(PlayersAmount);
CurrentPlayer:= StartPlayer;

Players[0].Name :='--username here--';
Players[0].Pass :='*Woah! that was close*';
Players[0].Nick :='\ ';
Players[0].Active:=True;
end;

Procedure Setup;
begin;
SetupSRL;
ActivateClient;
DeclarePlayers;
if(not(LoggedIn))then
LoginPlayer;
PerfectNorth;
LoginPlayer;
logdtm := DTMFromString('78DA63DCC5CCC050C7C8800CD2FDF518E6B73' +
'1328044FF0301E336A09A5254350C0C8C482490DE0F54534440CD' +
'21A09A0A026A8E01D534A3AA315050C0B4AB9D809A8D40359DA86' +
'A4A836550D5AC04AA6944551365278CA20600D6BD126A');
BrokenAxeMask := BitmapFromString(9, 10, 'z78DA7373230D1890' +
'05C8D34BAA2EE2D5E3F21131FEC56FCBE091A53C34007F307225'); // I stole this from some script.. I'll post credit in final version
Tree1 := BitmapFromString(4, 1, '38382C50602C38402C40' +
'4826');

end;

Procedure randoms;
begin
SRLrandomsreport;
FindNormalRandoms;
FindLamp(SkillUp);
FindTalk;
if(findfight) then begin
Writeln('Found Fight Running Away');
RunAwayDirection(rundirection);
SleepAndMoveMouse(7000+Random(2000));
Writeln('Should Be Gone Now!');
RunBack;
end;
RandomRClickEvery(5+Random(3000));
BoredEvery(10+Random(200));
FindBirdsNest;
if(not(FindHead)) then writeln('Hmm No Axe.. Lets Look For one');
end;

procedure allgood;
begin;
if(FindAxeHeadColor) then Axethere := true;
if(not(FindAxeHeadColor)) then begin
WriteLn('Can Not Find Axe Head Color');
WriteLn('Logging Out');
AxeThere:=False;
FTWait(12);
LogOut;
NextPlayer(false);
end;
end;

procedure banking;
var x,y : integer;
begin;
if (not(invfull)) then exit;
OpenBankQuiet('veb');
FindInvDtm(x,y,logdtm);
Mouse(x,y,2,2,false);
ChooseOption(x,y,'All');
banked := banked+1
end;

procedure totrees;
begin;
allgood;
mouse(590,112,0,0,true);
CountFlag(0);
Mouse(631,136,1,1,true);
CountFlag(1);
Mouse(631,120,1,1,true);
CountFlag(0)
end;

Procedure Ent;
Begin
if (FindEnt(treecolor1)) or (FindEnt(treecolor2)) or(FindEnt(treecolor3)) or (FindEnt(treecolor12)) then begin
EntsAvoided:=EntsAvoided + 1;
WriteLn('Ent Found!! ');
Mouse(648, 83, 1, 1, True);
FTWait(20+Random(10));
End
End;


procedure cuttinthewood;
var x,y,xx,yy,attemp : Integer;
Begin
attemp := 0
repeat;
attemp := attemp+1
randoms;
if(not(FindHead)) then exit;
WriteLn('Head Found 1');
WriteLn('Head Found2');
if(InvFull) then exit;
WriteLn('Head Found3');
if (not(loggedin)) then exit;
WriteLn('Head Found4');
//if (TotalLoads > Banked) then exit;
WriteLn('Head Found5');
if(FindMainColor(x,y,treecolor1,tolerancetree,true)) or (FindMainColor(x,y,treecolor2,tolerancetree,true)) or (FindMainColor(x,y,treecolor3,tolerancetree,true)) or (FindMainColor(x,y,treecolor12,tolerancetree,true)) then begin
MMouse(x,y,2,2);
if(IsUpTextMulti('Chop','down','Tree')) then
begin;
Mouse(x,y,1,1,true);
Ent;
Writeln('done 1');
FTWait(2+random(2));
Writeln('done 1');
Ent;
//Writeln('done 2');
//FTWait(4+random(2));
//Ent;
//Writeln('done 3');
//FTWait(4+random(2));
//Ent;
//Writeln('done 4');
//FTWait(4+random(2));
//Ent;
//Writeln('done 5');
//FTWait(4+random(2));
//Ent;
//FTWait(4+random(2));
//Ent;
//FTWait(4+random(2));
// Ent;
end;
end;
until(attemp = 7);
WriteLn('No Tree Found With The Colour');
WriteLn('Trying To Find New Colour');
repeat;
attemp := attemp+1;
if(FindBitMaP(tree1,xx,yy)) then
MMouse(xx,yy,1,1);
if(isuptextmulti('Chop','down','Tree')) then begin
treecolor12 := GetColor(xx,yy);
end;
WriteLn('Your Lucky! Found the tree');
FreeBitmap(tree1);
exit;
until(attemp = 4);
WriteLn('Hmm... Still Have not found tree');
WriteLn('Hold On Things Might Get A Bit LAGGy');
repeat;
treebmp := BitmapFromString(7, 7, '48483628300C30302038381A38' +
'401E68702E50583A5868322830003838244850325860185058273' +
'8402428302048582428300048502658603348502E486007586832' +
'58682228301A48501650602748501650603078882030401B28300' +
'A48502658603348501A50603038482268783418180820281C4040' +
'2F70784D30381E70803F60703258603070784D60684448582C586' +
'81A');
attemp := attemp+1
if(FindBitMaP(treebmp,xx,yy)) then begin
MMouse(xx,yy,1,1);
if(isuptextmulti('Chop','down','Tree')) then begin
treecolor12 := GetColor(xx,yy);
WriteLn('Your Lucky! Found the tree');
FreeBitmap(treebmp);
exit;
end;
end;
until(attemp = 4);
WriteLn('I think we are lost');
WriteLn('Logging Out! Hopefully you got another player');
Logout;
NextPlayer(false);
end;

procedure LoadsDone;
begin;
if (TotalLoads > Banked) then begin;
WriteLn('Max Loads Done');
WriteLn('Switching Players');
FTWAIT(50 + random (10));
LogOut;
NextPlayer(true);
end;
end;

begin
Setup;
totrees;
repeat;
cuttinthewood;
//add to walk back
banking;

until(false);
end.

Boreas

2006-11-25 00:40:19

Varrock east bank has no lowest bank slot, only west and east, do you mean west bank?


1) I suggest you pick an area to cut, and know it like and the route to it like the back of your hand. Then find a unique path.

3)Not sure what mean, please explain more.

4) See nextplayer in login.scar

da_professa

2006-11-25 00:52:51

Sorry.. I meant west bank.. The problem with point 1 is that there are trees everywhere, so it scatters off.. goes to different places…

for 3 .. I mean when its waiting, its checking for ent and randoms at the same time.. How FTWait waits and checks for ur name being called, I wan't something like that.. I hope i explained good

One more thing.. about login .scar I am reading it right now .. Next player has no description, if u could just explain this small point.. I want to say this player should not return.. How do I do it.. & I want to say this player will return, then how do I do it.. Thx a lot for ur quick reply

da_professa

2006-11-26 06:58:25

Plz help me.. I am really looking forword to finishing this script.. I have just finished a huge school project (37 Pages Long), and am wanting to finish a good script in my free time.. Plz help me if u can guyz I'd really appreciate it… If you wan't to add me on msn to help me out here's my msn "mhs_pb@hotmail.com". Thx, and I am sorry for being a real pain, its just that I wan't to finish this script soooooooooooooooooo baddd.. And then the feeling after finishing a big project, you just want to chill and do somethin u like..

thx guyz

Akriam

2006-11-26 16:22:53

Well, for problem 2 you could just use the findcolor(x,y,) function. And for the better way of finding trees do like Boreas said and make it cut in a certain place and just have it click on roads or set other "pathways" for it to follow.

da_professa

2006-11-26 23:55:18

I can't use findcolor(x,y) cuz it doesn't seem to find the bitmap.

Junior

2006-11-27 17:30:31

Hmm ill try to help you out.

Problem 1: I cant really help you out on this one. When chopping trees your constantly moving, and walking to the bank by cords will just bring you in the whole opposite direction. Suggestion: When your inventory is full, walk back to a unique spot (the same spot when your inven is full), and make it walk to the bank from there. Or else if you start walking to the bank from anywhere you most likely wont make it.

Problem 2: I wouldnt use FindDeformed because it takes too long, but it could work just fine. In all my woodcutters I always used

Repeat

If(findColorSpiralTolerance(x,y,color1,MSX1,MSY1,MSX2,MSY2,25))or

If(findColorSpiralTolerance(x,y,color2,MSX1,MSY1,MSX2,MSY2,25))or

If(findColorSpiralTolerance(x,y,color3,MSX1,MSY1,MSX2,MSY2,25))or

If(findColorSpiralTolerance(x,y,color4,MSX1,MSY1,MSX2,MSY2,25))Then

MMouse(x,y,3,3)

Until(IsUpTextMulti('ree','hop','wn tr'); // thats not right, just to let you know

If(IsUpTextMulti('ree','hop','wn tr')Then

//blah blah you know the rest.

For the colors pick 4 different, but popular/most common tree colors. If you dont like that idea just use a FindObj(); procedure.

If you want to learn more about FindDeformedObject and FindBitmapToleranceIn, go to this post.
MoparIsTheBest : http://www.moparisthebest.com/smf/index.php/topic,39678.0.html

Problem 3: I know what you mean… and I always wondered how to do this.

Problem 4: For multi players check these posts, there very informative I think.
MoparIsTheBest : http://www.moparisthebest.com/smf/index.php/topic,41003.0.html
Villu : http://www.villu-reborn.com/showthread.php?t=4471


Ok thats all the help I can give now.
Any questions ask.
~jR

da_professa

2006-11-28 14:35:20

^ thx a lot.. I have never been able to make my characters walk properly.. I mean I know abt not using exact cordinates cuz they change , but i usually have trouble finding road color, and therefore can't get radialroadwalk to work..
btw I found some crrrrrrrrrraaaaaaaaaaaaazzzzzzzzzzzzzyyyyyyyyyyyyyyy (as in good) ways of finding if u cut the tree or not (without using staff :P)…. Can't wait to release this script.. Man it's pretty cool.. It's like the first thing that I have done that works so damn fine

Junior

2006-11-28 16:37:21

If your having trouble finding road color for RRW to work, use Tarajunky's procedure. It finds the road color in less the .5 seconds! Its awesome. Or look into SRL, and theres a procedure called 'FindFaladorRoadColor'. Change the bitmap of the Fally road located in the procedure, to the road where you are located at. Make 2 or 3 bitmaps of the road, place them into that procedure, and that will work just as fine.

And yes I knew what you were talkin about when you said crrraaaazyyyyyyyy, im more then just your average white boy you know… but I want to see what you came up with when you release this script. Good luck!
~jR

Edit: Just remember to make the bitmaps of the road in different worlds because the road color changes drastically every time… thats if your using that procedure I was telling you about.

da_professa

2006-11-29 14:46:17

I can't get dtms to work properly.. I think i'll finish script off and just realease it as a power chooper until I find propper walking ways.. Right now I am just making the script fail safe (because I just learned the nextplayer thing, thx to you)..
Thx