rishi42
06-10-2007, 10:51 PM
V1.2 is Out !
The Script is now working fully, with a form and support for all arrow-types.
with v1.2, the script Actually supports all arrow-types!
to be done...
1.Anti-Randoms
2.Anything else you testers can think of.
This script buys arrowheads from the Ranging shop in Catherby and attaches them to headless arrows. It will switch from world to world on it's own, so it can potentially buy all the arrowheads from the shop on each world.
Right now the script works pretty flawlessly, it might make mistakes on the way occasionally but manages to correct itself.
It has one failsafe, but i think it's the only one it really needs. It doesn't have antirandoms, but i dont think it will get many random events since it stays in the shop and switches worlds every minute or two.
I'm not sure if this type of script requires multiplayer either.
Please try it out, and all critique/feedback is welcome.
:spongebob: ftw!
{ Rishi's Catherby Arrow Fletcher
* * * Instructions * * *
1. Have your headless arrows in your first inventory slot.
2. Have your Gold in the fourth inventory slot.
3. Keep slots 2 and 3 empty.
4. Start in the middle of the Catherby Ranging Shop.
* * * * * * * * * * * * * }
program ArrowFletcher;
{.include SRL/SRL.scar}
var
User,PW: String;
num, row, column, i,xx,yy,arrowcolor,failsafe, asx, asy: Integer;
HicktonColor : Array[0..4] of integer;
frmDesign : TForm;
Label1 : TLabel;
Userbox : TEdit;
Edit1 : TEdit;
Button1 : TButton;
AType: TPopupMenu;
AtypeMenu1, AtypeMenu2, AtypeMenu3, AtypeMenu4, AtypeMenu5, AtypeMenu6: TMenuItem;
btn: TButton;
procedure Check;
begin
if (findcolor(xx,yy,65535,560,210,600,225)=False)
then begin
writeln('No more Headless Arrows, Ending Script');
Logout;
wait(3000);
TerminateScript;
end else
if((findcolor(xx,yy,65535,715,210,725,225)=False)a nd(findcolor(xx,yy,16777215,693,210,725,225)=False ))
then begin
writeln('No more gold, Ending Script');
Logout;
TerminateScript;
end else
end;
procedure FixBrightness;
begin
MakeCompass('N');
Gametab(11);
mouse(677,227,3,3,True);
wait(200+random(200));
mouse(710,225,3,3,True);
wait(200+random(200));
Gametab(4);
end;
procedure NextWorld;
begin
writeln('***************************************** **');
writeln('Script has been running for '+TimeRunning);
writeln('Visited '+ IntToStr(num-1) + ' worlds.');
writeln('***************************************** **');
mouse(10,465,85,30,True);
repeat
wait(200);
until(getcolor(146,5)=1682881);
if((getcolor(632,8)=2851375)=False)
then mouse(632,8,2,2,True);
if(row=21)
then begin
column:=(column+1);
row:=1;
mouse((370+(100*column)),(20+(23*row)),10,4,True);
end else
mouse((370+(100*column)),(20+(23*row)),10,4,True);
row:=(row+1);
end;
procedure BuyHeads;
begin
Writeln('Buying Arrowheads...');
repeat
check;
Mouse(asx+2,asy+2,20,20,False);
GetMousePos(x,y);
Mouse(x,y+64,40,15,True);
wait(100+random(200));
until((findcolor(x,y,65535,(asx+6),asy,(asx+20),(a sy+10))=False));
Mouse(478,32,19,18,True);
Writeln('Bought all the arrowheads they got!');
end;
procedure AttachHeads;
begin
repeat;
Check;
Mouse(570,214,22,25,True);
Mouse(611,213,27,29,True);
wait(100+random(200));
until((findcolor(x,y,65535,611,212,637,239)=False) );
Writeln('Attached All Arrowheads to Headless Arrows...');
end;
procedure FindHickton;
begin
//FixBrightness;
failsafe := 0;
gametab(random(14));
gametab(4);
makecompass('n');
Check;
HicktonColor[0]:=4407296;
HicktonColor[1]:=1812960;
HicktonColor[2]:=5723688;
HicktonColor[3]:=4356382;
HicktonColor[4]:=6917815;
Writeln('Finding Hickton...');
repeat
i := -1;
repeat
i := (i+1);
if (i = 5)
then begin
i:=0;
failsafe:=(failsafe+1);
end else
findcolor(x,y,HicktonColor[i],100,35,455,305);
if (failsafe = 10)
then begin
findsymbol(x,y,'Archery Shop');
mouse(x,y,1,1,True);
failsafe := 0;
end else
wait(200);
until(findcolor(x,y,HicktonColor[i],100,35,455,305)=True);
movemousesmoothex(x,y,15,15,15,30,15);
mouse(x,y,1,1,False);
mouse(x,y+34,40,14,True);
Flag;
wait(500+random(500));
until(GetColor(501,321)=921873);
Writeln('Found em');
end;
procedure Login;
begin
Writeln('Logging In...');
wait(200+random(250));
Mouse(390,272,140,35,True);
Mouse(271,250,215,10,True);
TypeSend(User+chr(13)+PW);
Mouse(229,303,141,33,True);
repeat
wait(250);
until(GetColor(410,323)=2241151);
Mouse(270,290,220,90,True);
end;
Procedure AddPic;
var
Picture : integer;
Canvas : TCanvas;
begin
Picture := LoadBitmap(ScriptPath + 'ArrowFletcherFormBG.bmp')
Canvas:= GetBitmapCanvas(Picture);
CopyCanvas(Canvas, frmDesign.Canvas, 0, 0, 416, 164, 0, 0, 416, 164);
end;
Procedure FormPaintBG(Sender : TObject);
begin
AddPic;
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 Atype1Click(sender: TObject);
begin
Arrowcolor := 1913924;
asx:=362;
asy:=116;
Writeln('Making Bronze Arrows');
end;
procedure Atype2Click(sender: TObject);
begin
Arrowcolor := 4473928;
asx:=409;
asy:=116;
Writeln('Making Iron Arrows');
end;
procedure Atype3Click(sender: TObject);
begin
Arrowcolor := 6908272;
asx:=80;
asy:=162;
Writeln('Making Steel Arrows');
end;
procedure Atype4Click(sender: TObject);
begin
Arrowcolor := 5453623;
asx:=127;
asy:=162;
Writeln('Making Mithril Arrows');
end;
procedure Atype5Click(sender: TObject);
begin
Arrowcolor := 4083006;
asx:=174;
asy:=162;
Writeln('Making Adamantine Arrows');
end;
procedure Atype6Click(sender: TObject);
begin
Arrowcolor := 6445378;
asx:=221;
asy:=162;
Writeln('Making Runite Arrows');
end;
procedure ClickButton(sender: TObject);
begin
User := Userbox.text
PW := Edit1.text
frmDesign.Caption:= frmDesign.Caption + '.';
frmDesign.ModalResult:= mrOk;
end;
procedure ButtonClick(sender: TObject);
begin
GetMousePos(x, y);
Atype.Popup(x, y);
end;
Procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 250;
frmDesign.Top := 114;
frmDesign.Width := 422;
frmDesign.Height := 188;
frmDesign.Caption := 'frmDesign';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
frmDesign.ONPAINT := @FormPaintBG;
Userbox := TEdit.Create(frmDesign);
Userbox.Parent := frmDesign;
Userbox.Left := 200;
Userbox.Top := 3;
Userbox.Width := 207;
Userbox.Height := 15;
Userbox.Font.Color := clWindowText;
Userbox.Font.Height := -12;
Userbox.Font.Name := 'Arial';
Userbox.Font.Style := [];
Userbox.ParentFont := False;
Userbox.TabOrder := 8;
Userbox.Text := '(Enter Username Here)';
Edit1 := TEdit.Create(frmDesign);
Edit1.Parent := frmDesign;
Edit1.Left := 200;
Edit1.Top := 27;
Edit1.Width := 207;
Edit1.Height := 15;
Edit1.Font.Color := clWindowText;
Edit1.Font.Height := -12;
Edit1.Font.Name := 'Arial';
Edit1.Font.Style := [];
Edit1.ParentFont := False;
Edit1.TabOrder := 9;
Edit1.Text := '(Enter Password Here)';
Button1 := TButton.Create(frmDesign);
Button1.Parent := frmDesign;
Button1.Left := 200;
Button1.Top := 57;
Button1.Width := 207;
Button1.Height := 40;
Button1.Caption := 'Click Here to Start!';
Button1.Font.Color := clWindowText;
Button1.Font.Height := -19;
Button1.Font.Name := 'Arial';
Button1.Font.Style := [];
Button1.ParentFont := False;
Button1.TabOrder := 10;
btn := TButton.Create(frmDesign);
btn.Parent := frmDesign;
btn.Caption := 'Click to choose your arrow type.';
btn.Left := 200;
btn.Top := 97;
btn.Width := 207;
btn.Height := 40;
btn.TabOrder := 8;
btn.OnClick := @ButtonClick;
Atype := TPopupMenu.Create(frmDesign);
AtypeMenu1 := TMenuItem.Create(frmDesign);
AtypeMenu1.Caption := 'Bronze';
AtypeMenu1.OnClick := @Atype1Click;
Atype.Items.Add(AtypeMenu1);
AtypeMenu2 := TMenuItem.Create(frmDesign);
AtypeMenu2.Caption := 'Iron';
AtypeMenu2.OnClick := @Atype2Click;
Atype.Items.Add(AtypeMenu2);
AtypeMenu3 := TMenuItem.Create(frmDesign);
AtypeMenu3.Caption := 'Steel';
AtypeMenu3.OnClick := @Atype3Click;
Atype.Items.Add(AtypeMenu3);
AtypeMenu4 := TMenuItem.Create(frmDesign);
AtypeMenu4.Caption := 'Mithril';
AtypeMenu4.OnClick := @Atype4Click;
Atype.Items.Add(AtypeMenu4);
AtypeMenu5 := TMenuItem.Create(frmDesign);
AtypeMenu5.Caption := 'Addy';
AtypeMenu5.OnClick := @Atype5Click;
Atype.Items.Add(AtypeMenu5);
AtypeMenu6 := TMenuItem.Create(frmDesign);
AtypeMenu6.Caption := 'Runite';
AtypeMenu6.OnClick := @Atype6Click;
Atype.Items.Add(AtypeMenu6);
Button1.Onclick:=@clickbutton;
end;
begin
SafeInitForm;
SafeShowFormModal;
ClearDebug;
num:=0;
row:=1;
column:=1;
SetUpSRL;
repeat
num := (num+1);
NextWorld;
Login;
FindHickton;
wait(200+random(300));
BuyHeads;
AttachHeads;
writeln('All done here, logging out & switching worlds...');
Logout;
until(num=57);
end.
The Script is now working fully, with a form and support for all arrow-types.
with v1.2, the script Actually supports all arrow-types!
to be done...
1.Anti-Randoms
2.Anything else you testers can think of.
This script buys arrowheads from the Ranging shop in Catherby and attaches them to headless arrows. It will switch from world to world on it's own, so it can potentially buy all the arrowheads from the shop on each world.
Right now the script works pretty flawlessly, it might make mistakes on the way occasionally but manages to correct itself.
It has one failsafe, but i think it's the only one it really needs. It doesn't have antirandoms, but i dont think it will get many random events since it stays in the shop and switches worlds every minute or two.
I'm not sure if this type of script requires multiplayer either.
Please try it out, and all critique/feedback is welcome.
:spongebob: ftw!
{ Rishi's Catherby Arrow Fletcher
* * * Instructions * * *
1. Have your headless arrows in your first inventory slot.
2. Have your Gold in the fourth inventory slot.
3. Keep slots 2 and 3 empty.
4. Start in the middle of the Catherby Ranging Shop.
* * * * * * * * * * * * * }
program ArrowFletcher;
{.include SRL/SRL.scar}
var
User,PW: String;
num, row, column, i,xx,yy,arrowcolor,failsafe, asx, asy: Integer;
HicktonColor : Array[0..4] of integer;
frmDesign : TForm;
Label1 : TLabel;
Userbox : TEdit;
Edit1 : TEdit;
Button1 : TButton;
AType: TPopupMenu;
AtypeMenu1, AtypeMenu2, AtypeMenu3, AtypeMenu4, AtypeMenu5, AtypeMenu6: TMenuItem;
btn: TButton;
procedure Check;
begin
if (findcolor(xx,yy,65535,560,210,600,225)=False)
then begin
writeln('No more Headless Arrows, Ending Script');
Logout;
wait(3000);
TerminateScript;
end else
if((findcolor(xx,yy,65535,715,210,725,225)=False)a nd(findcolor(xx,yy,16777215,693,210,725,225)=False ))
then begin
writeln('No more gold, Ending Script');
Logout;
TerminateScript;
end else
end;
procedure FixBrightness;
begin
MakeCompass('N');
Gametab(11);
mouse(677,227,3,3,True);
wait(200+random(200));
mouse(710,225,3,3,True);
wait(200+random(200));
Gametab(4);
end;
procedure NextWorld;
begin
writeln('***************************************** **');
writeln('Script has been running for '+TimeRunning);
writeln('Visited '+ IntToStr(num-1) + ' worlds.');
writeln('***************************************** **');
mouse(10,465,85,30,True);
repeat
wait(200);
until(getcolor(146,5)=1682881);
if((getcolor(632,8)=2851375)=False)
then mouse(632,8,2,2,True);
if(row=21)
then begin
column:=(column+1);
row:=1;
mouse((370+(100*column)),(20+(23*row)),10,4,True);
end else
mouse((370+(100*column)),(20+(23*row)),10,4,True);
row:=(row+1);
end;
procedure BuyHeads;
begin
Writeln('Buying Arrowheads...');
repeat
check;
Mouse(asx+2,asy+2,20,20,False);
GetMousePos(x,y);
Mouse(x,y+64,40,15,True);
wait(100+random(200));
until((findcolor(x,y,65535,(asx+6),asy,(asx+20),(a sy+10))=False));
Mouse(478,32,19,18,True);
Writeln('Bought all the arrowheads they got!');
end;
procedure AttachHeads;
begin
repeat;
Check;
Mouse(570,214,22,25,True);
Mouse(611,213,27,29,True);
wait(100+random(200));
until((findcolor(x,y,65535,611,212,637,239)=False) );
Writeln('Attached All Arrowheads to Headless Arrows...');
end;
procedure FindHickton;
begin
//FixBrightness;
failsafe := 0;
gametab(random(14));
gametab(4);
makecompass('n');
Check;
HicktonColor[0]:=4407296;
HicktonColor[1]:=1812960;
HicktonColor[2]:=5723688;
HicktonColor[3]:=4356382;
HicktonColor[4]:=6917815;
Writeln('Finding Hickton...');
repeat
i := -1;
repeat
i := (i+1);
if (i = 5)
then begin
i:=0;
failsafe:=(failsafe+1);
end else
findcolor(x,y,HicktonColor[i],100,35,455,305);
if (failsafe = 10)
then begin
findsymbol(x,y,'Archery Shop');
mouse(x,y,1,1,True);
failsafe := 0;
end else
wait(200);
until(findcolor(x,y,HicktonColor[i],100,35,455,305)=True);
movemousesmoothex(x,y,15,15,15,30,15);
mouse(x,y,1,1,False);
mouse(x,y+34,40,14,True);
Flag;
wait(500+random(500));
until(GetColor(501,321)=921873);
Writeln('Found em');
end;
procedure Login;
begin
Writeln('Logging In...');
wait(200+random(250));
Mouse(390,272,140,35,True);
Mouse(271,250,215,10,True);
TypeSend(User+chr(13)+PW);
Mouse(229,303,141,33,True);
repeat
wait(250);
until(GetColor(410,323)=2241151);
Mouse(270,290,220,90,True);
end;
Procedure AddPic;
var
Picture : integer;
Canvas : TCanvas;
begin
Picture := LoadBitmap(ScriptPath + 'ArrowFletcherFormBG.bmp')
Canvas:= GetBitmapCanvas(Picture);
CopyCanvas(Canvas, frmDesign.Canvas, 0, 0, 416, 164, 0, 0, 416, 164);
end;
Procedure FormPaintBG(Sender : TObject);
begin
AddPic;
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 Atype1Click(sender: TObject);
begin
Arrowcolor := 1913924;
asx:=362;
asy:=116;
Writeln('Making Bronze Arrows');
end;
procedure Atype2Click(sender: TObject);
begin
Arrowcolor := 4473928;
asx:=409;
asy:=116;
Writeln('Making Iron Arrows');
end;
procedure Atype3Click(sender: TObject);
begin
Arrowcolor := 6908272;
asx:=80;
asy:=162;
Writeln('Making Steel Arrows');
end;
procedure Atype4Click(sender: TObject);
begin
Arrowcolor := 5453623;
asx:=127;
asy:=162;
Writeln('Making Mithril Arrows');
end;
procedure Atype5Click(sender: TObject);
begin
Arrowcolor := 4083006;
asx:=174;
asy:=162;
Writeln('Making Adamantine Arrows');
end;
procedure Atype6Click(sender: TObject);
begin
Arrowcolor := 6445378;
asx:=221;
asy:=162;
Writeln('Making Runite Arrows');
end;
procedure ClickButton(sender: TObject);
begin
User := Userbox.text
PW := Edit1.text
frmDesign.Caption:= frmDesign.Caption + '.';
frmDesign.ModalResult:= mrOk;
end;
procedure ButtonClick(sender: TObject);
begin
GetMousePos(x, y);
Atype.Popup(x, y);
end;
Procedure InitForm;
begin
frmDesign := CreateForm;
frmDesign.Left := 250;
frmDesign.Top := 114;
frmDesign.Width := 422;
frmDesign.Height := 188;
frmDesign.Caption := 'frmDesign';
frmDesign.Color := clBtnFace;
frmDesign.Font.Color := clWindowText;
frmDesign.Font.Height := -11;
frmDesign.Font.Name := 'MS Sans Serif';
frmDesign.Font.Style := [];
frmDesign.Visible := False;
frmDesign.PixelsPerInch := 96;
frmDesign.ONPAINT := @FormPaintBG;
Userbox := TEdit.Create(frmDesign);
Userbox.Parent := frmDesign;
Userbox.Left := 200;
Userbox.Top := 3;
Userbox.Width := 207;
Userbox.Height := 15;
Userbox.Font.Color := clWindowText;
Userbox.Font.Height := -12;
Userbox.Font.Name := 'Arial';
Userbox.Font.Style := [];
Userbox.ParentFont := False;
Userbox.TabOrder := 8;
Userbox.Text := '(Enter Username Here)';
Edit1 := TEdit.Create(frmDesign);
Edit1.Parent := frmDesign;
Edit1.Left := 200;
Edit1.Top := 27;
Edit1.Width := 207;
Edit1.Height := 15;
Edit1.Font.Color := clWindowText;
Edit1.Font.Height := -12;
Edit1.Font.Name := 'Arial';
Edit1.Font.Style := [];
Edit1.ParentFont := False;
Edit1.TabOrder := 9;
Edit1.Text := '(Enter Password Here)';
Button1 := TButton.Create(frmDesign);
Button1.Parent := frmDesign;
Button1.Left := 200;
Button1.Top := 57;
Button1.Width := 207;
Button1.Height := 40;
Button1.Caption := 'Click Here to Start!';
Button1.Font.Color := clWindowText;
Button1.Font.Height := -19;
Button1.Font.Name := 'Arial';
Button1.Font.Style := [];
Button1.ParentFont := False;
Button1.TabOrder := 10;
btn := TButton.Create(frmDesign);
btn.Parent := frmDesign;
btn.Caption := 'Click to choose your arrow type.';
btn.Left := 200;
btn.Top := 97;
btn.Width := 207;
btn.Height := 40;
btn.TabOrder := 8;
btn.OnClick := @ButtonClick;
Atype := TPopupMenu.Create(frmDesign);
AtypeMenu1 := TMenuItem.Create(frmDesign);
AtypeMenu1.Caption := 'Bronze';
AtypeMenu1.OnClick := @Atype1Click;
Atype.Items.Add(AtypeMenu1);
AtypeMenu2 := TMenuItem.Create(frmDesign);
AtypeMenu2.Caption := 'Iron';
AtypeMenu2.OnClick := @Atype2Click;
Atype.Items.Add(AtypeMenu2);
AtypeMenu3 := TMenuItem.Create(frmDesign);
AtypeMenu3.Caption := 'Steel';
AtypeMenu3.OnClick := @Atype3Click;
Atype.Items.Add(AtypeMenu3);
AtypeMenu4 := TMenuItem.Create(frmDesign);
AtypeMenu4.Caption := 'Mithril';
AtypeMenu4.OnClick := @Atype4Click;
Atype.Items.Add(AtypeMenu4);
AtypeMenu5 := TMenuItem.Create(frmDesign);
AtypeMenu5.Caption := 'Addy';
AtypeMenu5.OnClick := @Atype5Click;
Atype.Items.Add(AtypeMenu5);
AtypeMenu6 := TMenuItem.Create(frmDesign);
AtypeMenu6.Caption := 'Runite';
AtypeMenu6.OnClick := @Atype6Click;
Atype.Items.Add(AtypeMenu6);
Button1.Onclick:=@clickbutton;
end;
begin
SafeInitForm;
SafeShowFormModal;
ClearDebug;
num:=0;
row:=1;
column:=1;
SetUpSRL;
repeat
num := (num+1);
NextWorld;
Login;
FindHickton;
wait(200+random(300));
BuyHeads;
AttachHeads;
writeln('All done here, logging out & switching worlds...');
Logout;
until(num=57);
end.