• Log in or sign up for an account here: https://www.sythe.org/login

Snappie's AutoFletcher - first script!

snappie1000

Forum Addict
Joined
Apr 7, 2007
Sythe Gold
1
Messages
464
Two Factor Authentication User
My first script. I will update it if i get some good feedbacks. Make sure you are logged in and you must have a knife in first slot and logs in the other slots. Also you need logs in your first bank slot. It will only fletch oak or better longbows. This script will work in any bank in:
- Falador
- Varrock
- Draynor
- Al-Kharid

Current verison: V0.2
Added:
- Easy to fill in form
- Made more randomness


Code:
program AutoFletcher

{.include SRL/SRL.scar}
{############################ Description. READ! ##############################)
(## Version: 0.1                                                             ##)
(## Created by: Snappie1000                                                  ##)
(##                                                                          ##)
(## Requiments: Knife in first inventory slot and 27 logs in the other 27    ##)
(## slots and some logs in first bank slot                                   ##)
(##                                                                          ##)
(## Futher information:                                                      ##)
(## At line 23 you will find "Bank = '';. Here you have to enter in which    ##)
(## bank you are. Fill in one with of the following commands:                ##)                                                    ##)
(##  'feb' (Falador East Bank)                                               ##)
(##  'fwb' (Falador West Bank)                                               ##)
(##  'veb' (Varrock East Bank)                                               ##)
(##  'vwb' (Varrock West Bank)                                               ##)
(##  'db'  (Draynor Bank)                                                    ##)
(##  'akb' (Al-Kharid Bank)                                                  ##)
(##############################################################################}

const
Bank2 = 'veb';                     //Check description for futher information
Loads2= 10;

{########### Don't change this except when you know what your doing ###########}
var
  x, y, LoadsDone, LogsCut : Integer;
  frmDesign : TForm;
  Label1 : TLabel;
  Label2 : TLabel;
  Label3 : TLabel;
  username : TEdit;
  password : TEdit;
  nickname : TEdit;
  start : TButton;


procedure ButtonClick(sender: TObject);
begin
  frmDesign.Caption:= frmDesign.Caption + '.';
  frmDesign.ModalResult:= mrOk;
end;

procedure InitForm;
begin
  frmDesign := CreateForm;
  frmDesign.Left := 480;
  frmDesign.Top := 180;
  frmDesign.Width := 400;
  frmDesign.Height := 200;
  frmDesign.Caption := 'Snappie''s AutoFletcher';
  frmDesign.Color := clBlack;
  frmDesign.Font.Color := clWindowText;
  frmDesign.Font.Height := -11;
  frmDesign.Font.Name := 'MS Sans Serif';
  frmDesign.Font.Style := [];
  frmDesign.Visible := False;
  frmDesign.PixelsPerInch := 96;
  username := TEdit.Create(frmDesign);
  username.Parent := frmDesign;
  username.Left := 20;
  username.Top := 28;
  username.Width :=170 ;
  username.Height := 17;
  username.TabOrder := 8;
  username.Text := '';
  password := TEdit.Create(frmDesign);
  password.Parent := frmDesign;
  password.Left := 20;
  password.Top := 78;
  password.Width := 170;
  password.Height := 17;
  password.TabOrder := 9;
  password.Text := '';
  nickname := TEdit.Create(frmDesign);
  nickname.Parent := frmDesign;
  nickname.Left := 20;
  nickname.Top := 128;
  nickname.Width := 170;
  nickname.Height := 17;
  nickname.TabOrder := 10;
  nickname.Text := '';
  Label1 := TLabel.Create(frmDesign);
  Label1.Parent := frmDesign;
  Label1.Left := 20;
  Label1.Top := 10;
  Label1.Width := 164;
  Label1.Height := 10;
  Label1.Caption := 'Username:';
  Label1.Font.Color := clYellow;
  Label1.Font.Height := -13;
  Label1.Font.Name := 'Comic Sans MS';
  Label1.Font.Style := [];
  Label2 := TLabel.Create(frmDesign);
  Label2.Parent := frmDesign;
  Label2.Left := 20;
  Label2.Top := 60;
  Label2.Width := 164;
  Label2.Height := 10;
  Label2.Caption := 'Password:';
  Label2.Font.Color := clYellow;
  Label2.Font.Height := -13;
  Label2.Font.Name := 'Comic Sans MS';
  Label2.Font.Style := [];
  Label3 := TLabel.Create(frmDesign);
  Label3.Parent := frmDesign;
  Label3.Left := 20;
  Label3.Top := 110;
  Label3.Width := 164;
  Label3.Height := 32;
  Label3.Caption := 'Nickname:';
  Label3.Font.Color := clYellow;
  Label3.Font.Height := -13;
  Label3.Font.Name := 'Comic Sans MS';
  Label3.Font.Style := [];
  start := TButton.Create(frmDesign);
  start.OnClick := @buttonclick;
  start.Parent := frmDesign;
  start.Left := 210;
  start.Top := 28;
  start.Width := 145;
  start.Height := 120;
  start.Caption := 'Start Fletching';
  start.TabOrder := 12;
end;


procedure SafeInitForm;
var
  v: TVariantArray;
begin
  setarraylength(V, 0);
  ThreadSafeCall('InitForm', v);
end;

procedure ShowFormModal;
begin
  frmDesign.ShowModal;
end;

procedure SafeShowFormModal;
var
  v: TVariantArray;
begin
  setarraylength(V, 0);
  ThreadSafeCall('ShowFormModal', v);
end;

procedure DeclarePlayers;
begin
  HowManyPlayers := 1;
  NumberOfPlayers(HowManyPlayers);
  CurrentPlayer := 0;

  Players[0].Name := username.Text;
  Players[0].Pass := password.Text;
  Players[0].Nick := nickname.Text;
  Players[0].Active := True;
end;


procedure AntiRandoms;
begin
  FindNormalRandoms;
  if FindFight then
    RunAway('N', True, 1, 5000);
end;


procedure AntiBan;
begin
  case random(20) of
    0: PickUpMouse;
    1: BoredHuman;
    2: HoverSkill('Fletching', False);
    3,4: begin
           MakeCompass('N');
           wait(10+random(5));
           MakeCompass('S');
           wait(10+random(5));
           MakeCompass('N');
         end;
  end;
end;


procedure Fletch;
begin
 if not LoggedIn then LoginPlayer;
  wait(500+random(1000));
  AntiRandoms;
  MouseItem(1, true);                                // click knife
  wait(500+random(1000));
  MouseItem(2, true);                                // click log
  wait(500+random(1000));
  Mouse(214+random(94), 381+random(58), 1, 1, false) // click longbow
  wait(500+random(1000));
  ChooseOption('X');
  Wait(500+random(1000));
  AntiRandoms;
    Case Random(10) of
      0: TypeSend(AddMistakes('27', 20));
      1: TypeSend(AddMistakes('27', 20));
      2: TypeSend(AddMistakes('28', 20));
      3: TypeSend(AddMistakes('29', 20));
      4: TypeSend(AddMistakes('38', 20));
      5: TypeSend(AddMistakes('39', 20));
      6: TypeSend(AddMistakes('51', 20));
      7: TypeSend(AddMistakes('60', 20));
      8: TypeSend(AddMistakes('89', 20));
      9: TypeSend(AddMistakes('99', 20));
    end;
  Writeln ('Fletching logs.');
  Wait(500+random(1000));
  AntiBan;
  wait(51000+random(500));
end;


procedure GoBank;
begin
 if not LoggedIn then Exit;
  AntiRandoms;
  LogsCut:=LogsCut+27;
  LoadsDone:=Loadsdone+1;
  Writeln ('######## Report #####################');
  Writeln ('## Fletched: ' +IntToStr(LogsCut)+ ' log(s).');
  Writeln ('## Fletched: ' +IntToStr(Loadsdone)+' load(s).');
  Writeln ('## Ran for: ' +TimeRunning+'.');
  Writeln ('#####################################');
  OpenBankQuiet(bank2);
  wait(500+random(1000));
  if (BankScreen=false) then
    begin
     writeln('Couldn''t find bank, terminating script');
     logout;
     terminatescript;
    end;
  if (BankScreen=true) then
   begin
    Mouse(612, 232, 4, 4, false);
    Wait(200+random(500));
    ChooseOption('All');
    Wait(200+random(500));
    Mouse(51, 109, 4, 4, false);
    Wait(200+random(500));
    ChooseOption('X');
    Wait(200+random(500));
      Case Random(10) of
        0: TypeSend(AddMistakes('27', 20));
        1: TypeSend(AddMistakes('27', 20));
        2: TypeSend(AddMistakes('28', 20));
        3: TypeSend(AddMistakes('30', 20));
        4: TypeSend(AddMistakes('33', 20));
        5: TypeSend(AddMistakes('51', 20));
        6: TypeSend(AddMistakes('71', 20));
        7: TypeSend(AddMistakes('88', 20));
        8: TypeSend(AddMistakes('89', 20));
        9: TypeSend(AddMistakes('99', 20));
      end;
    Wait(250+random(500));
    CloseBank;
   end;
end;

begin
  SetupSRL;
  SafeInitForm;
  SafeShowFormModal;
  DeclarePlayers;
  Repeat
    Fletch;
    GoBank;
  until(Loadsdone >= Loads2);
end.
 
need to call DeclarePlayers;

Code:
SetupSRL;
DeclarePlayers;

Maybe a couple failsafes?

Code:
if not LoggedIn then Exit; //functions and procedures
if not LoggedIn then LoginPlayer; //mainloop

Also with banking?

Code:
if not OpenBankFast(bank) then
  if not OpenBankQuiet(bank) then
   //break or try something here?

?
 
Two Factor Authentication User
I alredy declared players in procedure fletch. Failsafes are a great idea. Ill add them in my script.
 
its and with banking?
 
looks good snappie, glad to see that you have taken up scripting.
 
sorry snappie, don't want to repeat SetupSRL; either (= bad)

mainloop should be

Code:
begin
  SetupSRL;
  DeclarePlayers;
  Repeat
    Fletch;
    GoBank;
  until(Loadsdone >= Loads);
end.


sorry for the confusion.


What declareplayers does is sets the player up for logging in and out and creating a TPA of the nickname for anti-randoms. So this only needs to be called once.

SetupSRL sets up everything in SRL, just some random stuff like MouseSpeed, Creates things, connects to stats, stuff like that...
 
Two Factor Authentication User
looks good snappie, glad to see that you have taken up scripting.

Thanks.

sorry snappie, don't want to repeat SetupSRL; either (= bad)

mainloop should be

Code:
begin
  SetupSRL;
  DeclarePlayers;
  Repeat
    Fletch;
    GoBank;
  until(Loadsdone >= Loads);
end.


sorry for the confusion.


What declareplayers does is sets the player up for logging in and out and creating a TPA of the nickname for anti-randoms. So this only needs to be called once.

SetupSRL sets up everything in SRL, just some random stuff like MouseSpeed, Creates things, connects to stats, stuff like that...

I've added the script like you said. Thanks for the help tough.

TypeSend('27');

eeek, make more randomness.

learn cases... OR, i think theres a "HitKeys;" command.

"procedure TypeSend(Text: String);
By: Mutant Squirrle
Description:
Types text humanlike using random timeing on keys."

But if you mean typing 27 all the time; im working on a V0.2 which I will include with stuff like this (and I hope it will get a good working form).
 
Snappie, just one thing. to add to what Jethr0x said, use this
Code:
TypeSend(AddMistakes('Text here', 20))
It types what you put in "text here" and might make a mistake in spelling like a human would.
 
Two Factor Authentication User
Snappie, just one thing. to add to what Jethr0x said, use this
Code:
TypeSend(AddMistakes('Text here', 20))
It types what you put in "text here" and might make a mistake in spelling like a human would.

So that's like
Code:
    Case Random(10) of
      0: TypeSend(AddMistakes('27', 20));
      1: TypeSend(AddMistakes('27', 20));
      2: TypeSend(AddMistakes('28', 20));
      3: TypeSend(AddMistakes('29', 20));
      4: TypeSend(AddMistakes('38', 20));
      5: TypeSend(AddMistakes('39', 20));
      6: TypeSend(AddMistakes('51', 20));
      7: TypeSend(AddMistakes('60', 20));
      8: TypeSend(AddMistakes('89', 20));
      9: TypeSend(AddMistakes('99', 20));
    end;
 
ok good good but you wouldnt wana make all those typesends all have added mistakes if you think about it its kinda detectable and a human wouldnt type everything wrong :P just tryin to help matie
 
Radicle, the 20 in the function means that it wont always make mistakes but just sometimes. trust me its good function to use

And yes snappie thats the idea.
 
isnt addmistakes just for letters?

just do like
typesend(Inttostr(27+random(1000))

or just do hitkeys;
 
it should work as long as the number is in string format. Jethr0x, i think he would be better off saying words then just random numbers up to 1027 =] .
 
Runescape Gamblingrunescape gambling
Back
Top