SRL Archive - Outdated / Broken

[Fletching]Forever Fletch & String


Narcle

2009-01-17 21:31:11

Forever Fletch & String
by Narcle


  • Works at ANY bank booth
  • Fletch's any wood to Long bows, Short bows, Arrow Shafts or Crossbow Stock
  • String bows
  • Antiban - Sleep/Break options
  • TPA Item finding
  • Auto TPA Item updating

6-21-10: Updated.
-This works in Simba only now.


Top Proggie:
From: newbiezkid
| Forever Fletch & String 23h:41m:50s |
|**** - Cut: 23301 - Strung: 0 |

History:
Forever Fletch & String v1.0.scar (20.0 KB, 60 views)
Forever Fletch & String v1.1.scar (17.7 KB, 19 views)

Bobarkinator

2009-01-17 21:43:26

Man Narcle, no offense, but that is a crappy name XD

Narcle

2009-01-17 21:50:39

From: Bobarkinator
Man Narcle, no offense, but that is a crappy name XD


Ah bite me. :p

Edit:
well how many scripts of mine does this make? yeah so… EAT IT

Bobarkinator

2009-01-17 22:30:40

From: Narcle
Ah bite me. :p

Edit:
well how many scripts of mine does this make? yeah so… EAT IT


I'll develop a script, just for you :)

Scaper

2009-01-18 00:57:00

gahh you release now after i was needing one for ages nvm i have 99 fletch now but looks good man

Naike

2009-01-18 03:19:55

Narcle you pretty beast!, will you ever stop :o?

Rubix

2009-01-19 15:28:05

zomg finaly a godly fletcher :D thanks bud, will post proggy once done with 100+ hours of tarajunkys chicken pwnzor


| Forever Fletch & String 1h:25m:1s |
| *** - Cut: 1998 - Strung: 0 |

Nava2

2009-01-19 16:31:36

I guess I have to update mine..

Kave

2009-01-19 16:50:25

Ill be posting a proggy for you soooooon narcle.

Rubix

2009-01-19 17:35:42

| Forever Fletch & String 1h:25m:1s |
| *** - Cut: 1998 - Strung: 0 |

it ended up having 4 logs left that it didnt cut but other than that a++ :D
/me gives Narcle a waffle

expect lots of proggys, gonna finish up 99 fletching now, currently 92


edit : Just tried stringing them, it doesnt work :s it goes into bank, withdraws bows and strings, clicks them both in inventory, but then banks again :s

Kave

2009-01-19 19:14:10

| Forever Fletch & String 2h:2m:4s |
| Hai :D - Cut: 2916 - Strung: 0 |

Knocked network lead out will run over night and repost in morning

Narcle

2009-01-19 21:34:15

From: Rubix
| Forever Fletch & String 1h:25m:1s |
| *** - Cut: 1998 - Strung: 0 |

it ended up having 4 logs left that it didnt cut but other than that a++ :D
/me gives Narcle a waffle

expect lots of proggys, gonna finish up 99 fletching now, currently 92


edit : Just tried stringing them, it doesnt work :s it goes into bank, withdraws bows and strings, clicks them both in inventory, but then banks again :s


Ok, i'll have to test it, or see if someone can figure out why its not working. I tested it on mine… it strung them fine but maybe its a bow tpa.

Kave

2009-01-21 10:44:25

From: Narcle
Ok, i'll have to test it, or see if someone can figure out why its not working. I tested it on mine… it strung them fine but maybe its a bow tpa.


works fine for me also.

Forever Fletch & String 11h:9m:42s |
| kave - Cut: 15579 - Strung: 0 |
Ran out of Logs, kave is now inactive.

n3ss3s

2009-01-21 11:29:18

EAT IT


Have some more chicken, have some more pie, it doesn't matter if it's boiled or fried just EAT IT, EAT IT.

Can you remember how much did it take for you to get 70 fletch (if you have) ?

Rubix

2009-01-21 17:26:02

i need to find the stringing part (sorry i can't do it myself (to advanced scripting for me)) and i need to add a small wait after it clicks the bow (U) and string, because it lags just a tiny bit, so it doesn't find the string thingy in the chat box.

Orbital

2009-01-22 09:17:50

Fantastic script =]… I plan in getting 99 fletching with this… i'll try craft 50k willows in one go ;)

heres my first proggy…

| Forever Fletch & String 4h:1m:58s |
| **** - Cut: 4104 - Strung: 0 |

It would of gone for much longer but my brother wanted the computer…

Kave

2009-01-22 11:39:50

From: newbiezkid
Fantastic script =]… I plan in getting 99 fletching with this… i'll try craft 50k willows in one go ;)

heres my first proggy…

| Forever Fletch & String 4h:1m:58s |
| **** - Cut: 4104 - Strung: 0 |

It would of gone for much longer but my brother wanted the computer…


haha im 91 fletching atm :p im going for 91-99 with this maybe you can add how many people achieve 99 narcle?

Narcle

2009-01-22 20:30:35

From: Kave
haha im 91 fletching atm :p im going for 91-99 with this maybe you can add how many people achieve 99 narcle?


Yeah I will soon as it happens. And I'll add top proggie.

Bobarkinator

2009-01-22 22:56:15

From: n3ss3s
Have some more chicken, have some more pie, it doesn't matter if it's boiled or fried just EAT IT, EAT IT.

Can you remember how much did it take for you to get 70 fletch (if you have) ?


They make nice runescape calculators just for questions like these :)

Kave

2009-01-23 12:10:42

94 Fletching @ This moment

Narcle

2009-01-23 12:29:03

Nice Kave. btw is the stringer working ok for you? I haven't had time to test or update.

Orbital

2009-01-23 23:56:26

| Forever Fletch & String 23h:41m:50s |
|**** - Cut: 23301 - Strung: 0 |

Time for some yews, I'll test stringer now. I'm lvl 78 now, Really excited about getting my first skill to 99 (that is if I don't get banned =p). Thanks once again Narcle

Kave seems to fletching much faster than me :-(


Narcle

2009-01-24 02:33:01

From: newbiezkid
| Forever Fletch & String 23h:41m:50s |
|**** - Cut: 23301 - Strung: 0 |

Time for some yews, I'll test stringer now. I'm lvl 78 now, Really excited about getting my first skill to 99 (that is if I don't get banned =p). Thanks once again Narcle

Kave seems to fletching much faster than me :-(



Nice proggie. Yeah Kave probably has faster computer and net. I notice the difference on different computers. Its not the script that's slow its Runescape that slows u down.

Btw I'll put proggie up, 23 hours is top proggie atm. ;)

Narcle

2009-01-25 06:41:33

Update to 1.0 Beta.

I changed it so when it clicks on the knife/bow, it does a wait loop before it clicks the log/string. So people with faster computers it'll work fast even thought its setup for slow computers as well.

Keeping it "Beta" so it can be tested and confirmed, also to see if there is any other problems.

Magiic

2009-01-25 10:26:57

nice proggy ;) this ones got about 5k to do :P 320k off 99, used this since 98
| Forever Fletch & String 15h:20m:27s |
| sandos - Cut: 19062 - Strung: 0 |

44 second break.
NextPlayer(Active: True);

edit: at pc btw, and also, i love SpiralMouseOutward for the bank finding, good thought/

Orbital

2009-01-25 19:34:09

Testing BETA now… lvl 86 atm but only 8 days of membership left…

EDIT: yup it works perfectly except you left a "v" lying in the middle of line 124

Narcle

2009-01-25 19:45:10

From: newbiezkid
Testing BETA now… lvl 86 atm but only 8 days of membership left…

EDIT: yup it works perfectly except you left a "v" lying in the middle of line 124


Opps, i'll fix that on release hehe.

Magiic

2009-01-26 02:38:07

99 :) thanks ;p

Narcle

2009-01-26 02:42:59

From: SandoS
99 :) thanks ;p


What did you start at (with this script) so i can add it to first post?

Magiic

2009-01-26 11:57:50

around 97 so its 2mil exp

Kave

2009-01-28 12:06:47

Rs has been updated today and it wont login ;o im 4k maple's off 99 Gratz sandos

Bebe

2009-01-28 12:50:02

I've just gotten from 20-60 fetching in two days. Nice script. Now I have to buy logs and go for 99.

Narcle

2009-01-28 15:09:35

Released 1.0

If you had previous one then you don't need this one.
Removed that v in the middle of the script
Removed SMART - add it urself :p

Kave

2009-01-28 15:43:05



Picture says all :)

