SRL Archive - First Scripts

Yew Multi Fletch.


Mat

2011-12-16 17:29:28

Hey Guys.
This Script was Suggested by a person on the forums and because I wanted to learn more I thought might as well.
It uses the Tool Belt so it can withdraw 14 of each.
This is the Method that it uses.
Sorry For the Size…
It Cuts Logs then Strings them.
Instructions
    Make Sure you Have a Knife in your Bank on Show or in your Tool Belt as this bot checks your belt to see if you have or haven't got one and will add it if necessary.
    It withdraw 14 Yew Logs and 14 Bow Strings Cuts them and then strings them.
    Make sure your logs are Visible in the Bank or the Bot will stop.
    Fill in your Account information so smart can Log you in.
Things I want to add
    Paint of some sort.
    Support for other Logs.
    Random Human Movements. (Soon)
Update Log
    Realised. (16/12/11)
    V1.01 Modified Mouse speed and wait time. (17/12/11)

    V1.02 Added RandomFinder and a Form of AnitBan ***Buggy***(17/12/11)

    V1.03 Fixed Timing Problems. Kanah Helped me with the BitMap Leak Problem (Thanks Man)(17/12/11)



Thanks Ali
__________


dandog

2011-12-17 01:53:26

using it now. has been running for over an hour and working fine. well done

kanah

2011-12-17 04:35:48

Great first script; however, this script may get you banned. All scripts should include some sort of randomness refered to as AntiBan to simulate a person doing another random activity for a while. You may also consider adding random checks, the SRL include has functions for detecting/solving randoms that would help the longevity of the script (currently if a random occured during cutting your script would be stuck in the random and would not logout since you only call ShutDown inside the bank function after the bank screen is open). You may consider adding more comments to explain what your code is doing.

Also you have a memory leak in the Cutting procedure; you forgot to free the bitmap YewLongButton. This will cause simba to crash eventually.

Overall you did a great job. You avoided the trap that most first scripts fall into… "the infinite loop"

Mat

2011-12-17 05:02:35

Hey Kanah Thanks for the Advise and about the BitMap Problem.
I'm just working on getting a Anti-Ban to work and also getting it to ShutDown if it sees a Random event.
Thanks again <3
Ali



Updated V1.02
****RandomFinder****Form of Anti Ban****
Ali



Updated V1.03
-BitMap Leak Problem Sorted Thanks to Kanah.
-Better timing as it was missing the knife.
Ali

phamxboa

2011-12-17 15:14:53

does it work at soulwars?

Mat

2011-12-17 15:44:24

Yes if you want to use coordinates for the bank, as I don't think the clients Bank methods don't support it.
But its not that hard to get it to work all you have to do is make it set Compass Point
and Angle
This Should be it.
 MakeCompass('S');
SetAngle(True);
MMouse(250, 200, 12, 12);
GetMousePos(X, Y);
Mouse(x, y, 0, 0, True);
wait(500);
That's how I got it to bank there when I first started scripting
Put that
where this is:
OpenBank('vwb', True, True);
Ali

kanah

2011-12-17 21:58:08

You should add some sort of progress report that will print out, in the debug or paint on smart, how long the script has been running, what it is doing, and other things. That way people can easily post their results like:

** Fletcher **
Loads done: 3/10
Time running: 0:12:50
Current Action: Stringing



Here's an example from one of my scripts:

procedure ProgressReport(Action: Integer);
//This prints out the current activity and time running
var
Clock: TIntegerArray;
ActionText: TStringArray;
x,y, TextSpacing, color: integer;
Font: String;
RandomFact: string;
begin
ActionText := ['Lost','Walk to Mine','Mine Clay', 'Walk to well',
'Soften clay', 'Walk to craft', 'Craft Pots', 'Walk to bank',
'Deposit pots', 'Recover', 'Taking Break','Dropping Everything','Walk to mine'];

SRLRandomsReport;
Stats_Commit;

Clock := [0,0,0];
ConvertTime(GetTimeRunning,Clock[0],Clock[1],Clock[2]);
writeln('=========== THE Pot Maker =============');
Writeln('Time Running ' +tostr(Clock[0])+':'+tostr(Clock[1])+':'+tostr(Clock[2]));
writeln('Current action: '+ActionText[Action]);

