SRL Archive - First Scripts

Seer Yew Woodcutter


jatex

2012-01-17 22:07:07

This is the first time I've ever attempted writing a script.. So warning, there are bugs. No where near as buggy as it was before, please post any bugs.

What it does:
Cuts Yew trees in Seer's Village, banks, and repeats.

Things that need to be done:
–Script currently just runs to the western yew trees, when they are not there the script does not have anything to chop down and in turn just waits for the trees to respawn. I'm not 100% positive how to implement walking to separate trees when they're gone, and will look into it tomorrow.
–Bank Pin Support
–Failsafes – Failsafed chopping trees, walking + banking needs it.

Known Problem(s):
Clicks the tree more then one time when trying to cut it down.
Only chops western trees.


Current Version: 1.0
Update Log:
1/17/11: Script Released
1/18/11: Fixed walking to and from bank.
1/19/11: Walking completely redone with ObjectDTMs
1/23/11: Fix'd the script, no longer in beta. Version 1.0 released.

In order to use the script, please download: ObjDTMs
program Seers_Yews;
{$DEFINE SMART}
{$DEFINE PAINT}
{$i srl/srl/misc/smart.simba}
{$i SRL/srl.simba}
{$i SRL\SRL\Misc\PaintSmart.simba}
{$i ObjectDTM\ObjDTMInclude.simba}

{var
x,y: Integer;
Walk,WalkYew,Walk2,Walk3:Array[0..120] of Integer;
aFound:Extended;}
//const
// Bank_CT = 'clt'
var
AngleHigh: integer;

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := ''; //Username
Pass := ''; //Password
Pin := ''; //Pin
BoxRewards := ['XP','xp','lamp']; //Reward
LampSkill := 'Woodcutting'; //What to use Gene Lamp on
Active := True;
end;
end;

procedure Antiban;
begin
if(not(LoggedIn))then
Exit;
case Random(500) of
0:
begin
HoverSkill('Woodcutting', false);
wait(1000+Random(200));
end;
10: PickUpMouse;
20: BoredHuman;
30: RandomMovement;
40:
begin
MakeCompass('S');
wait(125+random(100));
MakeCompass('N');
wait(75+random(100));
MakeCompass('N');
FindNormalRandoms;
end;
50: MakeCompass('Random');
end;
end;
//procedure WalkToNewTree;

procedure ChopTree;
var x,y,colorz: integer;
begin
if(InvFull) then
Exit;
repeat
FindNormalRandoms;
AntiBan;
MakeCompass('N');
SetAngle(AngleHigh);
if FindObjCustom(x,y,['ew','hop','own'],[2182722,5474683,1654580],5) then
begin
Writeln('Found Yew Tree chopping now..');
Wait(550+random(500));
Mouse(x,y,4,4,true);
ChooseOption('hop');
repeat
wait(250+random(250));
until not IsUpTextMultiCustom(['hop','ew']) or (InvCount=28);
end else Writeln('Cannot find Yew Tree.. Walking to new tree..');
begin
ObjDTM_Walk('117:83:5:1:7:74:67:0:7:116:52:1:7:123:119:1:7:53:128:1:7:74:87',0,100,80,true);
Wait(500+random(275));
end;
if FindObjCustom(x,y,['ew','hop','own'],[2182722,5474683,1654580],5) then
begin
Writeln('Found Yew Tree chopping now..');
Wait(550+random(500));
Mouse(x,y,4,4,true);
ChooseOption('hop');
repeat
wait(250+random(250));
until not IsUpTextMultiCustom(['hop','ew']) or (InvCount=28);
end else Writeln('Cannot find Yew Tree.. Walking to new tree..');
begin
ObjDTM_Walk('38:77:4:1:7:36:62:1:7:116:62:1:7:121:126:5:7:38:118',0,100,80,true);
end;
begin
if IsUpTextMultiCustom(['ead,ak,agic,aple']) then
ObjDTM_Walk('128:133:5:1:7:55:66:1:7:102:56:0:7:98:80:1:7:120:119:1:7:28:113',0,100,80,true);
end;
Antiban;
until(InvFull);
end;

procedure WalkToYew; //Thanks for the help in IRC (Euphemism, [J]ustin)
begin
if(InvEmpty) then
Writeln('Inventory is empty, walking to Yews.');
begin
if ObjDTM_WalkPath(['73:113:4:10:7:66:70:0:7:83:87:8:7:90:120:5:7:30:100','64:139:5:5:7:40:67:0:7:95:56:1:7:126:71:1:7:82:127:8:7:65:114','57:119:5:0:7:47:88:8:7:69:62:0:7:134:83:1:7:98:126:3:7:29:103', '36:81:5:0:7:71:52:8:7:97:66:1:7:78:118:5:7:33:119:1:7:30:68'],0,100,80,false,true) then
Writeln('Arriving at Yews.');
begin
wait(250 + random(250));
MakeCompass('n');
end;
end;
end;

procedure WalkToBank;
begin
if(InvFull) then
Writeln('Inventory is full, walking to bank..');
begin
if ObjDTM_WalkPath(['97:61:6:1:7:37:63:0:7:79:47:8:7:106:61:1:7:87:115:5:7:61:115:3:7:39:96', '106:28:4:1:7:104:100:1:7:23:88:0:7:66:51:1:7:112:58', '84:36:4:1:7:82:95:0:7:44:108:1:7:58:55:1:7:110:58', '88:63:5:1:7:34:36:1:7:109:46:1:7:106:105:1:7:55:103:5:7:41:75'],0,100,80,false,true) then
Writeln('Arriving at Camelot bank.');
begin
wait(250+random(250));
Antiban;
MakeCompass('N');
end;
end
end;