Also stringer doesnt seem to work for me atm

Nava2

2009-01-28 16:48:15

| Forever Fletch & String 4h:58m:15s |
| ********* - Cut: 6630 - Strung: 0 |

hbryan1991

2009-01-29 00:55:49

it cut 2k yew longs for me but wouldn't string them

Nava2

2009-01-29 09:02:38

You don't call take a sleep in the main loop. Just so you know!

Rubix

2009-02-02 19:38:50

| Forever Fletch & String 1h:13m:23s |
| Wizzup - Cut: 1674 - Strung: 0 |

stopped manualy cause dad had to use comp, and he wont let scar/smart run while he's paying bills, he thinks its a virus :(

kingarabian

2009-02-03 16:30:53

Ima be using this to get from 96-99. I hope it gets the job done well :).

Edit: The stringing is not working well. It does one load, then clicks the bowstring and sits there. Then it trys to open the bank, but it cant since the option says "use bowstring with bankbooth" and loops.

Rubix

2009-02-03 18:45:33

From: kingarabian
Ima be using this to get from 96-99. I hope it gets the job done well :).

Edit: The stringing is not working well. It does one load, then clicks the bowstring and sits there. Then it trys to open the bank, but it cant since the option says "use bowstring with bankbooth" and loops.

same problem here.

Narcle

2009-02-03 21:04:28

kk guys… i think i know where the problem is… I really can't test it though member is on another 10 day ban…

kingarabian

2009-02-04 04:56:57

From: Narcle
kk guys… i think i know where the problem is… I really can't test it though member is on another 10 day ban…


Wanna try on my account? Private message me if so.

FreakyMonkey

2009-02-05 00:10:37

| Forever Fletch & String 8h:5m:1s |
| YaRightThisIsMyUserName - Cut: 11151 - Strung: 0 |

| Forever Fletch & String 11h:47m:5s |
| YaRightThisIsMyUserName - Cut: 14391 - Strung: 0 |


Lol, Thanks so much dude. Think I might get to 99 at this rate :D

BTW: at times "GetAmount" function doesnt work and the script terminates.

Kave

2009-04-28 23:41:34

Like to let ya know narcle this script still runs smoooth :) just had to remove Ftwait lines

HyperSecret

2009-06-08 05:53:44

| Forever Fletch & String 0h:43m:23s |
| freakmare - Cut: 2614 - Strung: 0 |

Stopped myself. Added in some reflection stuff and removed FTWaits and FindTalks.

Narcle

2009-06-08 08:53:34

Still works with tweaks? wow. Did u use reflection for clicking bank i take it?

HyperSecret

2009-06-08 22:03:50

yes, it is what I used reflection for.

Dynamite

2009-06-09 00:08:38

mind posting hyper?
that is epic fast cutting!
I was making a fix for this with soul wars but it dot really need it, but I will try and make you a soul wars banking function narcle if you want.

T~M

Narcle

2009-06-09 01:00:27

Its just a spiral mouse right now. Not worried about it, if people want it faster they can just change the bank function themselves. If I ever get back to this I'll fix the stringing/banking to work/better.

HyperSecret

2009-06-14 21:58:03

| Forever Fletch & String 0h:22m:45s |
| freakmare - Cut: 783 - Strung: 0 |

This was on yews this morning, counting is off though. Last night I had 1300 willows and it said it cut 3300. I had about 680 yews :)

Narcle

2009-11-03 18:14:04

Updated.

Decided to take a look at this yesterday. Was pretty easy to update just had to change the TPA item searching to my own. Works good from my use of it. ;)

Widget

2009-11-06 10:55:57

[php][==========================================]
[ Nick | Active | Worked | Cut | Strung ]
[==========================================]
[ **** | False | 04:27:40 | 4455 | 0 ]
[==========================================][/php]
How'd you get a 23-hour one? :p

Narcle

2009-11-06 10:58:43

From: Widget
[php][==========================================]
[ Nick | Active | Worked | Cut | Strung ]
[==========================================]
[ **** | False | 04:27:40 | 4455 | 0 ]
[==========================================][/php]
How'd you get a 23-hour one? :p


He was haxing? It was before random update etc.

Thx for report Widget :D

Also I ran it other day and forgot it was on… think it was at 6 hours before I stopped it. lol

Narcle

2010-06-21 15:44:25

Updated, now uses my auto updating method to find/count items.

Awkwardsaw

2010-06-21 16:22:20

From: Narcle
Updated, now uses my auto updating method to find/count items.


well, i have ~15k bowstrings to use, i might give this a try later :)

Awkwardsaw

2010-06-21 22:47:05

[==========================================]
[ Nick | Active | Worked | Cut | Strung ]
[==========================================]
[ | True | 05:33:20 | 7990 | 0 ]
[==========================================]

ran out of stuff :)

also in banking, you should save the coordinants where the bank was last, like if the bank is to the right of the character, it will remember to search the right tile first before starting from the left(or w/e) every time :)

Narcle

2010-06-22 03:02:11

From: Awkwardsaw
[==========================================]
[ Nick | Active | Worked | Cut | Strung ]
[==========================================]
[ | True | 05:33:20 | 7990 | 0 ]
[==========================================]

ran out of stuff :)

also in banking, you should save the coordinants where the bank was last, like if the bank is to the right of the character, it will remember to search the right tile first before starting from the left(or w/e) every time :)


It suppose to do that already. However, if the uptext fails when it moves it the first time then it resets.

Awkwardsaw

2010-06-23 20:09:57

this script got me from 88-92 so far :)

[=========================================]
[ Nick | Active | Worked | Cut | Strung ]
[=========================================]
[ | True | 01:27:00 | 208 | 2018 ]
[=========================================]

also for the banking, it mouses over the correct tile but doesnt right click

BraK

2010-06-25 16:06:54

It works fine except that it sometimes doesn't finish fletching the inv.

[==========================================]
[ Nick | Active | Worked | Cut | Strung ]
[==========================================]
[ | True | 03:41:19 | 4685 | 0 ]
[==========================================]

Narcle

2010-06-26 14:51:02

From: Awkwardsaw
this script got me from 88-92 so far :)

[=========================================]
[ Nick | Active | Worked | Cut | Strung ]
[=========================================]
[ | True | 01:27:00 | 208 | 2018 ]
[=========================================]

also for the banking, it mouses over the correct tile but doesnt right click


Ah I think I know what it is, I'll have to add a array of possible names of the Bank Booth's uptext and increase the time a bit.

From: BraK
It works fine except that it sometimes doesn't finish fletching the inv.

