program UltimateFletcher; {.include Squig.txt} //By Driger1592 //My first script yay //Have knife in inventory //Have logs in first bank slot //By using this script you agree to not kill me if your account is banned //helix is leet, kthx {<- helix put this in, second time he helped me.} //helix put the b0wtype thing in for me because my way had issues =) //I put the b0wtype2 though =) //Also, thanks goes to PhiloDespotos for introducing me to bitmap masks! {SETUP LINE 36 - 40} {Versions} {V1.0 - V2.2 are my original shaft fletcher.} {V1.0 - All coords and it didn't work very well.} {V1.1 - Up to scripting standards.} {V1.2 - Would stop running if you didn't have any logs in first bank slot or in your inventory when you went to fletch them. Also added an auto-login. Very laggy version.} {V1.3 - Fixed the lag and got rid of a few minor bugs.} {V1.4 - Made it log out and go into an infinite loop of nothingness if you run out of logs.} {V2.0 - Used many more of Squig's procedures in place of mine. Wouldn't repeat.} {V2.1 - Fixed bug where it wouldn't repeat.} {V2.2 - You could finally start the script while logged in!} {V3.0 - You could now fletch longs and shorts as well.} {V4.0 - You can now use any type of log! I also updated the CheckFinished function to work with all the logs. UNRELEASED.} {V4.1 - It is now more efficient and running great =)} {NEXT VERSION: Stringing bows, possible flax picker functionality added.} Var x,y,z,UpChars,maskX: integer; const Username = ''; // put username between the apostrophies Password = ''; // put password between the apostrophies b0wtype = 1; // put 1 = shaft, 2 = short, 3 = long (this is for reg logs only.) b0wtype2 = 2; // put 1 = short, 2 = long (this is for other logs.) LogType = 3; // put 1 = log, 2 = oak, 3 = willow, 4 = maple, 5 = yew, 6 = magic LoggedInC = 46336; LogC = 3891839; ShaftC = 603480; ShortC = 874626; LongC = 870508; OakC = 4354194; WillowC = 2051414; MapleC = 937586; YewC = 608866; MagicC = 3038309; OakSC = 1210000; OakLC = 940911; WilSC = 3772826; WilLC = 2317666; MapleSC = 7370636; MapleLC = 7041414; YewSC = 1479335; YewLC = 942447; MagicSC = 5988889; MagicLC = 4541202; Function CheckWelcome : Boolean; begin; result:=false; If(GetColor(264,91)=65535)then result:=true; end; Function CheckLogin : Boolean; begin; result:=false; If(FindColorTolerance(x,y,LoggedInC,582,178,586,195,3))then result:=true; end; Procedure OpenBankLoggedIn; begin; If(z=0)then begin; OpenBank; z:=(z+1) end; end; Procedure LoginPro; begin; If(CheckLogin=false)then begin; z:=0 LogIn; wait(200+random(101)) CheckIntro; repeat wait(100); until(CheckWelcome=false) end; end; Procedure OpenBank1; begin If(z=0)then begin; OpenBank; z:=(z+1) end; end; Procedure GetLogs; begin; If(LogType=1)then If(FindColorTolerance(x,y,LogC,76,65,114,91,10))then begin; wait(500+random(100)); Withdraw(1,1,0); wait(550+random(100)); CloseBank; end; If(LogType=2)then If(FindColorTolerance(x,y,OakC,76,65,114,91,10))then begin; wait(500+random(100)); Withdraw(1,1,0); wait(550+random(100)); CloseBank; end; If(LogType=3)then If(FindColorTolerance(x,y,WillowC,76,65,114,91,10))then begin; wait(500+random(100)); Withdraw(1,1,0); wait(550+random(100)); CloseBank; end; If(LogType=4)then If(FindColorTolerance(x,y,MapleC,76,65,114,91,10))then begin; wait(500+random(100)); Withdraw(1,1,0); wait(550+random(100)); CloseBank; end; If(LogType=5)then If(FindColorTolerance(x,y,YewC,76,65,114,91,10))then begin; wait(500+random(100)); Withdraw(1,1,0); wait(550+random(100)); CloseBank; end; If(LogType=6)then If(FindColorTolerance(x,y,MagicC,76,65,114,91,10))then begin; wait(500+random(100)); Withdraw(1,1,0); wait(550+random(100)); CloseBank; end; end; Procedure FletchShafts; begin; If(b0wtype=1)then begin; wait(500); If(FindColorTolerance(x,y,LogC,606,214,647,243,10))then begin; repeat wait(100); until(istextat2(185,36,'The Bank',100)=false) UseItem(1,1); wait(750+random(10)); UseItem(1,2); repeat wait(100); until(FindColorTolerance(x,y,128,153,361,361,376,10)) MouseC(140,431+random(2),2); wait(1000+random(10)); FindBitmapMaskTolerance(MaskX,x,y,c1,c2,c3,c4,10,50); wait(100+random(100)); MouseC(x+4+random(2),y+4+random(2),1); repeat wait(100); until(FindColorTolerance(x,y,128,153,361,361,376,10)=false) SendKeysHuman('27'+chr(13)); wait(49400+random(77)); end; end; end; Procedure FletchShorts1; begin; If(b0wtype=2)then begin; wait(500); If(FindColorTolerance(x,y,LogC,606,214,647,243,10))then begin; repeat wait(100); until(istextat2(185,36,'The Bank',100)=false) UseItem(1,1); wait(750+random(10)); UseItem(1,2); repeat wait(100); until(FindColorTolerance(x,y,128,153,361,361,376,10)) MouseC(260,410+random(2),2); wait(1000+random(10)); FindBitmapMaskTolerance(MaskX,x,y,c1,c2,c3,c4,10,50); wait(100+random(100)); MouseC(x+4+random(2),y+4+random(2),1); repeat wait(100); until(FindColorTolerance(x,y,128,153,361,361,376,10)=false) SendKeysHuman('27'+chr(13)); wait(49400+random(77)); end; end; end; Procedure FletchShorts2; begin; If(b0wtype2=1)then begin; wait(500); If(FindColorTolerance(x,y,OakC,606,214,647,243,10)) or (FindColorTolerance(x,y,WillowC,606,214,647,243,10)) or (FindColorTolerance(x,y,MapleC,606,214,647,243,10)) or (FindColorTolerance(x,y,YewC,606,214,647,243,10)) or (FindColorTolerance(x,y,MagicC,606,214,647,243,10))then begin; repeat wait(100); until(istextat2(185,36,'The Bank',100)=false) UseItem(1,1); wait(750+random(10)); UseItem(1,2); repeat wait(100); until(FindColorTolerance(x,y,128,153,361,361,376,10)) MouseC(143,412+random(2),2); wait(1000+random(10)); FindBitmapMaskTolerance(MaskX,x,y,c1,c2,c3,c4,10,50); wait(100+random(100)); MouseC(x+4+random(2),y+4+random(2),1); repeat wait(100); until(FindColorTolerance(x,y,128,153,361,361,376,10)=false) SendKeysHuman('27'+chr(13)); wait(49400+random(77)); end; end; end; Procedure FletchLongs1; begin; If(b0wtype=3)then begin; wait(500); If(FindColorTolerance(x,y,LogC,606,214,647,243,10))then begin; repeat wait(100); until(istextat2(185,36,'The Bank',100)=false) UseItem(1,1); wait(750+random(10)); UseItem(1,2); repeat wait(100); until(FindColorTolerance(x,y,128,153,361,361,376,10)) MouseC(423,417+random(2),2); wait(1000+random(10)); FindBitmapMaskTolerance(MaskX,x,y,c1,c2,c3,c4,10,50); wait(100+random(100)); MouseC(x+4+random(2),y+4+random(2),1); repeat wait(100); until(FindColorTolerance(x,y,128,153,361,361,376,10)=false) SendKeysHuman('27'+chr(13)); wait(49400+random(150)); end; end; end; Procedure FletchLongs2; begin; If(b0wtype2=2)then begin; wait(500); If(FindColorTolerance(x,y,OakC,606,214,647,243,10)) or (FindColorTolerance(x,y,WillowC,606,214,647,243,10)) or (FindColorTolerance(x,y,MapleC,606,214,647,243,10)) or (FindColorTolerance(x,y,YewC,606,214,647,243,10)) or (FindColorTolerance(x,y,MagicC,606,214,647,243,10))then begin; repeat wait(100); until(istextat2(185,36,'The Bank',100)=false) UseItem(1,1); wait(750+random(10)); UseItem(1,2); repeat wait(100); until(FindColorTolerance(x,y,128,153,361,361,376,10)) MouseC(373,415+random(2),2); wait(1000+random(100)); FindBitmapMaskTolerance(MaskX,x,y,c1,c2,c3,c4,10,100); wait(100+random(100)); MouseC(x+4+random(2),y+4+random(2),1); repeat wait(100); until(FindColorTolerance(x,y,128,153,361,361,376,10)=false) SendKeysHuman('27'+chr(13)); wait(49400+random(150)); end; end; end; Procedure DepositShafts; begin; If(b0wtype=1)then begin; If(FindColorTolerance(x,y,ShaftC,606,214,647,243,10))then begin;//Into Bank and Deposit Shafts OpenBank; repeat wait(100); until(istextat2(185,36,'The Bank',100)) Deposit(1,2,0); repeat wait(100); until(FindColorTolerance(x,y,ShaftC,606,214,647,243,10)=false) end; end; end; Procedure DepositShorts1; begin; If(b0wtype=2)then begin; If(FindColorTolerance(x,y,ShortC,606,214,647,243,10))then begin; OpenBank; repeat wait(100); until(istextat2(185,36,'The Bank',100)) Deposit(1,2,0); repeat wait(100); until(FindColorTolerance(x,y,ShortC,606,214,647,243,10)=false) end; end; end; Procedure DepositShorts2; begin; If(b0wtype2=1)then begin; If(LogType=2)then If(FindColorTolerance(x,y,OakSC,606,214,647,243,10))then begin; OpenBank; repeat wait(100); until(istextat2(185,36,'The Bank',100)) Deposit(1,2,0); repeat wait(100); until(FindColorTolerance(x,y,OakSC,606,214,647,243,10)=false) end; If(LogType=3)then If(FindColorTolerance(x,y,WilSC,606,214,647,243,10))then begin; OpenBank; repeat wait(100); until(istextat2(185,36,'The Bank',100)) Deposit(1,2,0); repeat wait(100); until(FindColorTolerance(x,y,WilSC,606,214,647,243,10)=false) end; If(LogType=4)then If(FindColorTolerance(x,y,MapleSC,606,214,647,243,10))then begin; OpenBank; repeat wait(100); until(istextat2(185,36,'The Bank',100)) Deposit(1,2,0); repeat wait(100); until(FindColorTolerance(x,y,MapleSC,606,214,647,243,10)=false) end; If(LogType=5)then If(FindColorTolerance(x,y,YewSC,606,214,647,243,10))then begin; OpenBank; repeat wait(100); until(istextat2(185,36,'The Bank',100)) Deposit(1,2,0); repeat wait(100); until(FindColorTolerance(x,y,YewSC,606,214,647,243,10)=false) end; If(LogType=6)then If(FindColorTolerance(x,y,MagicSC,606,214,647,243,10))then begin; OpenBank; repeat wait(100); until(istextat2(185,36,'The Bank',100)) Deposit(1,2,0); repeat wait(100); until(FindColorTolerance(x,y,MagicSC,606,214,647,243,10)=false) end; end; end; Procedure DepositLongs1; begin; If(b0wtype=3)then begin; If(FindColorTolerance(x,y,LongC,606,214,647,243,10))then begin; OpenBank; repeat wait(100); until(istextat2(185,36,'The Bank',100)) Deposit(1,2,0); repeat wait(100); until(FindColorTolerance(x,y,LongC,606,214,647,243,10)=false) end; end; end; Procedure DepositLongs2; begin; If(b0wtype2=2)then begin; If(LogType=2)then If(FindColorTolerance(x,y,OakLC,606,214,647,243,10))then begin; OpenBank; repeat wait(100); until(istextat2(185,36,'The Bank',100)) Deposit(1,2,0); repeat wait(100); until(FindColorTolerance(x,y,OakLC,606,214,647,243,10)=false) end; If(LogType=3)then If(FindColorTolerance(x,y,WilLC,606,214,647,243,10))then begin; OpenBank; repeat wait(100); until(istextat2(185,36,'The Bank',100)) Deposit(1,2,0); repeat wait(100); until(FindColorTolerance(x,y,WilLC,606,214,647,243,10)=false) end; If(LogType=4)then If(FindColorTolerance(x,y,MapleLC,606,214,647,243,10))then begin; OpenBank; repeat wait(100); until(istextat2(185,36,'The Bank',100)) Deposit(1,2,0); repeat wait(100); until(FindColorTolerance(x,y,MapleLC,606,214,647,243,10)=false) end; If(LogType=5)then If(FindColorTolerance(x,y,YewLC,606,214,647,243,10))then begin; OpenBank; repeat wait(100); until(istextat2(185,36,'The Bank',100)) Deposit(1,2,0); repeat wait(100); until(FindColorTolerance(x,y,YewLC,606,214,647,243,10)=false) end; If(LogType=6)then If(FindColorTolerance(x,y,MagicLC,606,214,647,243,10))then begin; OpenBank; repeat wait(100); until(istextat2(185,36,'The Bank',100)) Deposit(1,2,0); repeat wait(100); until(FindColorTolerance(x,y,MagicLC,606,214,647,243,10)=false) end; end; end; Procedure ShaftPro; begin; If(b0wtype=1)then begin; FletchShafts; DepositShafts; end; end; Procedure ShortPro1; begin; If(b0wtype=2)then begin; FletchShorts1; DepositShorts1; end; end; Procedure ShortPro2; begin; If(b0wtype2=1)then begin; FletchShorts2; DepositShorts2; end; end; Procedure LongPro1; begin; If(b0wtype=3)then begin; FletchLongs1; DepositLongs1; end; end; Procedure LongPro2; begin; If(b0wtype2=2)then begin; FletchLongs2; DepositLongs2; end; end; Procedure FletchPro; begin; ShaftPro; ShortPro1; LongPro1; ShortPro2; LongPro2; end; Function CheckFinished : boolean; begin; result:=false; If(LogType=1)then If(FindColorTolerance(x,y,LogC,76,65,114,91,40)=false)then result:=true; If(LogType=2)then If(FindColorTolerance(x,y,OakC,76,65,114,91,40)=false)then result:=true; If(LogType=3)then If(FindColorTolerance(x,y,WillowC,76,65,114,91,40)=false)then result:=true; If(LogType=4)then If(FindColorTolerance(x,y,MapleC,76,65,114,91,40)=false)then result:=true; If(LogType=5)then If(FindColorTolerance(x,y,YewC,76,65,114,91,40)=false)then result:=true; If(LogType=6)then If(FindColorTolerance(x,y,MagicC,76,65,114,91,40)=false)then result:=true; end; Procedure FinishedAndLogout; begin; If(CheckFinished=true)then begin; CloseBank; logout; Status('You have finished, and have logged out!'); Writeln('You`ve logged out because there are no more logs to fletch!'); WorkedFor; repeat wait(100) until(false) end; end; begin SetupSquig; user:=Username pass:=Password Z:=0 UpChars := LoadChars2(AppPath+'CharsRS22\'); maskX := CreateBitmapMaskFromText('Make X', upChars); Repeat CheckLogin; If(CheckLogin=true)then OpenBankLoggedIn; LoginPro; OpenBank1; GetLogs; FletchPro; CheckFinished; FinishedAndLogout; Until(false) end.