{==================================================] [ Moparisthebest's Ironminerbanker v2.1 ] [ Based in part on: Stupid3ooo's GuildMiner v3.83 ] [==================================================] | Instructions: | | 1.V-bright, 32bit resolution. | | 2.Need SCAR version 2.0.3. | | 3.START SCRIPT IN THE WEST FALLY, EAST VARROCK | | OR EAST ARDOUGNE BANK. | | 4.Start with a pickaxe in your fist | | inventory slot or equiped. | | 5.Recomended to have extra pickaxes in your | | first bank slot. | | 6.Setup is in lines 54-59. | | 7.Press the green arrow to start. | | 8.For general SCAR help go to | | http://www.kaitnieks.com/files/SCARGUIDE/SCARGUIDE.htm | [==================================================} program moparsironminerbanker; {.include SSI2.txt} {.include moparsroadrunner.txt} {.include BoxBreaker.txt} var MapPickColor,MapOreColor,BankColor,Report,Report2,minewaittime, TotalOres,Banks,Mark,IAmLostCount,MaxWait,Town,exp:integer; NoPick,Look4Gas,EquipPick,UnderGround,iron:boolean; RockDirection,RunDirection:string; procedure Setup; begin //=//=========Main Screen Colors(Leave as 0 to let script find)========\\=\\ OreColor1:= 0; //Colors of Iron/Coal rocks OreColor2:= 0; OreColor3:= 0; //=\\=================================================================//=\\ //=//==========Mini Map Colors(Leave as 0 to let script find)==========\\=\\ BankColor:= 0; //Bank symbol color (SS:3060683) moparsroadcolor:= 0; //road color (SS:5592411) MapOreColor:= 0; //ore color (SS:4010803) MapPickColor:= 0; //Pick symbol color (SS:207695) //=\\=================================================================//=\\ //=\\============================Setup================================//=\\ Username:= 'Username';//Username. Password:= 'Password';//Password. ScarScape:= false;//Set to true if you are using ScarScape. LogsOut:= true;//If you want to log out every so often for antiban. Chats:= true;//If you want to randomly chat for anti-ban. Look4Gas:= true;//Set to false if you are having trouble with it constantly finding gas. Rotates:= true;//If you want to randomly rotate the screen for anti-ban. MaxWait:= 10;//Maximum time in seconds to wait while mining a rock. minewaittime:= 100;//increase if you lag while mining, default 100 EquipPick:= true;//If you can/want to equip your pick. RunDirection:= 'E';//Direction to run away from. 'E' is default. town:=0; //leave 0 to autopick, town to start in, 1=fally 2=varrock 3=ardy iron:=true; //iron or coal, ardougne only //=\\=================================================================//=\\ end; //DO NO TOUCH BELOW procedure ProgressReport; var RHours,Minutes,Seconds,RMinutes,RSeconds,avtime:LongInt; Time:String; begin if(GetSystemTime-report2 > report*60000)then begin Seconds:=(GetSystemTime-ST) div 1000; Minutes:=Seconds div 60; RHours:=Minutes div 60; Time:=IntToStr(Seconds)+' Seconds'; avtime:=Seconds/banks; 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; begin WriteLn(' '); WriteLn('<=================Progress Report================>'); WriteLn('Worked for '+Time); WriteLn('Banked '+IntToStr(banks)+' loads[s].'); WriteLn('Banked '+IntToStr(TotalOres)+' ore[s].'); WriteLn('Gained '+floattostr(exp*TotalOres)+'xp.'); WriteLn('Currently Averaging about '+IntToStr(3600/avtime*(TotalOres/banks))+ ' ores and '+floattostr(3600/avtime*(exp*(TotalOres/banks)))+' xp an hour.'); WriteLn('Random Event Report:'); if(fights>0)then WriteLn(' Fought '+IntToStr(fights)+' time[s].'); if(talks>0)then WriteLn(' Talked to '+IntToStr(talks)+' Random event[s].'); if(lamps>0)then WriteLn(' Used lamps '+IntToStr(lamps)+' time[s].'); if(boxes>0)then WriteLn(' Solved '+IntToStr(boxes)+' box[es].'); if(logs>0)then WriteLn(' Logged in '+IntToStr(logs)+' time[s].'); WriteLn('<================================================>'); Report2:=GetSystemTime; end; end; end; //===========================Color Finding procedures=========================\\ procedure SetRoadColorifneeded; var dtmGetRoad:integer; begin if(moparsroadcolor=0)then begin // 1= fallador, thx to sdouble for making the dtm // 2= varrock // 3= ardougne case town of 1:dtmGetRoad:= DTMFromString('78DA636C636460900362206006622620CE484' + 'C60B001D220D1FF40C05807642940D4C0C0BF7FC2703520C00832' + '4711D59C3F7F9850D5F40259CAF8D50000A9480ED1'); 2:dtmGetRoad:= DTMFromString('78DA63AC65626048660003662006F21872525' + '3196C80342310FF0702C62AA0681CAA9A3F7F98E06A4080B11928' + '1A8FAAE6ED5B0654354D9876A19B0300F1470F94'); 3:dtmGetRoad:= DTMFromString('78DA632C66626088640003662006F21852626' + '3186C80342310FF0702C602A0680CAA9A18533E060DA81A10602C' + '25524D1801350584D50000A99A0C99'); end; if(FindDtm(dtmGetRoad, x, y, 570, 5, 725, 155 ))then moparsroadcolor:= GetColor(x,y); end; if(moparsroadcolor=0)then begin writeln('cant find road color, pick manually or restart'); terminatescript; end; end; procedure SetTownifneeded; var c:integer; begin if(town=0)then begin while(town=0)do begin c:=c+1; if(findcolorspiraltolerance(x,y,10321002,573,93,603,131,20))then begin town:=1; writeln('Starting in Falador'); iron:=true; exp:=35; end else if(findcolorspiraltolerance(x,y,10321002,647,139,669,164,20))then begin town:=3; writeln('Starting in Ardougne'); if(not(iron))then exp:=50; if(iron)then exp:=35; end else if(not(findcolorspiraltolerance(x,y,10321002,570,5,725,155,20)))then begin town:=2; writeln('Starting in Varrock'); iron:=true; exp:=35; end; if(c>20)then begin writeln('cant decide which city your starting in, set town yourself'); terminatescript; end; wait(random(50)+500); end; end; end; procedure FindRockDirection; begin if(MapPickColor>0)then begin if(FindColorSpiral(x,y,MapPickColor,668,5,725,160))then RockDirection:='W'; if(FindColorSpiral(x,y,MapPickColor,575,5,628,160))then RockDirection:='E'; if(FindColorSpiral(x,y,MapPickColor,575,103,725,160))then RockDirection:='N'; if(FindColorSpiral(x,y,MapPickColor,575,5,725,68))then RockDirection:='S'; end; end; function FindMapOreColor:integer; var MapOre,MapOre2:integer; begin MapOre := BitmapFromString(3, 3, '3D2C345948546D5D624A39416D5D626D5D625948546D5D626D5D62' + ''); MapOre2 := BitmapFromString(3, 3, '061115222D35364243131E22364243364243222D35364243364243' + ''); if(FindBitmapsProgressiveTol(MapOre,MapOre2,0,0,0,65,5,587,41,705,118))then Result:=GetColor(x+1,y+1); Freebitmap(MapOre); Freebitmap(MapOre2); end; procedure CouldNotFindColors; begin WriteLn('ERROR, script could not find colors, please run the script again' +' or set your own colors.'); TerminateScript; end; procedure FindBottomColorsIfNeeded; var c:integer; begin if(UnderGround)and((MapPickColor=0)or(MapOreColor=0)or((orecolor1=0)or(orecolor2=0)or(orecolor3=0)))then begin writeln('Finding bottom colors please wait...'); if(MapPickColor=0)then begin while(MapPickColor=0)do begin c:=c+1; if(MapPickColor=0)then MapPickColor:=GetSymbolColor('mining spot'); if(c>20)then CouldNotFindColors; wait(500+random(100)); end; if(FindMMColor(MapPickColor))then begin Status('To iron') Wait(200) Mouse(x,y,5,5,True) Flag; wait(1500+random(500)); end; end; if(orecolor1=0)or(orecolor2=0)or(orecolor3=0)then begin if(((iron)and(town=3))or(not(town=3)))then FindOreColors(2371664,5,25); if((not(iron))and(town=3))then FindOreColors(2900546,5,13); end; if(MapOreColor=0)then MapOreColor:=FindMapOreColor; if((MapPickColor=0)or(MapOreColor=0)or((orecolor1=0)or(orecolor2=0)or(orecolor3=0)))then CouldNotFindColors; writeln('MapPickColor:'+inttostr(MapPickColor)+' MapOreColor:'+inttostr(MapOreColor)); FindRockDirection; end; end; procedure FindTopColorsIfNeeded; var c:integer; begin if(not(Underground))and((BankColor=0)or(moparsroadcolor=0))then begin writeln('Finding top colors please wait...'); while(BankColor=0)or(moparsroadcolor=0)do begin c:=c+1; if(BankColor=0)then BankColor:=GetSymbolColor('bank'); SetRoadColorifneeded; if(c>20)then CouldNotFindColors; wait(random(50)+500); end; writeln('BankColor:'+inttostr(BankColor)+' Roadcolor:'+inttostr(moparsroadcolor)); end; end; //========================Map Walking procedures==============================\\ procedure ToCenter; begin if(FindColorSpiral(x,y,MapPickColor,570,63,725,160))then begin Mouse(x-20,y-20,40,40,true); Flag; Wait(1000+Random(100)); end else begin RoadWalk(MapOreColor,'S'); if(FindColorSpiral(x,y,MapPickColor,570,63,725,160))then begin Mouse(x-20,y-20,40,40,true); Flag; Wait(1000+Random(100)); end; end; end; procedure ToBankers; var c,ax,ay:integer; 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; MouseFindFlag(x,y-5,0,-2); FlagAtColor(BankColor); Wait(1000+Random(100)); Break; end; end; end; end; procedure banktomine; begin case town of 1:fallybanktomine(MapPickColor); 2:varrockbanktomine(MapPickColor); 3:ardybanktomine(MapPickColor); end; UnderGround:=true; FindBottomColorsIfNeeded; if((findMMcolor(MapPickColor))and(town=1))then roadrunnermouse(x-31,y); end; procedure minetobank; begin case town of 1:fallyminetobank(BankColor); 2:varrockminetobank(BankColor); 3:ardyminetobank(BankColor); end; if(town=1)or(town=2)then ToBankers; end; //==========================Random Event procedures===========================\\ procedure TerminateIfLost; begin if(LoggedIn)then begin if(not(FindMMColor(BankColor)))and(not(FindMMColor(MapOreColor)))and (not(FindMMColor(MapPickColor)))then begin IAmLostCount:=IAmLostCount+1; if(IAmLostCount>10)then begin WriteLn('Lost!!!'); TerminateScript; end; end else IAmLostCount:=0; end; end; procedure FindRandoms; begin FindNormalRandoms; AntiBan; if(FindFight)then begin RunAwayDirection(RunDirection); Wait(5000+random(1000)); RunBack; end; FindDoctor; FindBox; if(UnderGround)then begin if(not(FindPick))then NoPick:=true; if(FindColorSpiral(x,y,OreColor,210,130,300,220))then begin if(Look4Gas)then begin if(FindGas(x,y))then ToCenter; end; end; end; end; //=========================Main Screen procedures=============================\\ procedure ClickAllItemsColorWaitfixed(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 Bank; begin if(not(UnderGround))then begin FindBox; TotalOres:=TotalOres+(CountItemBmpTol(Ore,50)); if(NoPick=true)and(EquipPick=true)then begin GameTab(5); Mouse(593,303,r,r,true); Wait(Random(50)+1000); GameTab(4); end; OpenBank; if(BankScreen)then begin if(NoPick=true)then begin ClickAllItemsColorWaitfixed('All',65536,1000+Random(100)); Withdraw(1,1,1); end else begin if(EquipPick=false)then Deposit(2,28,2); if(EquipPick=true)then ClickAllItemsColorWaitfixed('All',65536,1000+Random(100)); end; CloseWindow; if(NoPick=true)and(EquipPick=true)then begin FindPickHeadColor; ClickItemColor(hc1,true); end; Banks:=Banks+1; ProgressReport; NoPick:=false end; end; end; procedure Mine; var SysTime:integer; begin SetRandomOreColor; if(FindObj('Mine',OreColor,5))then begin if(not(FindGas(x,y)))then begin Mouse(x,y,r,r,true); if(FlagPresent)then begin Flag; Wait(500+random(500)); end; MarkTime(SysTime); repeat if(not(FindColorSpiral(x,y,OreColor,210,130,300,220)))then Break; FindRandoms; Wait(500+Random(500)); until(not(GetColor(109,430)=0)and(not(GetColor(195,426)=0)))or (TimeFromMark(SysTime)>=MaxWait*1000) end; end else begin wait(minewaittime+random(50)); end; end; //======================================Main Line=============================\\ begin GetClientDimensions(x,y); if(not((x=766)and(y=504)))then begin if(not(FindWindowBySize(766,504)))then begin writeln('cannot find client, please select client manually'); end; end; SetupSSI; Setup; PrepClient; SetTownifneeded; FindTopColorsIfNeeded; if(FindPickHeadColor)then begin repeat FindRandoms; SetRun(true); banktomine; if(Underground)then begin MarkTime(Mark); repeat FindRandoms; Mine; until(InventoryFull)or(NoPick=true)or(TimeFromMark(Mark)>1800000) end; minetobank; UnderGround:=false; TerminateIfLost; Bank; until(false) end; end.