[==========================================]
[ Nick | Active | Worked | Cut | Strung ]
[==========================================]
[ | True | 03:41:19 | 4685 | 0 ]
[==========================================]


Really? Hmm, worked fine for me for 2 hours is fletching willow longs. Only thing I can think of is its breaking out of the wait loop from the timer failsafe.

Hobbit

2011-01-04 23:09:09

To get it working again with update that adds the little button thing change the following on line 385 in the stringer procedure

until (GetSystemtime > T);

T := GetSystemTime + 15000;
repeat

To this…


until (GetSystemtime > T);

T := GetSystemTime + 15000;
button := DTMFromString('mwQAAAHic42RgYGhgZGBYBsQroHQzEEcCcTiUrgTiI0C8BYjPAfE7IH4Ppc9BxTcDMQMDE4O+AieDrjwHg4QID4OCOCeDjiw7g6OJEoO9oSyDqbogAzGAkQgMBwAq/A7r');
wait(1000 + random(100));
FindDTM(button,x,y,0,300,700,500);
Mouse(x,y,8,8,true);
repeat


Working great :)

WhoCares357

2011-01-16 16:00:49

I fixed the script a bit. 'Long' and 'String' modes work now. I also fixed a small bug in the banking procedure.

NOTE: I only tried this with the 'Long' and 'String' modes.

PS Awesome script. Already went through 2k+ 'Long' and 'String' actions. Good job.

Narcle

2011-01-17 18:24:39

From: WhoCares357
I fixed the script a bit. 'Long' and 'String' modes work now. I also fixed a small bug in the banking procedure.

NOTE: I only tried this with the 'Long' and 'String' modes.

PS Awesome script. Already went through 2k+ 'Long' and 'String' actions. Good job.


Ah nice. Usually I prefer if you just paste the code instead of attaching it as a remake file, but I don't mind as its in members.

Did it just need some tweaks or some major reworking?

WhoCares357

2011-01-18 17:31:34

From: Narcle
Ah nice. Usually I prefer if you just paste the code instead of attaching it as a remake file, but I don't mind as its in members.

Did it just need some tweaks or some major reworking?


Wasn't anything big. I just used a color check for the "Longbow" and "String" buttons. I also changed
if not FindBank or not FindPin then
to
if not FindBank and not FindPin then

Press Play

2011-12-30 22:02:43

Oh wow, I never knew you had one of these up Narcle! I probably wouldn't have released mine if I saw this ahah :P It's funny because I took a look at your Smelter to learn some new TPA for item stuff to make my fletcher lol. Hope you don't mind :)

smurg

2011-12-31 00:24:38

This script is/was currently broken, but I made my own revisions and have been using it myself instead of writing my own as I was going to do.

So it definitely great base to work with. Gained 60M+ Fletching xp with it so far np.

Narcle

2011-12-31 08:10:11

Ha, well at least its been used one way or another. XD

ps, I don't care if my scripts are reposted in SRL members, so if you want you can post the remake. I'll probably even add to first page with credits. :)

smurg

2012-01-01 02:24:19

List of things done to the script:

  • Added const SW to use soul wars bank
  • Changed break to 5 hours
  • Added my own Make Item Menu detection
  • Commented out the bank detecting amount (Have like 2M logs anyways and it wouldn't convert the letters right)
So if any changes are detrimental to your needs, then you can just change them around ;)


{==============================================================================]
[ [SRL] Forever Fletch & String by Narcle ]
[ ]
[ NAME : Forever Fletch & String ]
[ WRITER : Narcle ]
[ CATEGORY : Fletching ]
[ DESCRIPTION : Cuts Logs & strings bows ]
[ ]
[==============================================================================]
[ Instructions. ]
[==============================================================================]
[ ]
[ 1. Start next to any bank booth. ]
[ ]
[ 2. Bank Setup, 1st tab - top row: ]
[ [Logs] [String] [Unstrung bows] [4] [5] [6] [7] [8] [9] [10] ]
[ ]
[ 2.5 If cutting place knife in 1st inventory spot. ]
[ ]
[ 3. Setup players in 'DeclarePlayers' ]
[ ]
[ 4. Click play. ]
[==============================================================================}
{.include SRL/SRL/misc/smart.scar}
{.include srl/srl.scar}
{.include SRL/SRL/Misc/Reports.scar}
const
//Antiban
TakeBreaks = true;//Take breaks every 1-3 hours?

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := ''; //Character Name
Pass := ''; //Character Pass
Pin := ''; //Pin for bank
Active := True; //Use player in script?
strings[0] := 'Long';//Long, Short, Shafts, Stock, String
end;
end;

const
bank_Logs = 10;//Log spot in bank
bank_String = 8;//Strings spot in bank
bank_Unstrung = 9;//Unstrung bow spot in bank
SW = True;

type
TTPAItem = Record
OutLine, Width, Height, Color: Integer;
end;
TFS = record
Fletching, Stringing: boolean;
BankPoint: TPoint;
ToCut: string;
Log, BString, FBow, UBow: TTPAItem;
end;

var
LogTime, BreakTime: integer;
FS: array[0..99] of TFS;
ByeBye: Integer;

const
DebugOn = True;
C_OrangeMakeText = 2070783;
LOOP_WAIT = 100;

procedure Debug(s: string);
begin
if DebugOn then
Writeln(s)
else
Debugln(s);
end;

function MakeItemMenu(TimeOut: Integer): Boolean;
var
x, y, T: Integer;
begin
if not LoggedIn then Exit;
Result := FindColorSpiralTolerance(x, y, C_OrangeMakeText, MCX1, MCY1, MCX2, MCY2, 10);
if not Result then
begin
T := GetSystemTime;
repeat
if not LoggedIn then Exit;
Result := FindColorSpiralTolerance(x, y, C_OrangeMakeText, MCX1, MCY1, MCX2, MCY2, 10);
Wait(LOOP_WAIT);
if ((GetSystemTime - T) > TimeOut) then Exit;
until(Result)
end;
end;

function Loc(S: string): Boolean;
begin
Result := Lowercase(Players[CurrentPlayer].Loc) = LowerCase(S);
end;

procedure SetLoc(S: String);
begin
Players[CurrentPlayer].Loc := LowerCase(S);
end;

function MyGetAmount(ItemX, ItemY: Integer): Integer;
var
Col: TIntegerArray;
X, Y, i: Integer;
B: TBox;
TPA: TPointArray;
S: String;
begin
Result := 0;
If Not FindColor(X, Y, srl_outline_black, ItemX-30, ItemY-30, ItemX+30, ItemY+30)then
Exit;
Inc(Result);
Col := [65535, 16777215, 8453888];
For i := 0 to 2 do
If FindColors(TPA, Col[i], ItemX-22, ItemY-22, ItemX+22, ItemY+22)then
begin
B := GetTPABounds(TPA);
S := ExtractFromStr(GetTextAtExWrap(B.x1-1, B.y1-1, B.x2+1, B.y2+1, 0, 2, 4, Col[i], 0, 'StatChars'), numbers);
Result := StrToIntDef(GetNumbers(S), 1);
Case i of
1: Result := Result * 1000;
2: Result := Result * 1000000;
end;
Exit;
end;
end;

function TPAItem(cOutLine, cWidth, cHeight, cColor: Integer): TTPAItem;
begin
with Result do
begin
OutLine := cOutLine;
Width := cWidth;
Height := cHeight;
Color := cColor;
end;
end;

