SCAR Code:
{+++++++++++++++++++++++++++++++++++++++++]
Fletcher v3.1
By: DeKienger
[+++++++++++++++++++++++++++++++++++++++++]
Instructions
1. Start in any bank
3. If Making Bows, put logs in first
bank slot and fill inventory with all
logs except a knife in the very bottom
right hand corner of your inventory
4. If Stringing Bows, Put strings in
first bank slot and bows in second
inventory slot then fill inventory
with 14 strings and 14 bows
5. Requires OSi v3.5
[++++++++++++++++++++++++++++++++++++++++}
{ChangeLog:
v2.0 - My Initial Release
v2.1 - Randomized more mouse clicking and more humanlike
v2.5 - Updated various procedures, made OSi compatible
v2.6 - Added Forms
v2.7 - Made compatible with OSi v3.1
v2.8 - UPDATE!!! NOW WITH CLOSE BANK FEATURE (sorry about the last version)
v2.9 - Made OSi Compatible
v3.0 - Updated with new RS update}
program Fletchlongbows;
var
h,mode,LetterX,LetterXY: integer; // Needed Vars
STT: LongInt;
PickMode,Logs: TLabel;
form, self: TForm;
Application: TApplication;
MList: TComboBox;
ButtonOK: TButton;
TxtLogs: TEdit;
{.include OSi.txt}
Procedure Report(doing:string); {Created by DeKienger}
var time,StrSecZero,StrMinZero:string;
Hours,Minutes,Seconds,avtime:LongInt;
begin
clearreport;
Seconds:=(GetSystemTime-ST) div 1000;
Minutes:=Seconds div 60;
Hours:=Minutes div 60;
Time:=inttostr(Seconds)+' Seconds';
if(banks <> 0)then
avtime:=Seconds/Banks;
if Hours<>0 then
if((Minutes Mod (Hours*60))<10)then
StrMinZero:='0';
if Minutes <> 0 then
if((Seconds Mod (Minutes*60))<10)then
StrSecZero:='0';
if Minutes <> 0 then
begin
Seconds:=Seconds Mod (Minutes*60);
Time:=inttostr(Minutes)+':'+StrSecZero+inttostr(Seconds);
end;
if Hours <> 0 then
begin
Minutes:=Minutes Mod (Hours*60);
if(Minutes <> 0)then
Seconds:=Seconds Mod (Minutes*60);
Time:=inttostr(Hours)+':'+StrMinZero+inttostr(Minutes)+':'+StrSecZero+inttostr(Seconds);;
end;
addtoreport('Fletcher by DeKienger');
addtoreport('****************************');
addtoreport('Currently: '+doing);
addtoreport('Worked for '+time);
case mode of
1:addtoreport('Banked '+inttostr(banks)+' Time[s] & fletched '+inttostr(banks*405)+' Shafts')
2:addtoreport('Banked '+inttostr(banks)+' Time[s] & fletched '+inttostr(banks*27)+' ShortBows');
3:addtoreport('Banked '+inttostr(banks)+' Time[s] & fletched '+inttostr(banks*27)+' LongBows');
4:addtoreport('Banked '+inttostr(banks)+' Time[s] & fletched '+inttostr(banks*27)+' ShortBows');
5:addtoreport('Banked '+inttostr(banks)+' Time[s] & fletched '+inttostr(banks*27)+' LongBows');
6:addtoreport('Banked '+inttostr(banks)+' Time[s] & attached '+inttostr(banks*14)+' Bowstrings')
end;
if(mode<6)and(avtime>0)then addtoreport('Averaging: '+inttostr(3600/avtime*27)+' Bows/Hour');
if(mode = 6)and(avtime>0)then addtoreport('Averaging: '+inttostr(3600/avtime*14)+' Strings Attached/Hour');
end;
Procedure Bank;
begin
Report('Banking');
OpenBank;
Deposit(1,1,30);
if(mode<6)then
Withdraw(1,1,0);
if(mode=6)then
begin
Withdraw(1,1,14);
Withdraw(2,1,0);
end;
CloseBank;
end;
Procedure Fletch;
var c:integer;
begin
c:=0;
STT:=GetSystemTime;
if(mode=6)then
begin
Report('Fletching');
repeat
Mouse(612,322,20,20,true);
wait (175+random(50))
Mouse(696,430,20,20,true);
wait (450+random(75));
until(GetColor(354,373)=3885652)or(STT-GetSystemTime>5000)
end;
if(mode<6)then
c:=c+1;
Mouse(700,434,20,20,true);
Mouse(658,434,20,20,true);
Wait(700+random(250));
if(GetColor(354,373)=128)then
begin
case mode of
1:Mouse(96,403,10,10,false);
2:Mouse(252,403,10,10,false);
3:Mouse(410,411,10,10,false);
4:Mouse(110,371,60,70,false);
5:Mouse(345,385,50,50,false);
end;
if(FindBitmap(LetterX,x,y))or(FindBitmap(LetterXY,x,y))then
Mouse(x-10,y,10,5,true);
wait(750+random(200));
while(not(GetColor(258,412)=8388608))and(c<300)do
begin c:=c+1; wait(10); end;
if(GetColor(258,412)=8388608)then
begin
c:=0;
SendKeysSilentSmooth('30'+chr(13),100);
repeat
report('Fletching');
wait(500);
c:=c+1;
until(c>120)or((GetColor(46,417)=0)and(GetColor(128,429)=0));
end;
end;
end;
procedure buttonclick(sender: TObject);
begin
case Mlist.Text of
'Oak+ Long Bows':mode:=5
'Oak+ Short Bows':mode:=4
'Regular Long Bows':mode:=3
'Regular Short Bows':mode:=2
'Shafts':mode:=1
'Attach Strings':mode:=6
end;
if(mode=6)then
h:=trunc((StrToInt(TxtLogs.Text))/14);
if(mode<6)then
h:=trunc((StrToInt(TxtLogs.Text))/27);
end;
Procedure Forms;
begin
Application:= GetApplication;
Self:= GetSelf;
Form:= TForm.Create(nil);
Form.Width := 250;
Form.Height := 150;
Form.Position := poScreenCenter;
Form.BorderStyle := bsDialog;
Form.Caption := 'Fletcher v2.5 by DeKienger';
PickMode := TLabel.Create(Form);
PickMode.Top := 5;
PickMode.Left := 50;
PickMode.Caption := 'Choose fletching mode:';
PickMode.Parent := Form;
MList:= TComboBox.Create(form);
MList.Top:= 20;
MList.Left:= 50;
MList.Parent:= Form;
MList.DropDownCount:= 5;
MList.Items.Add ('Oak+ Long Bows');
MList.Items.Add ('Oak+ Short Bows');
MList.Items.Add ('Regular Long Bows');
MList.Items.Add ('Regular Short Bows');
MList.Items.Add ('Shafts');
MList.Items.Add ('Attach Strings');
MList.ItemIndex:= 0;
Logs := TLabel.Create(Form);
Logs.Top:= 45;
Logs.Left := 50;
Logs.Caption := 'Logs/Bows/Strings in Bank:';
Logs.Parent := Form;
TxtLogs := TEdit.Create(Form);
TxtLogs.Top := 60;
TxtLogs.Left := 50;
TxtLogs.Width := 145;
TxtLogs.Parent := Form;
ButtonOK := TButton.Create(Form);
ButtonOK.Left := 85;
ButtonOK.Top := 85;
ButtonOK.Width := 80;
ButtonOK.Height := 24;
ButtonOK.Caption := '&OK';
ButtonOK.OnClick := @buttonclick;
ButtonOK.Parent := Form;
ButtonOK.Default := True;
ButtonOK.ModalResult:= mrOk;
Form.ShowModal;
Form.Free;
end;
begin
Forms;
SetupOSi;
Mouse(1,200,3,100,true);
LetterX := LoadBitmap('./Charsrs2/50.bmp');
LetterXY := BitmapFromString(6, 7,
'FFFF00FFFF000000005D5447FFFF00FFFF005D5447FFFF00FFFF00' +
'FFFF00FFFF000000005D5447FFFF00FFFF00FFFF00FFFF00000000' +
'5D54475D5447FFFF00FFFF000000000000005D5447FFFF00FFFF00' +
'FFFF00FFFF005D54475D5447FFFF00FFFF00FFFF00FFFF00000000' +
'FFFF00FFFF00000000000000FFFF00FFFF00');
ST:=getsystemtime
bank;
banks:=0;
if(mode>0)and(mode<7)then
repeat
Fletch;
Bank;
until(banks>=h)
end.