if (Players[CurrentPlayer].Booleans[1]) then
begin
writeln('Level Goal: '+tostr(Players[CurrentPlayer].Integers[3])+' / '+tostr(Players[CurrentPlayer].Integers[4]));
end else
writeln('Trips completed: '+tostr(Players[CurrentPlayer].Banked)+' / '+tostr(Players[CurrentPlayer].Integers[0]));
writeln('Mining xp: '+tostr(Players[CurrentPlayer].Integers[1]));
writeln('Crafting xp: '+tostr(Players[CurrentPlayer].Integers[2]));
writeln('=======================================');

TextSpacing := 20;
x := (MSX1+MSX2)/2;//MIX1;
y := 5;//MIY1;
color := 592381;
Font := 'UpChars';


//Here it draws on the screen
ClearRSCanvas(SMART_Canvas.canvas);

Smart_DrawText(x,y,Font,'=========== THE POTMAKER =======',color);
IncEx(y,TextSpacing);
Smart_DrawText(x,y,Font,'Time Running ' +tostr(Clock[0])+':'+tostr(Clock[1])+':'+tostr(Clock[2]),color);
IncEx(y,TextSpacing);
Smart_DrawText(x,y,Font,'Current Action: '+ActionText[Action],color);
IncEx(y,TextSpacing);

if (Players[CurrentPlayer].Booleans[1]) then
begin
Smart_DrawText(x,y,Font,'Level Goal: '+tostr(Players[CurrentPlayer].Integers[3])+' / '+tostr(Players[CurrentPlayer].Integers[4]),color);
end else
Smart_DrawText(x,y,Font,'Trips completed: '+tostr(Players[CurrentPlayer].Banked)+' / '+tostr(Players[CurrentPlayer].Integers[0]),color);
IncEx(y,TextSpacing);
Smart_DrawText(x,y,Font,'Mining XP: '+tostr(Players[CurrentPlayer].Integers[1]),color);
IncEx(y,TextSpacing);
Smart_DrawText(x,y,Font,'Crafting XP: '+tostr(Players[CurrentPlayer].Integers[2]),color);
IncEx(y,TextSpacing);
end;

BuckWild

2011-12-18 20:06:23

I'm glad you went through with this.
Great job!

Omar

2011-12-19 10:00:06

You should add support for other types of logs eg (willow) Since they are MUCH cheaper. Other than that it's a Great script! Thanks.

Mat

2011-12-19 10:37:24

From: BuckWild
I'm glad you went through with this.
Great job!

Thanks Man:)
From: badreddine
You should add support for other types of logs eg (willow) Since they are MUCH cheaper. Other than that it's a Great script! Thanks.

I Could but I need to figure out how to make it change depending on what you enter in.
But I can give it ago.
Got exams this weeks so I won't be updating till the 23 as that's when I finish for the Christmas Break.
So Keep your eyes Open on this thread :).
Thank

Ali
__________


Omar

2011-12-19 12:00:48

I will Keep my eye's Open I really need a fletcher. Anyways i was wondering if you had an AIM or MSN, if you do Please pm me with it I have some questions. Thanks :D

Mat

2011-12-22 16:41:57

I'm Back and re Coding the Whole thing.
Allow the User to choose which Log they want to choose, and whether its a Long or Short Bow.
I'll Keep a Update Log.
UpdateLog
    Added All the Vars Needed.
    Working Matcher.
    ***Getting BitMaps*** 1-2Hours(Unless I go Bed Haha)
      Got all the Images Time To Convert
      All Converted and Tested
    Now Adding Withdrawing items etc, and freeing BitMaps as my last Script had Problems with this.
    Script now works! WOOOOOOT time to add random finder and some anti ban.
Ali
__________


l0ve2b0t

2012-01-23 14:19:07

keep having Exception in Script: Unable to find file 'SRL/SRL.scar' used from ''
what is this and what can i do about it ?

Mat

2012-01-26 11:09:59

Wow long time since anyone used it:P
Erm that's to do with at the top of the script:

program YewMultiFletch;
{$define SMART}
{.include SRL/SRL.scar}
Change it to:

program YewMultiFletch;
{$define SMART}
{.include SRL/SRL.Simba}

trials6112

2012-01-26 11:12:01

just a question does this support SW bank?

Mat

2012-01-26 11:29:05

No but I think you can change where it opens the bank to

OpenBankChest(SRL_BANK_SW);