function FindTPAItem(Item: TTPAItem; B: TBox): Boolean;
var
TPA: TPointArray;
Bt: TBox;
x,y: integer;
begin
FindColorsTolerance(TPA, srl_outline_black, B.x1, B.y1, B.x2, B.y2, 0);
if Length(TPA) < 1 then
Exit;
Bt := GetTPABounds(TPA);
if (Length(TPA) = Item.OutLine) and (iAbs(Bt.x2-Bt.x1) = Item.Width) and (iAbs(Bt.y2-Bt.y1) = Item.Height) then
if Item.Color > -1 then
Result := FindColorTolerance(x, y, Item.Color, Bt.x1, Bt.y1, Bt.x2, Bt.y2, 9)
else
Result := True;
end;

Function UpdateItem(var Item: TTPAItem; InvN: integer): Boolean;
var
TPA: TPointArray;
T: TPoint;
B: TBox;
begin
if (Item.OutLine > 0) then
Exit;
Wait(300+random(200));
B := InvBox(InvN);
FindColorsTolerance(TPA, srl_outline_black, B.x1, B.y1, B.x2, B.y2, 0);
if Length(TPA) < 1 then
Exit;
B := GetTPABounds(TPA);
T := MiddleTPA(TPA);
Item := TPAItem(Length(TPA), iAbs(B.x2-B.x1), iAbs(B.y2-B.y1), GetColor(T.x, T.y));
Result := true;
Writeln('Item := TPAItem('+inttostr(Item.Outline) +', '+inttostr(Item.Width)+', '+inttostr(Item.Height)+', '+inttostr(Item.Color)+');');
end;

function iCount(Item: TTPAItem): Integer;
var
i: integer;
begin
for i := 1 to 28 do
if FindTPAItem(Item, InvBox(i)) then
Inc(Result);
end;

function FirstOccurance(Item: TTPAItem; OtherSlot: Integer; Norm: Boolean): Integer;
var
i: integer;
begin
GameTab(tab_Inv);
Result := -1;
if Norm then
begin
for i := OtherSlot to 28 do
if FindTPAItem(Item, InvBox(i)) then
begin
Result := i;
Exit;
end;
end else begin
i := OtherSlot;
repeat
if FindTPAItem(Item, InvBox(i)) then
begin
Result := i;
Exit;
end;
i := i - 1;
until (i <= 1)
end;
end;

function ItemSelected: integer;
var
i: integer;
Box: TBox;
TPA: TPointArray;
begin
for i := 1 to 28 do
begin
Box := InvBox(i);
FindColorsTolerance(TPA, 16777215, Box.x1, Box.y1, Box.x2, Box.y2, 0);
if Length(TPA) > 10 then
begin
Result := i;
Exit;
end;
end;
end;

Function SpiralMouseOutward(UpText, Option: String; Dist: Extended): TPoint;
var
angle, r: extended;
i, T_T: integer;
TPA: TPointArray;
B, P, M: TPoint;
begin
T_T := GetSystemTime + RandomRange(12500, 15500);
Result := Point(-1, -1);
B := Point(269, MSCY);

TPA := [Point(B.x-38, B.y), Point(B.x, B.y-32), Point(B.x+38, B.y), Point(B.x, B.y+39)];
for i := 0 to High(TPA) do
begin
MMouse(TPA[i].x-1, TPA[i].y-1, 2, 2);
if WaitUpText(UpText, 200) then
begin
GetMousePos(M.x, M.y);
Mouse(M.x, M.y, 0, 0, false);
if WaitOption(Option, 2000) then
begin
Result := Point(M.x, M.y);
Exit;
end;
end;
end;

angle := (5.283 + random(3));
repeat
angle := angle + 0.2618;
r := Dist * angle;

P := Point(Round(r * cos(angle)) + B.x, Round(r * sin(angle)) + B.y);

if PointInBox(P, IntToBox(MSX1, MSY1, MSX2, MSY2)) then
begin
MMouse(P.x, P.y, 2, 2);
if WaitUpText(UpText, 200) then
begin
GetMousePos(M.x, M.y);
Mouse(M.x, M.y, 0, 0, false);
if WaitOption(Option, 2000) then
begin
Result := Point(M.x, M.y);
Exit;
end;
end;
end else
Exit;
if(GetSystemTime > T_T)then
Exit;
until (Result.x > 0);
end;

procedure Report;
begin
if (GetTimeRunning < 60000) then
Exit;
SRLPlayerReport( ResultDebugBox, 0, False,
[True, False, False, False, False, False],
['Cut', 'Strung'],
[], [10, 11], [], []);
end;

Procedure ResetTimer(Time: string);
begin
Case LowerCase(Time) of
'logout': LogTime := GetSystemTime+RandomRange(19*60000, 31*60000);
'break': BreakTime := GetSystemTime+RandomRange(250*60000, 320*60000);
end;
end;

procedure SetupPlayer;
begin
SetAngle(true);
ResetTimer('logout');
end;

procedure LogoutSeq(reason:string);
var
T: integer;
begin
Writeln(reason);
CloseWindow;
Report;
if (reason = '') then
begin
Writeln('Nextplayer true.. WHAAAAT');
if (HowManyPlayers = 1) then
begin
FindNormalRandoms;
Logout;
T := GetSystemTime + RandomRange(5000, 90000);
Repeat
wait(1000);
until (GetSystemTime > T);
end;
NextPlayer(true);
end
else
begin
writeln(reason+', '+Players[CurrentPlayer].Name+' is now inactive.');
NextPlayer(false);
end;
TerminateScript;
SetupPlayer;
end;

procedure NoAction(Add: Boolean; Reason: String);
begin
if Add then
Writeln('Adding counter. ' + Reason)
else
Writeln('Reset counter');

if Add then
ByeBye := ByeBye + 1
else
ByeBye := 0;

if (ByeBye > 4) then
begin
Logout;
writeln('NoAction Terminate');
TerminateScript;
end;
end;

function TakeABreak: boolean;
var
H, M, S, BreakFor, T: integer;
begin
if ( GetSystemTime >= BreakTime ) then
begin
ExitToLobby;
result := true;
BreakFor := RandomRange((1/5) * 60000, 1 * 60000);
ConvertTime(BreakFor, H, M, S);
Report;
Writeln('Break for: '+inttostr(M)+ 'm:' +inttostr(S)+ 's');
ExitToLobby;
MarkTime(T);
Repeat
wait(1000);
until (BreakFor < TimeFromMark(T))
ResetTimer('Logout');
ResetTimer('Break');
LoginPlayer;
SetupPlayer;
end;
end;

Function Stringer: boolean;
var
StringSpot, UBowSpot, T: integer;
begin
With FS[CurrentPlayer] do
begin

if (iCount(UBow) = 0) or (iCount(BString) = 0) then
Exit;

Debug('Stringing...');
StringSpot := FirstOccurance(BString, 28, False);
if (Random(5) = 2) then
UBowSpot := FirstOccurance(UBow, 18, True)
else
UBowSpot := FirstOccurance(UBow, 1, True);

if (ItemSelected = 0) then
MouseItem(StringSpot, true);

repeat
if (ItemSelected = StringSpot) then
begin
MouseItem(UBowSpot, true);
Break;
end;
wait(50+random(100));
until (GetSystemtime > T);

if not MakeItemMenu(5000) then
begin
NoAction(True, 'No Make Menu; Stringing');
SetLoc('strunged');
Exit;
end;
NoAction(False, '');
Mouse(262, 423, RandomRange(-10, 10), RandomRange(-5, 5), True);
wait(random(300));
if (Random(100) < 90) then
SleepAndMoveMouse(500 + Random(3500));