{ procedure Bank
begin
if(Invfull)then
//begin
repeat
Writeln('Inventory full, banking.')
OpenBank('clt',True,True)
Wait(250+random(100));
if PinScreen then
InPin(Players[CurrentPlayer].Pin);
Until(BankScreen);
//if(PinScreen)then InPin(Players[CurrentPlayer].Pin);
//if(bankscreen)then
//if BankScreen
Depositall;
CloseBank;
end;
//end;}

procedure Banking;
begin
if(InvFull) then
begin
SetAngle(AngleHigh);
repeat
WriteLn('Inventory full, banking.');
OpenBankNPC;
if(PinScreen)then
InPin(Players[CurrentPlayer].Pin );
if(BankScreen) then
DepositAll;
CloseBank;
until(InvEmpty);
end;
end;

begin
Smart_Server := 12;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
ActivateClient;
ObjDTM_Setup;
ClearDebug;
DeclarePlayers;
if not(LoggedIn) then
LogInPlayer;
repeat
WalkToYew;;
ChopTree;
WalkToBank;
Banking;
until(false);
//repeat
//NextPlayer(True);
//until(AllPlayersInactive);
end.

Flight

2012-01-17 22:26:39

Congratulations on your first script! How well does that walking work for you? If I might make a suggestion, ObjectDTMs might prove to be superior here.

Sebo

2012-01-18 14:09:05

This is a MUCH better script than my first script, I'll admit that! You're on a good track right now. Just a little challenge for you, try implementing multi-player support, or make the script available for free to play locations. I would be more than happy to test it for you, but unfortunately I do not have a member account to use. :(

Best of luck, maybe once this script is stable and fully functional, you could apply with it! Looks very promising. :)

jatex

2012-01-18 22:13:35

Thanks for the link Flight, once he finishes his guide on Walking+Paths I will be surely replacing my current methods with those.

Thanks Sebo :D
I will work on multi-player support once walking is perfected and I actually figure out how to chop effectively.. As well, I plan on adding the Yews by Draynor, or maybe GE.

Scaper

2012-01-18 22:13:55

Really good first script congrats, you seem like a good aqaintence to have to the SRL members if this is your first released script, I would like to see what you can do when you are fully aquainted, and upto scratch with the internals of the SRL include.

As Flight says take alook at better walking methods as that dont seem praticual and seems like the way we use to do it back in 2007 lol when i first styarted here everyone seemed to use walking like that.

jatex

2012-01-18 23:55:18

Fixed the walking and the script now waits when the two western trees are down..
Thanks Scaper :D

I'll look further into the walking.. Currently I'm only using DTM and it doesn't have any fail safes implemented (yet..)

jatex

2012-01-19 20:47:00

Updated it.. A LOT.

Thanks Flight for the Object DTM suggestion.

hader dem2

2012-01-20 13:57:42

nice bot but need one thing and it will own do it skiller support so you can use other axe end bronze and beginner

jatex

2012-01-20 14:38:28

It can use any axe as long as it's weilded prior to the bot being started. Do you mean as the bot levels up, it switches axes?

jordaneddy

2012-01-20 14:56:49

This makes no sense? My character will start chopping at the tree and then it will just run away before it even starts. Then it repeats that same process and doesn't even chop one yew.

hader dem2

2012-01-22 08:24:42

but a lvl 3 can't weilded a dragon axe so it only for other with 60 at it good for not skillers

jatex

2012-01-22 23:09:53

From: jordaneddy
This makes no sense? My character will start chopping at the tree and then it will just run away before it even starts. Then it repeats that same process and doesn't even chop one yew.


Will fix it, was working on a different script.

I'll will post again when script is working.

Fix'd!

From: hader dem2
but a lvl 3 can't weilded a dragon axe so it only for other with 60 at it good for not skillers


If people want it, I'll try to add support.

jatex

2012-01-23 00:25:14

Update: Script is running great now.

Failsafes for walking need to be added and I will do that tomorrow.

TheGamer666

2012-01-25 21:29:45

I don't know how to add scripts, I'm sad! :(

Failedpure

2012-01-25 21:40:39

From: TheGamer666
I don't know how to add scripts, I'm sad! :(


You simply download the script at the bottom of the op and save it under simba/scripts(I believe).
Op: Nice 1st script going to try to learn a bit from it

chelmid

2012-01-27 13:38:39

I'm getting this Error:
C:\Simba\Includes\ObjectDTMUNClude.simba<447:11>: Du
plicate identifier 'SMART_CLEARCANVAS' at line 446.

Help plz!

jatex

2012-01-27 14:15:48

From: chelmid
I'm getting this Error:
C:\Simba\Includes\ObjectDTMUNClude.simba<447:11>: Du
plicate identifier 'SMART_CLEARCANVAS' at line 446.

Help plz!


You need to download ObjDTMs

This can be found here: http://villavu.com/forum/showthread.php?t=68112


Also, thanks FailedPure :P.

natcrafteer

2012-01-27 23:23:47

Error: Out Of Range at line 1768
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]

1768 -if (ObjDTM_Walk(Path, 0, 100, 10, GroundLevel) and (not Reset)) then

chelmid

2012-01-28 04:29:29

From: jatex
You need to download ObjDTMs

This can be found here: http://villavu.com/forum/showthread.php?t=68112


Also, thanks FailedPure :P.



I downloaded OBJ DTMs.same ERROR comes.

YILDIRIM

2012-02-05 05:33:09

Great Script i will post a proggie tomorrow ;)

exilednoob

2012-02-08 20:43:16

Doesn't work…

[Error] (30:36): Type mismatch at line 29
Compiling failed.

This is what is on line 29..
LampSkill := 'Woodcutting'; //What to use Gene Lamp on