{========================================================================] [ Stupid3ooo's Scripting and ] [ Random Event Protection Include II ] [ version: 1.8 ] [========================================================================] | This is must be put in the same folder as the script it is included | | with. This is mainly used for my own functionality and use, but feel | | free to use it if you want. Be sure to check for updates on this and | | other scripts by Stupid3ooo. | [=========================================================================] [ *Be sure to open SSI2.txt for more options. ] [ *For general SCAR help go to: ] | http://www.kaitnieks.com/files/SCARGUIDE/SCARGUIDE.htm ] [ Thanks to, RS Cheating community ] [ *PLEASE POST ANY BUGS/HELP IN THE FORUMS OR E-MAIL ] [ RSTradeMonkey@hotmail.com, or Stupid3ooo@gmail.com ] [ If you like pwease donate to me :) at: ] [ http://www.stupid3ooo.co.nr ] [=========================================================================} const //=//===========================Setup================================\\=\\ PermUser='';//Sets username for all Stupid3ooo scripts. PermPass='';//Sets password for all Stupid3ooo scripts. PermScarScape=false;//Sets Scarscape for all Stupid3ooo scripts. smooth=true;//If you want human-like mouse movements. movespeed= 30; // 1 - 30 : slow - fast movewait= 50;//Wait in ms after the mouse has moved. movewaitran= 50;//Random amount to wait after the mouse has moved. clicktiming= 100;//Wait in ms after the mouse has clicked. clicktimingran= 100;//Random amount to wait after the mouse has clicked. TypeSendTime= 50;//Wait between each letter when typing. TypeSendRan= 50;//Random amount to wait between each letter when typing. r= 2;//How random the mouse clicks are 0-3 are best. MaskName= 'winamp';//Name you want scar to be disguised as. CheckHpFirst= true;//If you want the script to look at the hp and see that it's been lowered before it runs away from a fight. GasTolerance= 15;//Tolerance to find gas color. PickUpItems= true;//If you want to pick up random items after losing a pick to try to find it. Debug=false;//If set to true it will show messages and windows that are used for debugging purposes. UsePivGas=false;//If you want to use piv's GasCheck(x,y); in all instances my FindGas(x,y); are used. SymbolAccuracy= 0.5;//How accurate it must be, in %, to find symbols or icons on the minimap. LoginAfterMod= 15;//How many minutes to wait to log back in after the script sees a mod(0 ends the script). LogTimeOut= true;//If you want to let Runescape timeout instead of actually logging out for anit-ban. KillScriptTime= 0;//Used in the preset AntiBan; procedure to kill the script after chosen hours, leave as 0 to not kill the script. Screenshots= false;//If you want the script to save screenshots of random events. SolveForester= false;//If you want the scrip to atempt to solve the forester, false if you want it to log out. LampChoice= 'hitpoints';//What stat you want to choose for the FindNormalRandoms procedure when solving a lamp. // *To set your own chat phrases press ctrl+f and type in: RandomChat; then replace everything then phrases in ''. //=\\================================================================//=\\ var x,y,s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,logs,attaches,lamps,fights,talks,LoginTry, lamp,PickAxe,PickAxeSteel,hc1,hc2, hc3,hc4,hc5,PickHandle,PickHead,Ore, orecolor1,orecolor2,orecolor3,orecolor, GasColor,UpChars,ChatChars,StatChars, CWindow,LogOutMark,RandomChatMark,RotateMark,KillScriptMark,LeaveScreenMark, bmpLeaveTheArea,bmpFreakyForester,bmpPheasantMeat,Frog,FrogSpot,Frogs, Foresters,Doctors,bmpNet,bmpCage,bmpRod,bmpFlyRod,bmpHarpoon, FishingEquipmentColor,AxeHeadColor,Certers:integer; Username,Password,SetCamera,FishingEquipmentName:string; ST:LongInt; ScarScape,LogsOut,Chats,Rotates:Boolean; //============================================================================\\ //===========Taken from Library (C)2004 Alex aka PPLSUQBAWLZ==================\\ //============================================================================\\ // /////////////////////////// // // Moves the mouse. // // /////////////////////////// // Procedure MMouse(mousex,mousey,ranx,rany:integer); var randx, randy:integer; begin randx:=mousex+random(ranx); randy:=mousey+random(rany); if(smooth)then MoveMouseSmoothEx(randx+1,randy, 2, 4, movespeed, 20, 10) else MoveMouse(randx,randy); sleep(movewait+random(movewaitran)); end; // /////////////////////////// // // Moves then clicks mouse. // // /////////////////////////// // Procedure Mouse(mousex,mousey,ranx,rany:integer; left:boolean); var a,b,c:integer; begin if(smooth)then begin MMouse(mousex,mousey,ranx,rany); GetMousePos(b,c); HoldMouse(b+1,c,left); repeat wait(10+random(40)); a:=a+1; until(a>4); GetMousePos(b,c); ReleaseMouse(b,c,left); end; if(not smooth)then begin MMouse(mousex,mousey,ranx,rany); GetMousePos(b,c); clickmouse(b,c,left); end; wait(clicktiming+random(clicktimingran)); end; // /////////////////////////// // // Waits while flag exists. // // /////////////////////////// // Procedure Flag; var flagimage,timeout:integer; begin flagimage := BitmapFromString(2, 2,'FF00005D3311C656045D3311'); timeout:=0 repeat timeout:=timeout+1; wait(250); until(not findbitmapin( flagimage, x, y, 570, 5, 725, 162)) or (timeout > 120); freebitmap(flagimage); end; // /////////////////////////// // // T/F depending on flag exist.// // /////////////////////////// // Function FlagPresent:boolean; var flagimage:integer; begin flagimage := BitmapFromString(2, 2,'FF00005D3311C656045D3311'); if(findbitmapin( flagimage, x, y, 570, 5, 725, 162))then result:=true; freebitmap(flagimage); end; // /////////////////////////// // // Switches between tabs. // // /////////////////////////// // procedure GameTab(tabnumber:Integer); begin case tabnumber of 1:if(GetColor(559,179)=5531511)then Mouse(559,186,5,5,true); 2:if(GetColor(591,176)=5531511)then Mouse(585,186,5,5,true); 3:if(GetColor(618,176)=5531511)then Mouse(614,186,5,5,true); 4:if(GetColor(636,174)=5531511)then Mouse(650,186,5,5,true); 5:if(GetColor(682,174)=5531511)then Mouse(683,186,5,5,true); 6:if(GetColor(683,175)=5531511)then Mouse(711,186,5,5,true); 7:if(GetColor(734,177)=5531511)then Mouse(738,186,5,5,true); 8:if(GetColor(705,495)=5531511)then Mouse(710,480,5,5,true); end; end; // /////////////////////////// // // Sends text human-like. // // /////////////////////////// // Procedure TypeSend(text:string); var LoadNumber:Integer; begin LoadNumber:=1; repeat SendKeysSilent(StrGet(Text, loadnumber)); LoadNumber:=LoadNumber+1; Wait(TypeSendTime+random(TypeSendRan)); until(LoadNumber>Length(text)); end; Procedure DisguiseScar(disguise:string); var application:tapplication; Self: TForm; begin Application:= GetApplication; Application.Title:= disguise; Self:= GetSelf; Self.Caption:= disguise; end; // /////////////////////////// // // Counts your inventory. // // /////////////////////////// // function InventoryCount:integer; var used,i,e:integer; begin e:=0; i:=0; used:=0; GameTab(4); while(i < 6) do begin if (i = 5) and (e < 8) then begin i:= 0; e:= e + 1; end; if (FindColor(x,y,65536,(571+47*i),(215+36*e),(601+47*i),(245+36*e)))then used:=used+1; i:= i + 1; end; result:=used; end; //============================================================================\\ //===========================SSI Procedures===================================\\ //============================================================================\\ procedure SetRun(run:Boolean);//From Si.scar begin GameTab(8); case run of True: if(GetColor(640,275)=5334129)then Mouse(620,265,5,5,true); False:if(GetColor(581,250)=5334129)then Mouse(580,265,5,5,true); end; end; procedure ChatsOff;//from Si.scar var x, y, setx, sety, i: Integer; begin for i:=0 to 2 do begin setx:= 55 + (i*135); sety:= 490; while(FindColor(x,y,16776960,setx-10,sety-10,setx+10,sety+10))do Mouse(x,y,5,5,true) while(FindColor(x,y,65280,setx-10,sety-10,setx+10,sety+10))do Mouse(x,y,5,5,true) while(FindColor(x,y,65535,setx-10,sety-10,setx+10,sety+10))do Mouse(x,y,5,5,true) end; end; function BankScreen:Boolean;//From Si.scar begin result:=IsTextAtEx(185,34,'The Bank of',30,UpChars,True,False,0,0,-1) end; function LoggedIn:boolean; begin if(GetColor(636,477)=16711423)then result:=true; end; procedure Logout; var c:integer; begin if(LogTimeOut)then begin Wait(90000); end else if(LoggedIn)then begin Mouse(645,485,3,3,true); Wait(100+random(100)); Mouse(635,375,4,4,true); while(LoggedIn)and(c<10)do begin c:=c+1; Wait(500+random(100)); end; end; end; function Option(s:string):boolean; begin result:=false; if(IsTextAt2(9,9,s,100))then result:=true; end; function Option2(s:string):boolean; var tempx,tempy:integer; begin result:=false; if(IsTextInAreaEx(0,0,515,25,tempx,tempy,s,100,UpChars,True,False,0,1,-1))then result:=true; end; function GetOption:string; begin result:=GetTextAtEx(8,7,130,UpChars,True,False,0,1,-1,40,False,tr_AlphaNumericChars); end; function FindText(txt:string;font,xs,ys,xe,ye:integer):boolean; var s:integer; begin s:=CreateBitmapMaskFromText(txt,font); if(FindBitmapMaskTolerance(s,x,y,xs,ys,xe,ye,10,85))then result:=true; FreeBitmap(s); end; function ClickText(txt:string;font,xs,ys,xe,ye:integer;left:boolean):boolean; var s:integer; begin s:=CreateBitmapMaskFromText(txt,font); if(FindBitmapMaskTolerance(s,x,y,xs,ys,xe,ye,10,85))then begin Mouse(x+10,y+3,r,r,left); Result:=true; end; FreeBitmap(s); end; function FindTextFont(txt:string;font:integer):boolean; var s:integer; begin s:=CreateBitmapMaskFromText(txt,font); if(FindBitmapMaskTolerance(s,x,y,0,0,760,500,10,85))then result:=true; FreeBitmap(s); end; function ClickTextFont(txt:string;font:integer;left:boolean):boolean; begin if(FindTextFont(txt,font))then begin Mouse(x+10,y+3,r,r,left); result:=true; end; end; function FindMSText(txt:string):boolean;//Bold(2) begin if(FindBitmapMaskTolerance(CreateBitmapMaskFromText(txt,UpChars),x,y,3,3,515,338,10,85))then result:=true; end; function ClickMSText(txt:string;left:boolean):boolean;//Bold(2) begin if(FindMSText(txt))then begin Mouse(x+10,y+3,r,r,true); result:=true; end; end; function FindChatText(txt:string):boolean;//Chat(1) begin if(FindBitmapMaskTolerance(CreateBitmapMaskFromText(txt,ChatChars),x,y,9,348,479,433,10,85))then result:=true; end; function NewChatMsg(txt:string):boolean; begin if(FindBitmapMaskTolerance(CreateBitmapMaskFromText(txt,ChatChars),x,y,17,410,495,452,10,85))then result:=true; end; function GetNewChatMsg:string; begin result:=GetTextAtEx(21,415,0,ChatChars,False,True,0,0,-1,70,False,tr_NormalChars); end; function FindInventoryText(txt:string):boolean;////Small(3) begin if(FindBitmapMaskTolerance(CreateBitmapMaskFromText(txt,StatChars),x,y,553,206,742,465,10,85))then result:=true; end; function FindMMColor(color:integer):boolean; begin if(FindColor(x,y,color,573,8,723,158))then result:=true; end; function FindMMColorTol(color,tol:integer):boolean; begin if(FindColorTolerance(x,y,color,573,8,723,158,tol))then result:=true; end; procedure ClickMMColor(color:integer); begin if(FindColor(x,y,color,573,8,723,158))then Mouse(x,y,r,r,true); end; procedure ClickMMColorTol(color,tol:integer); begin if(FindColorTolerance(x,y,color,573,8,723,158,tol))then Mouse(x,y,r,r,true); end; function FindMSColor(color:integer):boolean; begin if(FindColor(x,y,color,3,3,515,338))then result:=true; end; function FindMSColorTol(color,tol:integer):boolean; begin if(FindColorTolerance(x,y,color,3,3,515,338,tol))then result:=true; end; procedure ClickMSColor(color:integer;left:boolean); begin if(FindColor(x,y,color,3,3,515,338))then Mouse(x,y,r,r,left); end; procedure ClickMSColorTol(color,tol:integer;left:boolean); begin if(FindColorTolerance(x,y,color,3,3,515,338,tol))then Mouse(x,y,r,r,left); end; function FindMSDtm(dtm:integer):boolean; begin if(FindDtm(dtm,x,y,3,3,515,338))then result:=true; end; function FindMMDtm(dtm:integer):boolean; begin if(FindDtm(dtm,x,y,573,8,723,158))then result:=true; end; procedure MouseFindFlag(ax,ay,xmod,ymod:integer); var xx,yy:integer; begin if(not(FlagPresent))then begin xx:=ax; yy:=ay; repeat xx:=xx+xmod; yy:=yy+ymod; Mouse(xx,yy,r,r,true); until(FlagPresent)or(xx<570)or(xx>725)or(yy<5)or(yy>160) end; end; procedure WalkAsideColorTol(Color:integer;MoveDir,HugSide:string;Tol:integer);//Useful for mapwalking along rivers and mountains var c,xs,xe,ys,ye,xm,ym:integer; begin xs:=573; ys:=8; xe:=723; ye:=158; while(c<150)do begin c:=c+5; if(Lowercase(MoveDir)='n')or(Lowercase(MoveDir)='north')then begin ye:=ye-5; ym:=3; end; if(Lowercase(MoveDir)='e')or(Lowercase(MoveDir)='east')then begin xs:=xs+5; xm:=-3; end; if(Lowercase(MoveDir)='s')or(Lowercase(MoveDir)='south')then begin ys:=ys+5; ym:=-3; end; if(Lowercase(MoveDir)='w')or(Lowercase(MoveDir)='west')then begin xe:=xe-5; xm:=3; end; if(not(FindColorTolerance(x,y,color,xs,ys,xe,ye,tol)))then begin if(Lowercase(MoveDir)='n')or(Lowercase(MoveDir)='north')then ye:=ye+10; if(Lowercase(MoveDir)='e')or(Lowercase(MoveDir)='east')then xs:=xs-10; if(Lowercase(MoveDir)='s')or(Lowercase(MoveDir)='south')then ys:=ys-10; if(Lowercase(MoveDir)='w')or(Lowercase(MoveDir)='west')then xe:=xe+10; break; end; end; c:=0; while(c<150)do begin c:=c+5; if(Lowercase(HugSide)='n')or(Lowercase(HugSide)='north')then ye:=ye-5; if(Lowercase(HugSide)='e')or(Lowercase(HugSide)='east')then xs:=xs+5; if(Lowercase(HugSide)='s')or(Lowercase(HugSide)='south')then ys:=ys+5; if(Lowercase(HugSide)='w')or(Lowercase(HugSide)='west')then xe:=xe-5; if(not(FindColorTolerance(x,y,color,xs,ys,xe,ye,tol)))then begin if(Lowercase(HugSide)='n')or(Lowercase(HugSide)='north')then MouseFindFlag(xs+xm*3,ys+ym*3,xm,3); if(Lowercase(HugSide)='e')or(Lowercase(HugSide)='east')then MouseFindFlag(xs+xm*3,ys+ym*3,-3,ym); if(Lowercase(HugSide)='s')or(Lowercase(HugSide)='south')then MouseFindFlag(xs+xm*3,ys+ym*3,xm,-3); if(Lowercase(HugSide)='w')or(Lowercase(HugSide)='west')then MouseFindFlag(xs-xm*3,ys+ym*3,xm+3,ym); break; end; end; end; procedure WalkAsideColor(Color:integer;MoveDir,HugSide:string);//Useful for mapwalking along rivers and mountains begin WalkAsideColorTol(Color,MoveDir,HugSide,0); end; function FindBitmapsProgressiveTol(bmp1,bmp2,bmp3,bmp4,bmp5,tolmax,step,xs,ys,xe,ye:integer):boolean; var c:integer; begin while(c0)then begin if(FindBitmapSpiralTolerance(bmp1,x,y,xs,ys,xe,ye,c))then begin result:=true; break; end; end; if(bmp2>0)then begin if(FindBitmapSpiralTolerance(bmp2,x,y,xs,ys,xe,ye,c))then begin result:=true; break; end; end; if(bmp3>0)then begin if(FindBitmapSpiralTolerance(bmp3,x,y,xs,ys,xe,ye,c))then begin result:=true; break; end; end; if(bmp4>0)then begin if(FindBitmapSpiralTolerance(bmp4,x,y,xs,ys,xe,ye,c))then begin result:=true; break; end; end; if(bmp5>0)then begin if(FindBitmapSpiralTolerance(bmp5,x,y,xs,ys,xe,ye,c))then begin result:=true; break; end; end; end; end; function GetSymbolColor(name:string):integer;//Thank you SCAR 2.0 for making this much easier, work in progress var Bitmap,Color,c:integer; acc:extended; begin if(lowercase(name)='bank')then begin Bitmap := BitmapFromString(15, 5, 'z78DA33B434B4343473B' + '100421364D2D9D2C9C9D4C4CDCDD5D1CCD0C2D5DCC5D00299ED04' + '8226C824B25E43B0998664990C213175116F32B2F9C824B2F9A4B' + 'A1997F9B842865493890F734C9301ACE46928'); Color:=6417151; end; if(lowercase(name)='mining spot')or(lowercase(name)='mining site')then begin Bitmap := BitmapFromString(15, 5, 'z78DA95D03B0EC430' + '0804D02B610C832931D9DCFF48894293C8DAD5464853F07905342' + '91A67A46FF43BA31914AE602183A9E5686799A64E3C04BA4CFA43' + '7E98439C770971257CB09F934B8E089F2FE43287A2F534166629A' + '1121D03DB5BB94C0B1D9D811E2DEF66ED94BCF6BFC97753A33BF3' + '7ABBCAEB9F0FD413672D'); Color:=4219541; end; if(lowercase(name)='transportation')then begin Bitmap := BitmapFromString(15, 5, 'z78DA33303534347074353' + '4B73032219E34763173348592A62E666E66A6C8B20660330D904C' + '86A841D6858BC454896C3EA6C9C498899FC465B291A3B193910B3' + '124A69910715C269317CEC866229B0C00B3496273'); Color:=2650848; end; if(lowercase(name)='magic shop')then begin Bitmap := BitmapFromString(15, 5, 'z78DA95D0510A80300806' + 'E02B9906B6C77F3AEF7FA4A0066DABC17A1111FD1469A74CC5C46' + '0D6C60875CEA17288D63CE08C771D02A09BA5CBA499DC99AD3CFA' + 'EB72041B97B9D9C83F6F2ECE69C3D71F46F9EE5C979D155AFDBAA' + '5BBFF312D915399C927AF756C82'); Color:=1714669; end; if(lowercase(name)='water source')or(lowercase(name)='water')then begin Bitmap := BitmapFromString(15, 5, 'z78DAA5CF410A80300C44' + 'D12B25B6A964E9907AFF2329CC42A5448A12F874111EA9A89C830' + 'A438C6DB646B7A51BF6C27A75F3C8F659D16BE665F68F7C37B121' + '3AF8162D2DE2FDF21999E628B3DFE4C7DF1339BB9CE601EA0F684' + '0'); Color:=14497281; end; if(lowercase(name)='furnace')then begin Bitmap := BitmapFromString(15, 5, 'z78DA333034004247472763' + '47130869E4686C6C64626266E46CE0E66A616666608C8B84A881A' + '8B770B434B6809A60608880044CB6B434333072B57033323084B1' + '07BDC934080D62485C26030023CF61C9'); Color:=222952; end; if(lowercase(name)='anvil')then begin Bitmap := BitmapFromString(15, 5, 'z78DA95CF510AC0300803D02B' + 'A59DE0F2D9F6FE771A2CFB10CAC4FE04117C443434D8E4C2EA4A8' + '7DFCE8B06FB369AF38C025E139B5C7194EA106F73B9D2991C187D' + '3773F92F2BE6A91CBFD05CE9FC00C9DB6164'); Color:=4012591; end; if(lowercase(name)='rare trees')or(lowercase(name)='tree')then begin Bitmap := BitmapFromString(15, 5, 'z78DA33303400424757270' + 'B4757086960686209128390E6F84833470B20696C618E6E020262' + '33D99C0C9238938976391269E16A69614192C96012EC6B2889C34' + 'CFC26639A0F516FE46CE80267BB9AB919B8426C413613393400AC' + '8C5FC9'); Color:=96513; end; if(lowercase(name)='fishing spot')or(lowercase(name)='fish')then begin Bitmap := BitmapFromString(15, 5, 'z78DA8DCE410E80300844D12B4D5BA' + '9BAA404EE7F2413675343AA6EFE82D217D061682636ACCCADA779' + '045B641F117987CDAFB84D2479D67257B28A0EFD90B9C9F9BB3FD' + 'FF02EC337F347B39977D83F37AFFEA2D76EDEA4543DE870B2922F' + 'BB6B6878'); Color:=16743189; end; FindDeformedBitmapToleranceIn(Bitmap,x,y,570,5,725,160,70,0,True,acc); if(acc>SymbolAccuracy)then begin repeat c:=c+5; if(FindColorTolerance(x,y,Color,x,y,x+15,y+5,c))then result:=GetColor(x,y); until(result>0)or(c>70); end; FreeBitmap(Bitmap); end; function FindSymbol(name:string):boolean; begin if(GetSymbolColor(Lowercase(name))>0)then Result:=true; end; procedure FindSymbolColorIfNeeded(SymbolName:string;TerminateIfNotFound:boolean;var Color:integer); begin if(Color=0)then begin Color:=GetSymbolColor(SymbolName); if(Color>0)then begin writeln(SymbolName+': '+inttostr(Color)); end else if(TerminateIfNotFound)then begin WriteLn('Could not find '+SymbolName+' color please restart the script and/or choose your own colors.'); TerminateScript; end; end; end; function ChooseOption(txt:string):boolean; var s,cancel,x1,y1,x2,y2,LeftCorner,RightCorner:integer; begin LeftCorner := BitmapFromString(4, 4, 'z78DA33753135313137C5' + '411A600064715CEA914500CACE13F0'); RightCorner := BitmapFromString(4, 4, 'z78DA33753135313137' + 'C5200D30002E35F8C501C9C013F0'); s:=CreateBitmapMaskFromText(txt,UpChars); cancel:=CreateBitmapMaskFromText('Cancel',UpChars); if(FindBitmap(LeftCorner,x1,y1))and(FindBitmap(RightCorner,x2,y2))then begin if(FindBitmapMaskTolerance(s,x,y,x1,y1,x2,502,10,85))then begin Result:=True; Mouse(x+10+random(5),y+3,7,3,true); end else if(FindBitmapMaskTolerance(cancel,x,y,x1,y1,x2,502,10,85))then Mouse(x+10+random(5),y+3,7,3,true); end; FreeBitmap(LeftCorner); FreeBitmap(RightCorner); FreeBitmap(s); FreeBitmap(cancel); end; function CountItemColor(color:integer):integer;//based of PPLSUQBAWLZ's InventoryCount var used,i,e:integer; begin e:=0; i:=0; used:=0; GameTab(4); while(i < 6) do begin if (i = 5) and (e < 8) then begin i:= 0; e:= e + 1; end; if(FindColor(x,y,color,(570+39*i),(214+35*e),(609+39*i),(249+35*e)))then used:=used+1; i:= i + 1; end; result:=used; end; function CountItemColorTol(color,tol:integer):integer;//based off PPLSUQBAWLZ's InventoryCount var used,i,e:integer; begin e:=0; i:=0; used:=0; GameTab(4); while(i < 6) do begin if (i = 5) and (e < 8) then begin i:= 0; e:= e + 1; end; if(FindColorTolerance(x,y,color,(570+39*i),(214+35*e),(609+39*i),(249+35*e),tol))then used:=used+1; i:= i + 1; end; result:=used; end; function CountItemBmpTol(bmp,tol:integer):integer;//based of PPLSUQBAWLZ's InventoryCount var used,i,e:integer; begin e:=0; i:=0; used:=0; GameTab(4); while(i < 6) do begin if (i = 5) and (e < 8) then begin i:= 0; e:= e + 1; end; if(FindBitmapSpiralTolerance(bmp,x,y,(570+39*i),(214+35*e),(609+39*i),(249+35*e),tol))then used:=used+1; if(i=4)and(e=7)then break; i:= i + 1; end; result:=used; end; function CountItemName(name:string):integer;//based off PPLSUQBAWLZ's InventoryCount var c,i,e:integer; begin e:=0; i:=0; GameTab(4); while(i < 6) do begin if (i = 5) and (e < 8) then begin i:= 0; e:= e + 1; end; if(FindColor(x,y,65536,(570+39*i),(214+35*e),(609+39*i),(249+35*e)))then begin MMouse(x,y,r,r); if(Option(name))then c:=c+1; end; i:= i + 1; end; result:=c; end; function FindItemColor(color:integer):boolean; begin GameTab(4); if(FindColor(x,y,color,554,205,743,465))then result:=true; end; function FindItemColorTol(color,tol:integer):boolean; begin GameTab(4); if(FindColorTolerance(x,y,color,554,205,743,465,tol))then result:=true; end; function FindItemBmpTol(bmp,tol:integer):boolean; begin GameTab(4); if(FindBitmapSpiralTolerance(bmp,x,y,554,205,743,465,tol))then result:=true; end; function FindItemName(name:string):boolean;//based off PPLSUQBAWLZ's InventoryCount var i,e:integer; begin e:=0; i:=0; GameTab(4); while(i < 6) do begin if (i = 5) and (e < 8) then begin i:= 0; e:= e + 1; end; if(FindColor(x,y,65536,(571+47*i),(215+36*e),(601+47*i),(245+36*e)))then begin MMouse(x,y,r,r); if(Option(name))then begin result:=true; break; end; end; i:= i + 1; end; end; procedure ClickItemColor(color:integer;left:boolean); begin if(FindItemColor(color))then Mouse(x,y,r,r,left); end; procedure ClickItemColorTol(color,tol:integer;left:boolean); begin if(FindItemColorTol(color,tol))then Mouse(x,y,r,r,left); end; procedure ClickItemName(name:string;left:boolean); begin if(FindItemName(name))then Mouse(x,y,r,r,left); end; procedure ClickItemBmpTol(bmp,tol:integer;left:boolean); begin if(FindItemBmpTol(bmp,tol))then Mouse(x,y,r,r,left); end; procedure ClickAllItemsColorTolWait(option:string;color,tol,waitnum:integer);//based off PPLSUQBAWLZ's InventoryCount var i,e:integer; begin e:=0; i:=0; GameTab(4); while(i < 6) do begin if (i = 5) and (e < 8) then begin i:= 0; e:= e + 1; end; if(FindColorTolerance(x,y,color,(570+39*i),(214+35*e),(609+39*i),(249+35*e),tol))then begin if(not(option=''))then begin Mouse(x,y,r,r,false); ChooseOption(option); end else Mouse(x,y,r,r,true); wait(waitnum); end; i:= i + 1; end; end; procedure ClickAllItemsColorWait(option:string;color,waitnum:integer);//based off PPLSUQBAWLZ's InventoryCount var i,e:integer; begin e:=0; i:=0; GameTab(4); while(i < 6) do begin if (i = 5) and (e < 8) then begin i:= 0; e:= e + 1; end; if(FindColor(x,y,color,(570+39*i),(214+35*e),(609+39*i),(249+35*e)))then begin if(not(option=''))then begin Mouse(x,y,r,r,false); ChooseOption(option); end else Mouse(x,y,r,r,true); wait(waitnum); end; i:= i + 1; end; end; procedure ClickAllItemsBmpTolWait(optionx:string;bmp,tol,waitnum:integer);//based off PPLSUQBAWLZ's InventoryCount var i,e:integer; begin e:=0; i:=0; GameTab(4); while(i < 6) do begin if (i = 5) and (e < 8) then begin i:= 0; e:= e + 1; end; if(FindBitmapSpiralTolerance(bmp,x,y,(570+39*i),(214+35*e),(609+39*i),(249+35*e),tol))then begin MMouse(x,y,r,r); if(not(optionx=''))then begin Mouse(x,y,r,r,false); ChooseOption(optionx); end else Mouse(x,y,r,r,true); wait(waitnum); end; if(i=4)and(e=7)then break; i:= i + 1; end; end; procedure ClickAllItemsNameWait(optionx,name:string;waitnum:integer);//based off PPLSUQBAWLZ's InventoryCount var i,e:integer; begin e:=0; i:=0; GameTab(4); while(i < 6) do begin if (i = 5) and (e < 8) then begin i:= 0; e:= e + 1; end; if(FindColor(x,y,65536,(570+39*i),(214+35*e),(609+39*i),(249+35*e)))then begin MMouse(x,y,r,r); if(Option(name))then begin if(not(optionx=''))then begin Mouse(x,y,r,r,false); ChooseOption(optionx); end else Mouse(x,y,r,r,true); wait(waitnum); end; end; i:= i + 1; end; end; procedure ClickAllItemsColor(option:string;color:integer); begin ClickAllItemsColorWait(option,color,0); end; procedure ClickAllItemsName(option,name:string); begin ClickAllItemsNameWait(option,name,0); end; procedure ClickAllItemsBmpTol(option:string;bmp,tol:integer); begin ClickAllItemsBmpTolWait(option,bmp,tol,0); end; procedure ClickAllItemsColorTol(option,name:string;color,tol:integer); begin ClickAllItemsColorTolWait(option,color,tol,0); end; function FindObjRay(txt:string;xmod,ymod:integer):boolean; var mx,my:integer; begin if(not(Option(txt)))then begin MMouse(257,169,10,10); GetMousePos(mx,my); repeat mx:=mx+xmod; my:=my+ymod; MoveMouseSmooth(mx,my); wait(10+random(10)); if(Option(txt))then begin GetMousePos(x,y); Result:=True; break; end; until(mx<=3+xmod)or(mx>=515)or(my<=3+ymod)or(my>=338) end; end; function FindObj(text:string;color,tolerance:integer):boolean; var a,c,i,x1,y1,x2,y2:integer; begin if(FindMSColorTol(color,tolerance))then begin x1:=245; y1:=165; x2:=277; y2:=185; repeat a:=a+1; if(a=1)then c:=c+1; if(a=3)then c:=c+1; for i:=1 to c do begin if(a=1)then begin x1:=x1+30; x2:=x2+30; end; if(a=2)then begin y1:=y1-20; y2:=y2-20; end; if(a=3)then begin x1:=x1-30; x2:=x2-30; end; if(a=4)then begin y1:=y1+20; y2:=y2+20; end; if(x1=485)and(x2=517)then x2:=x2-2; if(y1=325)and(y2=345)then y2:=y2-7; if(x2>515)then Break; if(FindColorTolerance(x,y,color,x1,y1,x2,y2,tolerance))then begin MMouse(x,y,r,r); if(Option(text))then begin Result:=true; Break; end; end; end; if(a=4)then a:=0; until(x2>515)or(Result=true) end; end; function FindObj2(text:string;color,tolerance:integer):boolean; var a,c,i,x1,y1,x2,y2:integer; begin if(FindMSColorTol(color,tolerance))then begin x1:=245; y1:=165; x2:=277; y2:=185; repeat a:=a+1; if(a=1)then c:=c+1; if(a=3)then c:=c+1; for i:=1 to c do begin if(a=1)then begin x1:=x1+30; x2:=x2+30; end; if(a=2)then begin y1:=y1-20; y2:=y2-20; end; if(a=3)then begin x1:=x1-30; x2:=x2-30; end; if(a=4)then begin y1:=y1+20; y2:=y2+20; end; if(x1=485)and(x2=517)then x2:=x2-2; if(y1=325)and(y2=345)then y2:=y2-7; if(x2>515)then Break; if(FindColorTolerance(x,y,color,x1,y1,x2,y2,tolerance))then begin MMouse(x,y,r,r); if(Option2(text))then begin Result:=true; Break; end; end; end; if(a=4)then a:=0; until(x2>515)or(Result=true) end; end; function FindObjDtm(text:string;dtm:integer):boolean; var a,c,i,x1,y1,x2,y2:integer; begin if(FindMSDtm(Dtm))then begin x1:=245; y1:=165; x2:=277; y2:=185; repeat a:=a+1; if(a=1)then c:=c+1; if(a=3)then c:=c+1; for i:=1 to c do begin if(a=1)then begin x1:=x1+30; x2:=x2+30; end; if(a=2)then begin y1:=y1-20; y2:=y2-20; end; if(a=3)then begin x1:=x1-30; x2:=x2-30; end; if(a=4)then begin y1:=y1+20; y2:=y2+20; end; if(x1=485)and(x2=517)then x2:=x2-2; if(y1=325)and(y2=345)then y2:=y2-7; if(x2>515)then Break; if(FindDtm(dtm,x,y,x1,y1,x2,y2))then begin MMouse(x,y,r,r); if(Option(text))then begin Result:=true; Break; end; end; end; if(a=4)then a:=0; until(x2>515)or(Result=true) end; end; function FindObjMulti(text:string;color1,color2,color3,tolerance:integer):boolean; var a,c,i,x1,y1,x2,y2:integer; begin if(FindMSColorTol(color1,tolerance))or (FindMSColorTol(color2,tolerance))or (FindMSColorTol(color3,tolerance))then begin x1:=245; y1:=165; x2:=277; y2:=185; repeat a:=a+1; if(a=1)then c:=c+1; if(a=3)then c:=c+1; for i:=1 to c do begin if(a=1)then begin x1:=x1+30; x2:=x2+30; end; if(a=2)then begin y1:=y1-20; y2:=y2-20; end; if(a=3)then begin x1:=x1-30; x2:=x2-30; end; if(a=4)then begin y1:=y1+20; y2:=y2+20; end; if(x1=485)and(x2=517)then x2:=x2-2; if(y1=325)and(y2=345)then y2:=y2-7; if(x2>515)then Break; if(FindColorTolerance(x,y,color1,x1,y1,x2,y2,tolerance))or (FindColorTolerance(x,y,color2,x1,y1,x2,y2,tolerance))or (FindColorTolerance(x,y,color3,x1,y1,x2,y2,tolerance))then begin MMouse(x,y,r,r); if(Option(text))then begin Result:=true; Break; end; end; end; if(a=4)then a:=0; until(x2>515)or(Result=true) end; end; procedure LoadStatBmps;//Odie5533's procedure from OSi begin s0 := BitmapFromString(5, 8, '000000FFFFFFFFFFFFFFFFFF000000FFFFFF000000000000000000' + 'FFFFFFFFFFFF000000000000000000FFFFFFFFFFFF000000000000' + '000000FFFFFFFFFFFF000000000000000000FFFFFFFFFFFF000000' + '000000000000FFFFFFFFFFFF000000000000000000FFFFFF000000' + 'FFFFFFFFFFFFFFFFFF000000'); s1 := BitmapFromString(3, 8, '000000FFFFFF000000FFFFFFFFFFFF000000000000FFFFFF000000' + '000000FFFFFF000000000000FFFFFF000000000000FFFFFF000000' + '000000FFFFFF000000FFFFFFFFFFFFFFFFFF'); s2 := BitmapFromString(5, 8, '000000FFFFFFFFFFFFFFFFFF000000FFFFFF000000000000000000' + 'FFFFFF000000000000000000000000FFFFFF000000000000000000' + 'FFFFFF000000000000000000FFFFFF000000000000000000FFFFFF' + '000000000000000000FFFFFF000000000000000000000000FFFFFF' + 'FFFFFFFFFFFFFFFFFFFFFFFF'); s3 := BitmapFromString(4, 8, '000000FFFFFFFFFFFF000000FFFFFF000000000000FFFFFF000000' + '000000000000FFFFFF000000FFFFFFFFFFFF000000000000000000' + '000000FFFFFF000000000000000000FFFFFFFFFFFF000000000000' + 'FFFFFF000000FFFFFFFFFFFF000000'); s4 := BitmapFromString(4, 8, 'FFFFFF000000000000000000FFFFFF000000000000000000FFFFFF' + '000000000000000000FFFFFF000000FFFFFF000000FFFFFF000000' + 'FFFFFF000000FFFFFFFFFFFFFFFFFFFFFFFF000000000000FFFFFF' + '000000000000000000FFFFFF000000'); s5 := BitmapFromString(4, 8, 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000FFFFFF' + '000000000000000000FFFFFFFFFFFFFFFFFF000000000000000000' + '000000FFFFFF000000000000000000FFFFFFFFFFFF000000000000' + 'FFFFFF000000FFFFFFFFFFFF000000'); s6 := BitmapFromString(5, 8, '000000000000FFFFFFFFFFFF000000000000FFFFFF000000000000' + 'FFFFFFFFFFFF000000000000000000000000FFFFFF000000FFFFFF' + 'FFFFFF000000FFFFFFFFFFFF000000000000FFFFFFFFFFFF000000' + '000000000000FFFFFFFFFFFF000000000000000000FFFFFF000000' + 'FFFFFFFFFFFFFFFFFF000000'); s7 := BitmapFromString(4, 8, 'FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000FFFFFF000000' + '000000FFFFFF000000000000000000FFFFFF000000000000FFFFFF' + '000000000000000000FFFFFF000000000000FFFFFF000000000000' + '000000FFFFFF000000000000000000'); s8 := BitmapFromString(5, 8, '000000FFFFFFFFFFFFFFFFFF000000FFFFFF000000000000000000' + 'FFFFFFFFFFFF000000000000000000FFFFFF000000FFFFFFFFFFFF' + 'FFFFFF000000FFFFFF000000000000000000FFFFFFFFFFFF000000' + '000000000000FFFFFFFFFFFF000000000000000000FFFFFF000000' + 'FFFFFFFFFFFFFFFFFF000000'); s9 := BitmapFromString(5, 8, '000000FFFFFFFFFFFFFFFFFF000000FFFFFF000000000000000000' + 'FFFFFFFFFFFF000000000000000000FFFFFF000000FFFFFF000000' + '000000FFFFFF000000000000FFFFFFFFFFFFFFFFFF000000000000' + '000000000000FFFFFF000000000000000000000000FFFFFF000000' + '000000000000000000FFFFFF'); end; Function GetStatFor(stat:string; bottom:integer):integer;//Odie5533's procedure from OSi var ox,oy,ox2,oy2,col,row:integer; begin if(s0=0)then LoadStatBmps; if(not (GetColor(592,175)=2763390))then begin Mouse(577,178,10,10,true); end; if(stat='attack')or(stat='strength')or(stat='defense')or(stat='ranged')or(stat='prayer')or(stat='magic')or(stat='rc')then col:=1 if(stat='hp')or(stat='agility')or(stat='herb')or(stat='thieve')or(stat='craft')or(stat='fletch')then col:=2 if(stat='mine')or(stat='smith')or(stat='fish')or(stat='cook')or(stat='fire')or(stat='wc')then col:=3 if(stat='attack')or(stat='hp')or(stat='mine')then row:=1 if(stat='strength')or(stat='agility')or(stat='smith')then row:=2 if(stat='defense')or(stat='herb')or(stat='fish')then row:=3 if(stat='range')or(stat='thieve')or(stat='cook')then row:=4 if(stat='prayer')or(stat='craft')or(stat='fire')then row:=5 if(stat='magic')or(stat='fletch')or(stat='wc')then row:=6 if(stat='rc')then row:=7 if(bottom=0)then begin ox:=520+(col*64); oy:=179+(row*31); end; if(bottom=1)then begin ox:=532+(col*64); oy:=191+(row*31); end; ox2:=ox+9 oy2:=oy+9 if(FindBitmapMaskTolerance(s1,x,y,ox,oy,ox2,oy2,10,240))then Result:=10 if(FindBitmapMaskTolerance(s2,x,y,ox,oy,ox2,oy2,10,240))then Result:=20 if(FindBitmapMaskTolerance(s3,x,y,ox,oy,ox2,oy2,10,240))then Result:=30 if(FindBitmapMaskTolerance(s4,x,y,ox,oy,ox2,oy2,10,240))then Result:=40 if(FindBitmapMaskTolerance(s5,x,y,ox,oy,ox2,oy2,10,240))then Result:=50 if(FindBitmapMaskTolerance(s6,x,y,ox,oy,ox2,oy2,10,240))then Result:=60 if(FindBitmapMaskTolerance(s7,x,y,ox,oy,ox2,oy2,10,240))then Result:=70 if(FindBitmapMaskTolerance(s8,x,y,ox,oy,ox2,oy2,10,240))then Result:=80 if(FindBitmapMaskTolerance(s9,x,y,ox,oy,ox2,oy2,10,240))then Result:=90 ox:=ox+6 ox2:=ox+9 if(FindBitmapMaskTolerance(s0,x,y,ox,oy,ox2,oy2,10,240))then Result:=Result+0 if(FindBitmapMaskTolerance(s1,x,y,ox,oy,ox2,oy2,10,240))then Result:=Result+1 if(FindBitmapMaskTolerance(s2,x,y,ox,oy,ox2,oy2,10,240))then Result:=Result+2 if(FindBitmapMaskTolerance(s3,x,y,ox,oy,ox2,oy2,10,240))then Result:=Result+3 if(FindBitmapMaskTolerance(s4,x,y,ox,oy,ox2,oy2,10,240))then Result:=Result+4 if(FindBitmapMaskTolerance(s5,x,y,ox,oy,ox2,oy2,10,240))then Result:=Result+5 if(FindBitmapMaskTolerance(s6,x,y,ox,oy,ox2,oy2,10,240))then Result:=Result+6 if(FindBitmapMaskTolerance(s7,x,y,ox,oy,ox2,oy2,10,240))then Result:=Result+7 if(FindBitmapMaskTolerance(s8,x,y,ox,oy,ox2,oy2,10,240))then Result:=Result+8 if(FindBitmapMaskTolerance(s9,x,y,ox,oy,ox2,oy2,10,240))then Result:=Result+9 end; Function GetHp:integer;//Odie5533's procedure from OSi var Hp1,Hp2:integer; begin Hp1:=(GetStatFor('hp',0)) Hp2:=(GetStatFor('hp',1)) if(Hp1>0)and(Hp2>0)then Result:=round((Hp1/Hp2)*100); end; Function InventoryFull:boolean; begin if(InventoryCount>=28)then result:=true; end; procedure FindTextSpiral(txt: String; dx,dy: Integer; SpiralSize: Integer; step, SpiralWait: Integer); // By OhDearUrDead, Edited By Khain var px, py, qx, qy: Integer; FoundText: Boolean; begin FoundText:= false; px:= dx; py:= dy; qx:= dx; qy:= dy; x:= dx; y:= dy; MoveMouseSmooth(x,y); repeat Spiralwait:= Spiralwait+random(50); MoveMouse(x,y) px:= px + 20; py:= py + 20; qx:= qx - 20; qy:= qy - 20; repeat getmousepos(x,y) x:= x + step; MoveMouseSmooth(x,y); Wait(SpiralWait); if(IsTextAt2(9,9,txt,100))then FoundText:= true; Until(x >= px)or(FoundText); if(FoundText)then Break; repeat getmousepos(x,y) y:= y + step; MoveMouseSmooth(x,y); Wait(SpiralWait); if(IsTextAt2(9,9,txt,100))then FoundText:= true; Until(y >= py)or(FoundText); if(FoundText)then Break; repeat getmousepos(x,y) x:= x - step; MoveMouseSmooth(x,y); Wait(SpiralWait); if(IsTextAt2(9,9,txt,100))then FoundText:= true; Until(qx >= x)or(FoundText); if(FoundText)then Break; repeat getmousepos(x,y) y:= y - step; MoveMouseSmooth(x,y); Wait(SpiralWait); if(IsTextAt2(9,9,txt,100))then FoundText:= true; Until(qy >= y)or(FoundText); Until(px > dx + SpiralSize)or(FoundText); end; procedure RoadWalkTol(RColor:integer;Dir:string;Tol:integer); var c:integer; begin Uppercase(Dir); if(Dir='S')then begin repeat c:=c+5; if(FindColorTolerance(x,y,RColor,565,160-c,725,160,Tol))then begin MouseFindFlag(x,y-10,0,-1); Flag; Break; end; until(c>=100) end; if(Dir='SE')then begin repeat c:=c+5; if(FindColorTolerance(x,y,RColor,725-c,160-c,725,160,Tol))then begin MouseFindFlag(x,y-10,-1,-1); Flag; Break;end; until(c>=100) end; if(Dir='SW')then begin repeat c:=c+5; if(FindColorTolerance(x,y,RColor,565,160-c,565+c,160,Tol))then begin MouseFindFlag(x,y-10,1,-1); Flag; Break; end; until(c>=100) end; if(Dir='N')then begin repeat c:=c+5; if(FindColorTolerance(x,y,RColor,565,5,725,5+c,Tol))then begin MouseFindFlag(x,y+10,0,1); Flag; Break; end; until(c>=100) end; if(Dir='NE')then begin repeat c:=c+5; if(FindColorTolerance(x,y,RColor,725-c,5,725,5+c,Tol))then begin MouseFindFlag(x,y+10,-1,1); Flag; Break; end; until(c>=100) end; if(Dir='NW')then begin repeat c:=c+5; if(FindColorTolerance(x,y,RColor,565,5,565+c,5+c,Tol))then begin MouseFindFlag(x,y+10,1,1); Flag; Break; end; until(c>=100) end; if(Dir='E')then begin repeat c:=c+5; if(FindColorTolerance(x,y,RColor,725-c,5,725,160,Tol))then begin MouseFindFlag(x-10,y,-1,0); Flag; Break; end; until(c>=100) end; if(Dir='W')then begin repeat c:=c+5; if(FindColorTolerance(x,y,RColor,565,5,565+c,160,Tol))then begin MouseFindFlag(x+10,y,1,0); Flag; Break; end; until(c>=100) end; end; procedure RoadWalk(RColor:integer;Dir:string); begin RoadWalkTol(RColor,Dir,0); end; procedure SetFightMode(oFightMode:integer); begin if(GetColor(559,179)=5531511)then Mouse(548,176,10,15,true); wait(200+random(50)); if(oFightMode=1)and(not (GetColor(565,282)=2303647))then Mouse(569,271,55,15,true); if(oFightMode=2)and(not (GetColor(565,323)=2303647))then Mouse(569,311,55,15,true); if(oFightMode=3)and(not (GetColor(565,367)=2303647))then Mouse(569,352,55,15,true); if(oFightMode=4)and(not (GetColor(565,411)=2303647))then Mouse(571,403,55,15,true); GameTab(4); end; procedure RunAwayDirection(direction:string); var RunBackx,RunBacky:integer; begin x:=0;y:=0; if(Uppercase(direction)='N')then y:=-50; if(Uppercase(direction)='E')then x:=50; if(Uppercase(direction)='S')then y:=50; if(Uppercase(direction)='W')then x:=-50; RunBackx:=x+648; RunBacky:=y+83; MouseFindFlag(x+648,y+83,1,1); SetRun(true); Flag; x:=RunBackx;y:=RunBacky; end; procedure RunBack; begin MouseFindFlag((648-x)+648,(83-y)+83,1,1); SetRun(true); Flag; end; procedure Face(direction:string); var CAngle:extended; begin if(not(ScarScape))then begin if(uppercase(direction)='N')then CAngle:=6.3; if(uppercase(direction)='E')then CAngle:=4.85; if(uppercase(direction)='S')then CAngle:=3.3; if(uppercase(direction)='W')then CAngle:=1.6; if(not((DetectRS2MinimapCompassAngle>(CAngle-0.1))and (DetectRS2MinimapCompassAngle<(CAngle+0.1))))or ((uppercase(direction)='N')and(DetectRS2MinimapCompassAngle<0.2))then begin repeat SendArrowSilentWait(1,100+random(10)); until(DetectRS2MinimapCompassAngle>(CAngle-0.1))and (DetectRS2MinimapCompassAngle<(CAngle+0.1))or ((uppercase(direction)='N')and(DetectRS2MinimapCompassAngle<0.2)) end; end; end; procedure OpenBank; var c:Integer; begin if(FindObj('Use Bank',539728,10))then begin Mouse(x,y,1,1,false); if(ChooseOption('quickly'))then begin Flag; repeat Wait(100); c:=c+1 until(BankScreen)or(c>=50) end; end; end; procedure Deposit(slot, toslot, thetype:integer);//Fixed from PPLSUQBAWLZ's Deposit in library var slotnumber,col,row:integer; begin if(BankScreen)then begin slotnumber:=slot; while(slotnumber600) Flag; end; procedure MarkTime(var TimeMarker:integer); begin TimeMarker:=GetSystemTime; end; function TimeFromMark(var TimeMarker:integer):integer; begin result:=GetSystemTime-TimeMarker; end; procedure ToBankers(var BankColor:integer;MouseAdjustX,MouseAdjustY:integer);//Find the specified bank color and clicks the nearest yellow dots to get closer to the bankers. var c,ax,ay:integer; begin if(FindMMColor(BankColor))then begin while c<30 do begin c:=c+5; if(FindMMColor(BankColor))then begin if(FindColorSpiralTolerance(ax,ay,195836,x-c,y-c,x+c,y+c,10))then begin x:=ax; y:=ay; break; end; end; end; MouseFindFlag(x,y,MouseAdjustX,MouseAdjustY); Flag; wait(1000+random(100)); end; end; function TimeRunning:string;//modified from Phalanx's script var RHours,Minutes,Seconds,RMinutes,RSeconds:LongInt; Time:string; begin Seconds:=(GetSystemTime-ST) div 1000; Minutes:=Seconds div 60; RHours:=Minutes div 60; Time:=inttostr(Seconds)+' Seconds'; if Minutes<>0 then begin RSeconds:=Seconds Mod (Minutes*60); Time:=inttostr(Minutes)+' Minutes and '+inttostr(RSeconds)+' Seconds'; end; if RHours<>0 then begin RMinutes:=Minutes Mod (RHours*60); RSeconds:=Seconds Mod (Minutes*60); Time:=inttostr(RHours)+' Hours, '+inttostr(RMinutes)+ ' Minutes and '+inttostr(RSeconds)+' Seconds'; end; Result:=Time; end; procedure ItemGrab; begin GameTab(4); if(FindColor(x,y,241,565,5,725,160))then begin Mouse(x,y,1,1,true); Flag; Wait(100+random(100)); FindTextSpiral('Take',258,169,50,5,10+random(10)); GetMousePos(x,y); Mouse(x,y,0,0,true); Wait(1000+random(100)); end; end; function FindOreColors(refrencecolor,tolerance1,tolerance2:integer):boolean; var c,a,i,ax,ay:integer; begin if(FindObj('Mine',refrencecolor,tolerance1))then begin ax:=x; ay:=y; repeat a:=a+1; if(a=1)then c:=c+1; if(a=3)then c:=c+1; for i:=1 to c do begin if(a=1)then ax:=ax+1; if(a=2)then ay:=ay-1; if(a=3)then ax:=ax-1; if(a=4)then ay:=ay+1; if(SimilarColors((GetColor(ax,ay)),refrencecolor,tolerance2))then begin if(OreColor1=0)then begin OreColor1:=(GetColor(ax,ay)); end else if(OreColor2=0)and(not((GetColor(ax,ay))=OreColor1))then begin OreColor2:=(GetColor(ax,ay)); end else if(OreColor3=0)and(not((GetColor(ax,ay))=OreColor1))and (not((GetColor(ax,ay))=OreColor2))then OreColor3:=(GetColor(ax,ay)); end; end; if(a=4)then a:=0; until(c>100)or(Result=true) end; if(orecolor1>0)and(orecolor2>0)and(orecolor3>0)then begin result:=true; writeln('OreColors... '+inttostr(orecolor1)+' '+inttostr(orecolor2)+' '+inttostr(orecolor3)); end; end; procedure SetRandomOreColor; Var color:integer; begin Color:=1+Random(3); case Color of 1: begin OreColor:=OreColor1; end; 2: begin OreColor:=OreColor2; end; 3: begin OreColor:=OreColor3; end; end; end; procedure DisplayWindow(xs,ys,xe,ye,WindowLength,WindowHeight:integer); var DebugCanvas,ClientCanvas:TCanvas; begin DisplayDebugImgWindow(WindowLength,WindowHeight); DebugCanvas:= GetDebugCanvas; ClientCanvas:= GetClientCanvas; CopyCanvas(ClientCanvas,DebugCanvas,xs,ys,xe,ye,0,0,WindowLength,WindowHeight); end; //============================================================================\\ //============================RANDOM PROTECTION===============================\\ //============================================================================\\ //GENERAL RANDOMS procedure CloseWindow; begin if(FindBitmapMaskTolerance(CWindow,x,y,400,3,515,100,0,85))then Mouse(x+10,y+3,5,1,true); if(FindColor(x,y,255,265,13,531,55))and(GetColor(494,334)=16777215)then Mouse(501,317,r,r,true); end; procedure LoginIfNeeded;//A stupid3ooo procedure based off many others var WorldIsFull,c,cc:integer; begin WorldIsFull := BitmapFromString(78, 3, 'z78DAAD53410E83300C' + 'FB12E00CB12308E5FF4F9AD45CD2A58E1A04070BB5C60DB6ABAAB' + 'A2CDAD01E7B9743CE0F34ECD2F55520775CC78EA3D1FFD6BDDAB3' + '6F07FC139780E180BF01B80CFDAEC7815A9BAAC35C2165E67F5AE' + '6DF50F9B24922E6D9D15CC854C6378C93F88C0A6779E79BE67CA6' + '86AC335D2EA64C903590F5E7DD4CA333F1B656FDAC36CA3B5FD02' + '4EEC59E4C65EA6ED08CF35D6726328DFA2F649AB6FD07A49338F5' + ''); if(not(LoggedIn))then begin Logs:=Logs+1; ClickTextFont('Cancel',UpChars,true); ClickTextFont('Exist',UpChars,true); if(ClickTextFont('Username',UpChars,true))then begin TypeSend(Username); Mouse(327,272,r,r,true); TypeSend(Password); end; ClickTextFont('Login',UpChars,true); repeat c:=c+1 wait(100+random(100)); if(FindBitmap(WorldIsFull,x,y))then begin while(FindBitmap(WorldIsFull,x,y))or(cc<25)do begin cc:=cc+1; Mouse(300,322,20,5,true); wait(500+random(100)); end; end; until(LoggedIn)or(c>=600)or((FindColor(x,y,255,265,13,531,55))and(GetColor(494,334)=16777215)) c:=0; repeat c:=c+1; wait(100+random(100)); until(FindBitmapMaskTolerance(CWindow,x,y,3,3,515,338,0,85))or(c>100)or ((FindColor(x,y,255,265,13,531,55))and(GetColor(494,334)=16777215)) CloseWindow; if(not(LoggedIn))then begin LoginTry:=LoginTry+1; if(IsTextInAreaEx(208,174,560,298,x,y,'updated',100,UpChars,False,True,0,1,-1))then begin writeln('Runescape was updated.'); TerminateScript; end; if(LoginTry=5)then begin Writeln('Connection lost, or other error.'); TerminateScript; end; end else LoginTry:=0; end; FreeBitmap(WorldIsFull); end; function FindFight:boolean; begin if(FindColor(x,y,65280,217,129,297,209))then begin if(CheckHpFirst=true)then begin GameTab(2); Wait(500+random(100)); if(GetHp<100)then begin if(Screenshots)then SaveScreenShot('Fight Random - Stupid3ooo - '+TimeRunning+'.bmp'); Result:=true; Fights:=Fights+1; end; end else begin if(Screenshots)then SaveScreenShot('Fight Random - Stupid3ooo - '+TimeRunning+'.bmp'); Result:=true; Fights:=Fights+1; end; GameTab(4); end; end; function TalkToRand:boolean; var c:integer; begin repeat c:=c+1; if(FindColor(x,y,16711680,5,345,510,465))and(not(GetColor(20,434)=0))then begin Result:=true; Mouse(x,y,50,2,true); wait(500+random(500)); end; if(FindColor(x,y,16777215,5,345,510,465))and(not(GetColor(20,434)=0))then begin Result:=true; GetMousePos(x,y); Mouse(x,y,50,2,true); wait(500+random(500)); end; until(GetColor(20,434)=0)or(c>=20) end; function FindTalk:boolean; var mx,my:integer; begin if(FindColor(mx,my,65535,3,3,515,338))then//Find close begin MMouse(mx,my+15,1,1); repeat if(IsTextAt2(9,9,'Talk',100))then begin Mouse(mx,my+15,1,1,false); if(ChooseOption('Talk'))then begin if(Screenshots)then SaveScreenShot('Talking Random - Stupid3ooo - '+TimeRunning+'.bmp'); Flag; wait(500+random(500)); TalkToRand; Talks:=Talks+1; Result:=true; Break; end; end; MoveMouseSmooth(mx,my+15); mx:=mx+5; wait(10+random(10)); until(mx>=515); if(mx>=515)then MoveMouseSmooth(mx+random(5),my+15); end; end; function FindLamp(skill:string):boolean; var ac,ar,col,row:integer; begin GameTab(4); if(Lowercase(skill)='strength')then begin col:=1;row:=1;end; if(Lowercase(skill)='attack')then begin col:=1;row:=2;end; if(Lowercase(skill)='ranged')or(Lowercase(skill)='ranging')then begin col:=1;row:=3;end; if(Lowercase(skill)='magic')then begin col:=1;row:=4;end; if(Lowercase(skill)='defence')then begin col:=1;row:=5;end; if(Lowercase(skill)='hitpoints')then begin col:=1;row:=6;end; if(Lowercase(skill)='prayer')then begin col:=1;row:=7;end; if(Lowercase(skill)='agility')then begin col:=2;row:=1;end; if(Lowercase(skill)='herblore')then begin col:=2;row:=2;end; if(Lowercase(skill)='thieving')then begin col:=2;row:=3;end; if(Lowercase(skill)='crafting')then begin col:=2;row:=4;end; if(Lowercase(skill)='runecraft')or(Lowercase(skill)='runecrafting')then begin col:=2;row:=5;end; if(Lowercase(skill)='slayer')then begin col:=2;row:=6;end; if(Lowercase(skill)='farming')then begin col:=2;row:=7;end; if(Lowercase(skill)='mining')then begin col:=3;row:=1;end; if(Lowercase(skill)='smithing')then begin col:=3;row:=2;end; if(Lowercase(skill)='fishing')then begin col:=3;row:=3;end; if(Lowercase(skill)='cooking')then begin col:=3;row:=4;end; if(Lowercase(skill)='firemaking')then begin col:=3;row:=5;end; if(Lowercase(skill)='woodcutting')then begin col:=3;row:=6;end; if(Lowercase(skill)='fletching')then begin col:=3;row:=7;end; If(FindBitmapSpiralTolerance(Lamp,x,y,550,200,745,465,25))then begin Result:=true; if(Screenshots)then SaveScreenShot('Lamp Random - Stupid3ooo - '+TimeRunning+'.bmp'); ac:=116+(row*36); ar:=124+(col*32); Lamps:=Lamps+1; Mouse(x,y,1,1,true); Wait(500+random(100)); Mouse(ac,ar,12,12,true); Wait(500+random(100)) Mouse(242,256,1,1,true); wait(1000+random(500)) end; end; procedure FindMiscRandoms; var ax,ay:integer; RandomChatList: array[0..40] of string; begin if(LoggedIn)then begin if(FindColor(ax,ay,786423,10,350,150,433))or (FindColor(ax,ay,10658466,10,350,150,433))then begin RandomChatList[1]:= 'g2g'; RandomChatList[2]:= 'sry bye'; RandomChatList[3]:= 'dinner time'; RandomChatList[4]:= 'one sec'; RandomChatList[5]:= 'afk'; RandomChatList[6]:= 'brb'; TypeSend(RandomChatList[random(6)]+chr(13)); if(Screenshots)then SaveScreenShot('Found a mod - Stupid3ooo - '+TimeRunning+'.bmp'); LogOut; writeln('UHOH, A MOD!!!'); if(LoginAfterMod=0)then begin TerminateScript; end else begin Wait(LoginAfterMod*60000); LoginIfNeeded; end; end; if(GetColor(30,418)=0)and(GetColor(72,429)=0)then begin if(Screenshots)then SaveScreenShot('Oh dear you died - Stupid3ooo - '+TimeRunning+'.bmp'); LogOut; writeln('Oh dear, you are dead!'); TerminateScript; end; if(FindColor(ax,ay,11503238,10,350,479,433))then begin if(Screenshots)then SaveScreenShot('Mime Random - Stupid3ooo - '+TimeRunning+'.bmp'); LogOut; writeln('Mime Found'); TerminateScript; end; if(FindColortolerance(ax,ay,15395562,129,34,129,34,4))and(FindColortolerance(ax,ay,15395562,378,39,378,39,4))then//by Ghost begin if(Screenshots)then SaveScreenShot('Maze Random - Stupid3ooo - '+TimeRunning+'.bmp'); LogOut; WriteLn('Found a Maze!'); TerminateScript; end; if(FindText('Answer',ChatChars,17,355,300,434)) then //From RSCI begin; WriteLn('Found a Quiz, logging out') TerminateScript; end; if(FindColorTolerance(ax, ay, 4936133, 35, 355, 110, 425, 5))Then //From RSCI begin writeln('Found Evil bob, logging out'); TerminateScript; end; end; end; function FindForester:boolean;//A Stupid3ooo procedure var c:integer; begin if(FindBitmap(bmpFreakyForester,x,y))then begin if(Screenshots)then SaveScreenShot('Freaky Forester Random - Stupid3ooo '+TimeRunning+'.bmp'); if(SolveForester)then begin repeat if(FindObj('Attack',4344603,20))then begin Mouse(x,y,r,r,false); ChooseOption('Attack'); Flag; Wait(5000+random(1000)); end; if(not(FindItemBmpTol(bmpPheasantMeat,30)))then begin if(FindObj('Take',3763101,25))then begin Mouse(x,y,r,r,false); ChooseOption('Take'); Flag; Wait(2000+random(500)); end; end; if(FindItemBmpTol(bmpPheasantMeat,30))then begin Mouse(x,y,r,r,true); if(FindObj('Use Raw pheasant with Freaky',14869221,20))then begin Mouse(x,y,r,r,true); Flag; Wait(1000+random(500)); if(FindBitmap(bmpLeaveTheArea,x,y))then begin MouseFindFlag(690,83,-1,1); Flag; for c:=1 to 10 do begin Wait(100+random(10)); if(FindObj('Enter',12514550,20))then begin Mouse(x,y,r,r,false); ChooseOption('Enter'); Wait(10000+random(1000)); if(FindBitmap(bmpFreakyForester,x,y))then begin writeln('Chose the wrong pheasant :('); TerminateScript; end else begin Result:=true; Foresters:=Foresters+1; end; Break; end; end; end; end; end; until(Result=true) end else begin Writeln('Found Forester, logging out'); LogOut; TerminateScript; end; end; end; function FindFrog:boolean;//A Stupid3ooo procedure var tx,ty,a,c,cc,CrownColor,i,x1,y1,x2,y2:integer; begin if(FindBitmap(Frog,x,y))or(not(getcolor(650, 185) = 4902398))then begin if(Screenshots)then SaveScreenShot('Frog Random - Stupid3ooo - '+TimeRunning+'.bmp'); if(FindMMDtm(FrogSpot))then begin Mouse(x,y,r,r,true); Flag; end; x1:=245; y1:=165; x2:=277; y2:=185; repeat a:=a+1; if(a=1)then c:=c+1; if(a=3)then c:=c+1; for i:=1 to c do begin if(a=1)then begin x1:=x1+30; x2:=x2+30; end; if(a=2)then begin y1:=y1-20; y2:=y2-20; end; if(a=3)then begin x1:=x1-30; x2:=x2-30; end; if(a=4)then begin y1:=y1+20; y2:=y2+20; end; if(x1=485)and(x2=517)then x2:=x2-2; if(y1=325)and(y2=345)then y2:=y2-7; if(x1>515)then Break; if(FindColorTolerance(x,y,1077773,x1,y1,x2,y2,20))then begin MMouse(x,y,r,r); if(Option('Talk'))then begin for cc:=1 to 20 do begin if(FindColorTolerance(tx,ty,3460859,x-20,y-20,x+20,y+20,cc))then begin CrownColor:=GetColor(tx,ty); Break; end; end; if(FindColor(tx,ty,CrownColor,x-20,y-20,x+20,y+20))and (not(FindColoredAreaTolerance(tx,tx,2965499,x-25,y-25,x+25,y+25,4,20)))then begin Mouse(x,y,r,r,false); ChooseOption('Talk'); Flag; Wait(2000+random(1000)); TalkToRand; Mouse(256,401,r,r,true); Wait(5000+random(1000)); TalkToRand; Result:=true; Frogs:=Frogs+1; Break; end; end; end; end; if(a=4)then a:=0; until(x2>515)or(Result=true) end; end; function FindDoctor:boolean;//Edited version of knightstreak's EyeTest, all credit goes to knightstreak var c,i,backgroundcolor : integer; firstfinger, secondfinger, thirdfinger, fourthfinger : boolean; begin if(not(getcolor(650, 185) = 4902398))then begin backgroundcolor:=Getcolor(10,10); repeat c:=c+1; Wait(10); if(not(getcolor(143, 94) = backgroundcolor))then firstfinger:=true; if(not(getcolor(302,41) = backgroundcolor))then secondfinger:=true; if(not(getcolor(409,75) = backgroundcolor))then thirdfinger:=true; if(not(getcolor(415,101) = backgroundcolor))then fourthfinger:=true; until(c>1000)or(firstfinger)and(secondfinger)and (thirdfinger)and(fourthfinger) if(firstfinger = true)and(secondfinger = false)and(thirdfinger = false)and(fourthfinger = false)then Mouse(99, 299,3,3,true); if(firstfinger=true) and (secondfinger=true) and (thirdfinger=false) and (fourthfinger=false)then Mouse(153,300,3,3,true); if(firstfinger=true) and (secondfinger=false) and (thirdfinger=false) and (fourthfinger=true)then Mouse(211, 304,3,3,true); if(firstfinger=false) and (secondfinger=true) and (thirdfinger=true) and (fourthfinger=false)then Mouse(265, 300,3,3,true); if(firstfinger=false) and (secondfinger=false) and (thirdfinger=false) and (fourthfinger=true)then Mouse(320, 306,3,3,true); if(firstfinger=true) and (secondfinger=true) and (thirdfinger=true) and (fourthfinger=false)then Mouse(374, 298,3,3,true); if(firstfinger=true) and (secondfinger=true) and (thirdfinger=true) and (fourthfinger=true)then Mouse(431,299,3,3,true); For i := 0 to 5 do Begin if(getcolor(241,445) = 16711680)or(getcolor(241,445) = 16777215)then begin Doctors:=Doctors+1; Result:=true; Mouse(241,445,3,3,true); wait(1500 + random(500)); end; end; end; end; function FindCerter:boolean;//Repeatedly talks to the Certer and it'll eventually go away, If this does not work you can count the number of background pixles and if it's greater than a certain number it's either a sword, helmet or ammy. var c:integer; begin if(FindTalk)then begin if(getcolor(359, 37) = 8168120)Or(getcolor(163, 167) = 1922399)Or(getcolor(89, 51) = 879691)Then //From RSCI begin repeat c:=c+1; if(FindColor(x,y,65535,555,150,643,171))then Mouse(478,10,r,r,true); if(FindObj('Talk',7039859,15))then begin Mouse(x,y,r,r,false); ChooseOption('Talk'); TalkToRand; Flag; Wait(500+random(100)); if(FindColor(x,y,65535,555,150,643,171))then Mouse(478,10,r,r,true); end else Break; until(c>1000) if(c<1000)then begin Certers:=Certers+1; Result:=true; end; end;