T := GetSystemTime + 20000;
repeat
FindNormalRandoms;
if (Random(191) = 23) then
SleepAndMoveMouse(RandomRange(750, 4000));
Wait(200);
if ClickToContinue or (GetSystemTime > T) then
Exit;
until (iCount(UBow) = 0) and (InvCount < 15);

SetLoc('strunged');
Result := true;
UpdateItem(FBow, 2);

end;//With do End.
end;

Function Fletch: boolean;
var
LogSpot, KnifeSpot, T: integer;
begin
With FS[CurrentPlayer] do
begin

if (iCount(Log) = 0) then
Exit;
Debug('Fletching...');

KnifeSpot := 1;
if (Random(4) = 0) then
LogSpot := FirstOccurance(Log, 5, True)
else
LogSpot := FirstOccurance(Log, 1, True);

MouseItem(KnifeSpot, true);

T := GetSystemTime + 4000;
repeat
if (ItemSelected = KnifeSpot) then
begin
MouseItem(LogSpot, true);
Break;
end;
wait(50+random(100));
until (GetSystemtime > T);

if not MakeItemMenu(5000) then
begin
NoAction(True, 'No Make Menu; Fletching');
Exit;
end;
NoAction(False, '');
Mouse(262, 423, RandomRange(-10, 10), RandomRange(-5, 5), True);
wait(random(300));
if (Random(100) < 90) then
SleepAndMoveMouse(500 + Random(3500));

T := GetSystemTime + 90000;
repeat
Wait(200);
if (Random(175) = 63) then
SleepAndMoveMouse(RandomRange(750, 4000));
FindNormalRandoms;
if ClickToContinue then
Exit;
if (GetSystemTime > T) then
Exit;
until (iCount(Log) < 1);
SetLoc('fletched');
Result := true;
UpdateItem(UBow, 3);

end;//With do End.
end;

Function Bank: boolean;
var
TPA: TPointArray;
T, P, MidTPA: TPoint;
W, B, Timer, F, G, Z:integer;
begin
if SW then
begin
FindNormalRandoms;
Debug('Opening Soul Wars Bank...');
if not LoggedIn then LoginPlayer;

If (Not BankScreen) or (Not PinScreen) Then
begin
FindColorsTolerance(TPA, 13158609, 280, 150, 315, 195, 8);
if Length(TPA) > 1 then
begin
MidTPA := MiddleTPA(TPA);
MMouse(MidTPA.x, MidTPA.y, 2, 2);
if WaitUpText('hest', 500) then
begin
GetMousePos(F, G);
Mouse(F, G, 0, 0, False);
if WaitOption('hest', 2000) then
begin
FFlag(0);
Timer := GetSystemTime + 10000;
repeat
Wait(100+random(100));
If (GetsystemTime > Timer) Then
begin
SetLoc('at bank');
Exit;
end;
until (BankScreen or PinScreen);
end;
end;
end else begin
SetAngle(True);
//MakeCompass('W');
end;
end;

If (Not BankScreen) or (Not PinScreen) Then
begin
Z := GetSystemTime + 3500 + Random(1500);
repeat
if GetSystemTime > Z then Break;
until(BankScreen)
if Not BankScreen then
begin
FS[CurrentPlayer].BankPoint := SpiralMouseOutward('hest', 'hest', 3.5)
FFlag(0);
end;
end;
end else begin
FindNormalRandoms;
Debug('Opening Bank...');
T := FS[CurrentPlayer].BankPoint;

If (Not BankScreen) or (Not PinScreen) Then
if (T.x > 0) then
begin
MMouse(T.x-1, T.y-1, 3, 3);
if WaitUpText('ooth', 400) then
if WaitOption('uickl', 2000)then
begin
FFlag(0);
Timer := GetSystemTime + 10000;
repeat
Wait(100+random(100));
FindNormalRandoms;
If (GetsystemTime > Timer) Then
begin
SetLoc('at bank');
Exit;
end;
until (BankScreen or PinScreen);
end;
end;

If (Not BankScreen) or (Not PinScreen) Then
begin
FS[CurrentPlayer].BankPoint := SpiralMouseOutward('ooth', 'uickl', 3.5)
FFlag(0);
end;
end;
Writeln('After');

Timer := GetSystemTime + 10000;
repeat
Wait(100+random(100));
FindNormalRandoms;
If (GetsystemTime > Timer) Then
begin
SetLoc('at bank');
Exit;
end;
until (BankScreen or PinScreen);

if PinScreen then
begin
Debug('Entering Pin...');
B := 0;
repeat
InPin(Players[CurrentPlayer].Pin);
B := B + 1;
until (BankScreen) or ( B > 5 )
end;


if BankScreen then
With FS[CurrentPlayer] do
begin
repeat
Wait(100+random(100));
Until (CountColor(65535, MBX1, MBY1, MBX2, MBY2) > 50) or not LoggedIn;

IncEx(Players[CurrentPlayer].Integers[10], iCount(UBow));
IncEx(Players[CurrentPlayer].Integers[11], iCount(FBow));

repeat
if not LoggedIn then
Exit;
Debug('Banking...');
if Fletching then
Deposit(2, 28, true);
if Stringing then
Deposit(1, 28, true);
FixBank;

if Fletching then
begin
if (InvCount < 1) then
begin
Writeln('invcount < 1');
NoAction(True, 'InvC Fletching');
Exit;
end;
{ T := BankIndexToMSPoint(bank_Logs);
if (MyGetAmount(T.x+8, T.y+8) < 29) then
begin
writeln('i dunno lol');
NoAction(True);
Exit;
end; }

Debug('Withdrawing...');
P := BankIndexToBankPoint(bank_Logs);
Withdraw(P.x, P.y, 0);
Timer := GetSystemTime + 60000;
Repeat
Wait(50);
until (GetSystemTime > Timer) or (InvCount = 28);
UpdateItem(Log, 3);
end;

if Stringing then
begin
{T := BankIndexToMSPoint(bank_String);
if (MyGetAmount(T.x+8, T.y+8) < (15)) then
begin
NoAction(True);
Exit;
end;
T := BankIndexToMSPoint(bank_Unstrung);
if (MyGetAmount(T.x+8, T.y+8) < (15)) then
begin
NoAction(True);
Exit;
end; }

Debug('Withdrawing...');
P := BankIndexToBankPoint(bank_String);
Withdraw(P.x, P.y, 14);
Timer := GetSystemTime + 60000;
Repeat
Wait(50);
until (GetSystemTime > Timer) or (InvCount = 14);
if (GetSystemTime > Timer) then
Exit;
UpdateItem(BString, 3);
P := BankIndexToBankPoint(bank_Unstrung);
Withdraw(P.x, P.y, 14);

Timer := GetSystemTime + 60000;
Repeat
Wait(50);
until (GetSystemTime > Timer) or (InvCount = 28);
UpdateItem(UBow, 16);
end;

if (GetSystemTime > Timer) then
Exit;
Inc(W);
if (W > 3) then
begin
LogoutSeq('Banking failed');
Exit;
end;

until (InvCount = 28);
end;

Debug('Done Banking...');
CloseWindow;
Inc(Players[CurrentPlayer].Banked);
SetLoc('Banked');
result := true;
Report;
end;


Procedure ScriptSetup;
var
i: integer;
begin
Smart_Server := 54;
Smart_Members:= true;
Smart_Signed := true;
Smart_SuperDetail := false;
SetupSRL;
DeclarePlayers;

//ScriptID := '1152';

for i := 0 to HowManyPlayers-1 do
begin
Case Lowercase(Players[i].strings[0]) of
'long', 'long bow', 'longbow':
begin
FS[i].Fletching := true;
FS[i].ToCut := 'Long Bow';
end;
'short', 'short bow', 'shortbow':
begin
FS[i].Fletching := true;
FS[i].ToCut := 'Short Bow';
end;
'shafts', 'arrow shafts', 'arrowshafts':
begin
FS[i].Fletching := true;
FS[i].ToCut := 'rrow Shafts';
end;
'stock', 'crossbow stock', 'crossbowstock':
begin
FS[i].Fletching := true;
FS[i].ToCut := 'Crossbow Stock';
end;
'string', 'stringing':
FS[i].Stringing := true;
else
begin
Writeln('Fletching string is wrong, fix it!');
TerminateScript;
end;
end;
Players[i].Loc := 'at bank';
end;
end;

begin
ScriptSetup;
ByeBye := 0;
While not RSReady do
Wait(200);

Loginplayer;
SetupPlayer;
ResetTimer('break');

repeat
if Loc('at bank') or Loc('fletched') or Loc('strunged') then
Bank;

if Loc('banked') then
begin
if FS[CurrentPlayer].Fletching then
Fletch;
if FS[CurrentPlayer].Stringing then
Stringer;
end;

if (HowManyPlayers > 1) then
if (GetSystemTime > LogTime) then
LogoutSeq('');
if TakeBreaks then
TakeABreak;
until false;
end.

mika

2012-01-01 19:09:25

doesnt work for me :( after it uses the knife on willow logs it doesnt click make all longbows

Narcle

2012-01-01 19:12:07

From: mika
doesnt work for me :( after it uses the knife on willow logs it doesnt click make all longbows


Using smurgs version?

mika

2012-01-01 20:34:34

now i am, nvm smurgs version works just fine
edit not anymore :( srl 5 broke it

the scar noob

2012-01-27 19:27:03

Updated to SRL v5, yet untested (it compiles).
{==============================================================================]
[ [SRL] Forever Fletch & String by Narcle ]
[ ]
[ NAME : Forever Fletch & String ]
[ WRITER : Narcle ]
[ CATEGORY : Fletching ]
[ DESCRIPTION : Cuts Logs & strings bows ]
[ ]
[==============================================================================]
[ Instructions. ]
[==============================================================================]
[ ]
[ 1. Start next to any bank booth. ]
[ ]
[ 2. Bank Setup, 1st tab - top row: ]
[ [Logs] [String] [Unstrung bows] [4] [5] [6] [7] [8] [9] [10] ]
[ ]
[ 2.5 If cutting place knife in 1st inventory spot. ]
[ ]
[ 3. Setup players in 'DeclarePlayers' ]
[ ]
[ 4. Click play. ]
[==============================================================================}
{.include srl/srl/misc/smart.simba}
{.include srl/srl.simba}
{.include srl/srl/misc/reports.simba}
const
//Antiban
TakeBreaks = true;//Take breaks every 1-3 hours?

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := ''; //Character Name
Pass := ''; //Character Pass
Pin := ''; //Pin for bank
Active := True; //Use player in script?
strings[0] := 'Long';//Long, Short, Shafts, Stock, String
end;
end;

const
bank_Logs = 10;//Log spot in bank
bank_String = 8;//Strings spot in bank
bank_Unstrung = 9;//Unstrung bow spot in bank
SW = True;

type
TTPAItem = Record
OutLine, Width, Height, Color: Integer;
end;
TFS = record
Fletching, Stringing: boolean;
BankPoint: TPoint;
ToCut: string;
Log, BString, FBow, UBow: TTPAItem;
end;

var
LogTime, BreakTime: integer;
FS: array[0..99] of TFS;
ByeBye: Integer;

const
DebugOn = True;
C_OrangeMakeText = 2070783;
LOOP_WAIT = 100;

procedure Debug(s: string);
begin
if DebugOn then
Writeln(s)
else
Debugln(s);
end;

function MakeItemMenu(TimeOut: Integer): Boolean;
var
x, y, T: Integer;
begin
if not LoggedIn then Exit;
Result := FindColorSpiralTolerance(x, y, C_OrangeMakeText, MCX1, MCY1, MCX2, MCY2, 10);
if not Result then
begin
T := GetSystemTime;
repeat
if not LoggedIn then Exit;
Result := FindColorSpiralTolerance(x, y, C_OrangeMakeText, MCX1, MCY1, MCX2, MCY2, 10);
Wait(LOOP_WAIT);
if ((GetSystemTime - T) > TimeOut) then Exit;
until(Result)
end;
end;

function Loc(S: string): Boolean;
begin
Result := Lowercase(Players[CurrentPlayer].Loc) = LowerCase(S);
end;

procedure SetLoc(S: String);
begin
Players[CurrentPlayer].Loc := LowerCase(S);
end;

function MyGetAmount(ItemX, ItemY: Integer): Integer;
var
Col: TIntegerArray;
X, Y, i: Integer;
B: TBox;
TPA: TPointArray;
S: String;
begin
Result := 0;
If Not FindColor(X, Y, srl_outline_black, ItemX-30, ItemY-30, ItemX+30, ItemY+30)then
Exit;
Inc(Result);
Col := [65535, 16777215, 8453888];
For i := 0 to 2 do
If FindColors(TPA, Col[i], ItemX-22, ItemY-22, ItemX+22, ItemY+22)then
begin
B := GetTPABounds(TPA);
S := ExtractFromStr(GetTextAtExWrap(B.x1-1, B.y1-1, B.x2+1, B.y2+1, 0, 2, 4, Col[i], 0, 'StatChars'), numbers);
Result := StrToIntDef(GetNumbers(S), 1);
Case i of
1: Result := Result * 1000;
2: Result := Result * 1000000;
end;
Exit;
end;
end;

function TPAItem(cOutLine, cWidth, cHeight, cColor: Integer): TTPAItem;
begin
with Result do
begin
OutLine := cOutLine;
Width := cWidth;
Height := cHeight;
Color := cColor;
end;
end;

function FindTPAItem(Item: TTPAItem; B: TBox): Boolean;
var
TPA: TPointArray;
Bt: TBox;
x,y: integer;
begin
FindColorsTolerance(TPA, srl_outline_black, B.x1, B.y1, B.x2, B.y2, 0);
if Length(TPA) < 1 then
Exit;
Bt := GetTPABounds(TPA);
if (Length(TPA) = Item.OutLine) and (iAbs(Bt.x2-Bt.x1) = Item.Width) and (iAbs(Bt.y2-Bt.y1) = Item.Height) then
if Item.Color > -1 then
Result := FindColorTolerance(x, y, Item.Color, Bt.x1, Bt.y1, Bt.x2, Bt.y2, 9)
else
Result := True;
end;

Function UpdateItem(var Item: TTPAItem; InvN: integer): Boolean;
var
TPA: TPointArray;
T: TPoint;
B: TBox;
begin
if (Item.OutLine > 0) then
Exit;
Wait(300+random(200));
B := InvBox(InvN);
FindColorsTolerance(TPA, srl_outline_black, B.x1, B.y1, B.x2, B.y2, 0);
if Length(TPA) < 1 then
Exit;
B := GetTPABounds(TPA);
T := MiddleTPA(TPA);
Item := TPAItem(Length(TPA), iAbs(B.x2-B.x1), iAbs(B.y2-B.y1), GetColor(T.x, T.y));
Result := true;
Writeln('Item := TPAItem('+inttostr(Item.Outline) +', '+inttostr(Item.Width)+', '+inttostr(Item.Height)+', '+inttostr(Item.Color)+');');
end;

function iCount(Item: TTPAItem): Integer;
var
i: integer;
begin
for i := 1 to 28 do
if FindTPAItem(Item, InvBox(i)) then
Inc(Result);
end;

function FirstOccurance(Item: TTPAItem; OtherSlot: Integer; Norm: Boolean): Integer;
var
i: integer;
begin
GameTab(tab_Inv);
Result := -1;
if Norm then
begin
for i := OtherSlot to 28 do
if FindTPAItem(Item, InvBox(i)) then
begin
Result := i;
Exit;
end;
end else begin
i := OtherSlot;
repeat
if FindTPAItem(Item, InvBox(i)) then
begin
Result := i;
Exit;
end;
i := i - 1;
until (i <= 1)
end;
end;

function ItemSelected: integer;
var
i: integer;
Box: TBox;
TPA: TPointArray;
begin
for i := 1 to 28 do
begin
Box := InvBox(i);
FindColorsTolerance(TPA, 16777215, Box.x1, Box.y1, Box.x2, Box.y2, 0);
if Length(TPA) > 10 then
begin
Result := i;
Exit;
end;
end;
end;

Function SpiralMouseOutward(UpText, Option: String; Dist: Extended): TPoint;
var
angle, r: extended;
i, T_T: integer;
TPA: TPointArray;
B, P, M: TPoint;
begin
T_T := GetSystemTime + RandomRange(12500, 15500);
Result := Point(-1, -1);
B := Point(269, MSCY);

TPA := [Point(B.x-38, B.y), Point(B.x, B.y-32), Point(B.x+38, B.y), Point(B.x, B.y+39)];
for i := 0 to High(TPA) do
begin
MMouse(TPA[i].x-1, TPA[i].y-1, 2, 2);
if WaitUpText(UpText, 200) then
begin
GetMousePos(M.x, M.y);
Mouse(M.x, M.y, 0, 0, false);
if WaitOption(Option, 2000) then
begin
Result := Point(M.x, M.y);
Exit;
end;
end;
end;

angle := (5.283 + random(3));
repeat
angle := angle + 0.2618;
r := Dist * angle;

P := Point(Round(r * cos(angle)) + B.x, Round(r * sin(angle)) + B.y);

if PointInBox(P, IntToBox(MSX1, MSY1, MSX2, MSY2)) then
begin
MMouse(P.x, P.y, 2, 2);
if WaitUpText(UpText, 200) then
begin
GetMousePos(M.x, M.y);
Mouse(M.x, M.y, 0, 0, false);
if WaitOption(Option, 2000) then
begin
Result := Point(M.x, M.y);
Exit;
end;
end;
end else
Exit;
if(GetSystemTime > T_T)then
Exit;
until (Result.x > 0);
end;

procedure Report;
begin
if (GetTimeRunning < 60000) then
Exit;
SRLPlayerReport( ResultDebugBox, 0, False,
[True, False, False, False, False, False],
['Cut', 'Strung'],
[], [10, 11], [], []);
end;

Procedure ResetTimer(Time: string);
begin
Case LowerCase(Time) of
'logout': LogTime := GetSystemTime+RandomRange(19*60000, 31*60000);
'break': BreakTime := GetSystemTime+RandomRange(250*60000, 320*60000);
end;
end;

procedure SetupPlayer;
begin
SetAngle(SRL_ANGLE_HIGH);
ResetTimer('logout');
end;

procedure LogoutSeq(reason:string);
var
T: integer;
begin
Writeln(reason);
CloseWindow;
Report;
if (reason = '') then
begin
Writeln('Nextplayer true.. WHAAAAT');
if (HowManyPlayers = 1) then
begin
FindNormalRandoms;
Logout;
T := GetSystemTime + RandomRange(5000, 90000);
Repeat
wait(1000);
until (GetSystemTime > T);
end;
NextPlayer(true);
end
else
begin
writeln(reason+', '+Players[CurrentPlayer].Name+' is now inactive.');
NextPlayer(false);
end;
TerminateScript;
SetupPlayer;
end;

procedure NoAction(Add: Boolean; Reason: String);
begin
if Add then
Writeln('Adding counter. ' + Reason)
else
Writeln('Reset counter');

if Add then
ByeBye := ByeBye + 1
else
ByeBye := 0;

if (ByeBye > 4) then
begin
Logout;
writeln('NoAction Terminate');
TerminateScript;
end;
end;

function TakeABreak: boolean;
var
H, M, S, BreakFor, T: integer;
begin
if ( GetSystemTime >= BreakTime ) then
begin
ExitToLobby;
result := true;
BreakFor := RandomRange((1/5) * 60000, 1 * 60000);
ConvertTime(BreakFor, H, M, S);
Report;
Writeln('Break for: '+inttostr(M)+ 'm:' +inttostr(S)+ 's');
ExitToLobby;
MarkTime(T);
Repeat
wait(1000);
until (BreakFor < TimeFromMark(T))
ResetTimer('Logout');
ResetTimer('Break');
LoginPlayer;
SetupPlayer;
end;
end;

Function Stringer: boolean;
var
StringSpot, UBowSpot, T: integer;
begin
With FS[CurrentPlayer] do
begin

if (iCount(UBow) = 0) or (iCount(BString) = 0) then
Exit;

Debug('Stringing...');
StringSpot := FirstOccurance(BString, 28, False);
if (Random(5) = 2) then
UBowSpot := FirstOccurance(UBow, 18, True)
else
UBowSpot := FirstOccurance(UBow, 1, True);

if (ItemSelected = 0) then
MouseItem(StringSpot, mouse_Left);

repeat
if (ItemSelected = StringSpot) then
begin
MouseItem(UBowSpot, mouse_Left);
Break;
end;
wait(50+random(100));
until (GetSystemtime > T);

if not MakeItemMenu(5000) then
begin
NoAction(True, 'No Make Menu; Stringing');
SetLoc('strunged');
Exit;
end;
NoAction(False, '');
Mouse(262, 423, RandomRange(-10, 10), RandomRange(-5, 5), True);
wait(random(300));
if (Random(100) < 90) then
SleepAndMoveMouse(500 + Random(3500));

T := GetSystemTime + 20000;
repeat
FindNormalRandoms;
if (Random(191) = 23) then
SleepAndMoveMouse(RandomRange(750, 4000));
Wait(200);
if ClickToContinue or (GetSystemTime > T) then
Exit;
until (iCount(UBow) = 0) and (InvCount < 15);

SetLoc('strunged');
Result := true;
UpdateItem(FBow, 2);

end;//With do End.
end;

Function Fletch: boolean;
var
LogSpot, KnifeSpot, T: integer;
begin
With FS[CurrentPlayer] do
begin

if (iCount(Log) = 0) then
Exit;
Debug('Fletching...');

KnifeSpot := 1;
if (Random(4) = 0) then
LogSpot := FirstOccurance(Log, 5, True)
else
LogSpot := FirstOccurance(Log, 1, True);

MouseItem(KnifeSpot, mouse_Left);

T := GetSystemTime + 4000;
repeat
if (ItemSelected = KnifeSpot) then
begin
MouseItem(LogSpot, mouse_Left);
Break;
end;
wait(50+random(100));
until (GetSystemtime > T);

if not MakeItemMenu(5000) then
begin
NoAction(True, 'No Make Menu; Fletching');
Exit;
end;
NoAction(False, '');
Mouse(262, 423, RandomRange(-10, 10), RandomRange(-5, 5), True);
wait(random(300));
if (Random(100) < 90) then
SleepAndMoveMouse(500 + Random(3500));

T := GetSystemTime + 90000;
repeat
Wait(200);
if (Random(175) = 63) then
SleepAndMoveMouse(RandomRange(750, 4000));
FindNormalRandoms;
if ClickToContinue then
Exit;
if (GetSystemTime > T) then
Exit;
until (iCount(Log) < 1);
SetLoc('fletched');
Result := true;
UpdateItem(UBow, 3);

end;//With do End.
end;

Function Bank: boolean;
var
TPA: TPointArray;
T, P, MidTPA: TPoint;
W, B, Timer, F, G, Z:integer;
begin
if SW then
begin
FindNormalRandoms;
Debug('Opening Soul Wars Bank...');
if not LoggedIn then LoginPlayer;

If (Not BankScreen) or (Not PinScreen) Then
begin
FindColorsTolerance(TPA, 13158609, 280, 150, 315, 195, 8);
if Length(TPA) > 1 then
begin
MidTPA := MiddleTPA(TPA);
MMouse(MidTPA.x, MidTPA.y, 2, 2);
if WaitUpText('hest', 500) then
begin
GetMousePos(F, G);
Mouse(F, G, 0, 0, False);
if WaitOption('hest', 2000) then
begin
FFlag(0);
Timer := GetSystemTime + 10000;
repeat
Wait(100+random(100));
If (GetsystemTime > Timer) Then
begin
SetLoc('at bank');
Exit;
end;
until (BankScreen or PinScreen);
end;
end;
end else begin
SetAngle(SRL_ANGLE_HIGH);
//MakeCompass('W');
end;
end;

If (Not BankScreen) or (Not PinScreen) Then
begin
Z := GetSystemTime + 3500 + Random(1500);
repeat
if GetSystemTime > Z then Break;
until(BankScreen)
if Not BankScreen then
begin
FS[CurrentPlayer].BankPoint := SpiralMouseOutward('hest', 'hest', 3.5)
FFlag(0);
end;
end;
end else begin
FindNormalRandoms;
Debug('Opening Bank...');
T := FS[CurrentPlayer].BankPoint;

If (Not BankScreen) or (Not PinScreen) Then
if (T.x > 0) then
begin
MMouse(T.x-1, T.y-1, 3, 3);
if WaitUpText('ooth', 400) then
if WaitOption('uickl', 2000)then
begin
FFlag(0);
Timer := GetSystemTime + 10000;
repeat
Wait(100+random(100));
FindNormalRandoms;
If (GetsystemTime > Timer) Then
begin
SetLoc('at bank');
Exit;
end;
until (BankScreen or PinScreen);
end;
end;

If (Not BankScreen) or (Not PinScreen) Then
begin
FS[CurrentPlayer].BankPoint := SpiralMouseOutward('ooth', 'uickl', 3.5)
FFlag(0);
end;
end;
Writeln('After');

Timer := GetSystemTime + 10000;
repeat
Wait(100+random(100));
FindNormalRandoms;
If (GetsystemTime > Timer) Then
begin
SetLoc('at bank');
Exit;
end;
until (BankScreen or PinScreen);

if PinScreen then
begin
Debug('Entering Pin...');
B := 0;
repeat
InPin(Players[CurrentPlayer].Pin);
B := B + 1;
until (BankScreen) or ( B > 5 )
end;


if BankScreen then
With FS[CurrentPlayer] do
begin
repeat
Wait(100+random(100));
Until (CountColor(65535, MBX1, MBY1, MBX2, MBY2) > 50) or not LoggedIn;

IncEx(Players[CurrentPlayer].Integers[10], iCount(UBow));
IncEx(Players[CurrentPlayer].Integers[11], iCount(FBow));

repeat
if not LoggedIn then
Exit;
Debug('Banking...');
if Fletching then
Deposit(2, 28, true);
if Stringing then
Deposit(1, 28, true);
FixBank;

if Fletching then
begin
if (InvCount < 1) then
begin
Writeln('invcount < 1');
NoAction(True, 'InvC Fletching');
Exit;
end;
{ T := BankIndexToMSPoint(bank_Logs);
if (MyGetAmount(T.x+8, T.y+8) < 29) then
begin
writeln('i dunno lol');
NoAction(True);
Exit;
end; }

Debug('Withdrawing...');
P := BankIndexToBankPoint(bank_Logs);
Withdraw(P.x, P.y, 0);
Timer := GetSystemTime + 60000;
Repeat
Wait(50);
until (GetSystemTime > Timer) or (InvCount = 28);
UpdateItem(Log, 3);
end;

if Stringing then
begin
{T := BankIndexToMSPoint(bank_String);
if (MyGetAmount(T.x+8, T.y+8) < (15)) then
begin
NoAction(True);
Exit;
end;
T := BankIndexToMSPoint(bank_Unstrung);
if (MyGetAmount(T.x+8, T.y+8) < (15)) then
begin
NoAction(True);
Exit;
end; }

Debug('Withdrawing...');
P := BankIndexToBankPoint(bank_String);
Withdraw(P.x, P.y, 14);
Timer := GetSystemTime + 60000;
Repeat
Wait(50);
until (GetSystemTime > Timer) or (InvCount = 14);
if (GetSystemTime > Timer) then
Exit;
UpdateItem(BString, 3);
P := BankIndexToBankPoint(bank_Unstrung);
Withdraw(P.x, P.y, 14);

Timer := GetSystemTime + 60000;
Repeat
Wait(50);
until (GetSystemTime > Timer) or (InvCount = 28);
UpdateItem(UBow, 16);
end;

if (GetSystemTime > Timer) then
Exit;
Inc(W);
if (W > 3) then
begin
LogoutSeq('Banking failed');
Exit;
end;

until (InvCount = 28);
end;

Debug('Done Banking...');
CloseWindow;
Inc(Players[CurrentPlayer].Banked);
SetLoc('Banked');
result := true;
Report;
end;


Procedure ScriptSetup;
var
i: integer;
begin
Smart_Server := 54;
Smart_Members:= true;
Smart_Signed := true;
Smart_SuperDetail := false;
SetupSRL;
DeclarePlayers;

//ScriptID := '1152';

for i := 0 to HowManyPlayers-1 do
begin
Case Lowercase(Players[i].strings[0]) of
'long', 'long bow', 'longbow':
begin
FS[i].Fletching := true;
FS[i].ToCut := 'Long Bow';
end;
'short', 'short bow', 'shortbow':
begin
FS[i].Fletching := true;
FS[i].ToCut := 'Short Bow';
end;
'shafts', 'arrow shafts', 'arrowshafts':
begin
FS[i].Fletching := true;
FS[i].ToCut := 'rrow Shafts';
end;
'stock', 'crossbow stock', 'crossbowstock':
begin
FS[i].Fletching := true;
FS[i].ToCut := 'Crossbow Stock';
end;
'string', 'stringing':
FS[i].Stringing := true;
else
begin
Writeln('Fletching string is wrong, fix it!');
TerminateScript;
end;
end;
Players[i].Loc := 'at bank';
end;
end;

begin
ScriptSetup;
{ByeBye := 0;
While not RSReady do
Wait(200);

Loginplayer;
SetupPlayer;
ResetTimer('break');

repeat
if Loc('at bank') or Loc('fletched') or Loc('strunged') then
Bank;

if Loc('banked') then
begin
if FS[CurrentPlayer].Fletching then
Fletch;
if FS[CurrentPlayer].Stringing then
Stringer;
end;

if (HowManyPlayers > 1) then
if (GetSystemTime > LogTime) then
LogoutSeq('');
if TakeBreaks then
TakeABreak;
until false; }
end.