Wanted Posted March 21, 2013 Share Posted March 21, 2013 https://github.com/OfficialSCARInclude/OSI2/commit/29aa7b355041dd46a5f3e93063c6bc923f9fbb55 Tab1-Stats.scar doneTab4-Equipment.scar done Tab0-Combat near done Added Mystery Box solver [sCAR] * function GetSkillBounds(Skill: Integer): TBox; By: Wanted * function GetSkillLevelEx(Skill: Integer; BottomNumber, CheckST: Boolean): Integer; By: Wanted * function GetSkillLevel(Skill: Integer; CheckST: Boolean): Integer; By: Wanted * function HoverSkill(Skill: Integer; CheckST: Boolean): Boolean; By: Wanted * function GetSkillXPEx(Skill: Integer; var CurrentXP, XPTilNextLevel: LongInt; CheckCurrent, CheckNext, CheckST: Boolean): Boolean; By: Wanted * function GetXP(Skill: Integer; CheckST: Boolean): Integer; By: Wanted * function GetAllLevels(CheckST: Boolean): Boolean; By: Wanted * function GetTotalLevel: LongInt; By: Wanted[/sCAR] [sCAR]{$DEFINE RS07} {$I OSI\OSI.scar} {$I OSI\Divi\Misc\Debug.scar} procedure ScriptTerminate; begin FreeOSI; end; var TBA: TBoxArray; I: Integer; begin SetUpOSI; SetLength(TBA, Skill_Count); for I := 0 to Skill_Count - 1 do TBA := GetSkillBounds(I); DebugTBA(TBA); end. [/sCAR] [sCAR]const Skill_Count = 23; Skill_Attack = 0; Skill_Hitpoints = 1; Skill_Mining = 2; Skill_Strength = 3; Skill_Agility = 4; Skill_Smithing = 5; Skill_Defence = 6; Skill_Herblore = 7; Skill_Fishing = 8; Skill_Range = 9; Skill_Thieving = 10; Skill_Cooking = 11; Skill_Prayer = 12; Skill_Crafting = 13; Skill_Firemaking = 14; Skill_Magic = 15; Skill_Fletching = 16; Skill_Woodcutting = 17; Skill_Runecrafting = 18; Skill_Slayer = 19; Skill_Farming = 20; Skill_Construction = 21; Skill_Hunter = 22;[/sCAR] [sCAR] * function GetAllEquipSlotsBounds: TBoxArray; By: Wanted * function GetEquipSlotBounds(Slot: Integer): TBox; By: Wanted * function SlotEquipped(Slot: Integer; CheckET: Boolean): Boolean; By: Home & Wanted. * function MouseEquipItem(Slot: Integer; TypeC: ClickActions; CheckET: Boolean): Boolean; By: Wanted[/sCAR] [sCAR]{$DEFINE RS07} {$I OSI\OSI.scar} {$I OSI\Divi\Misc\Debug.scar} procedure ScriptTerminate; begin FreeOSI; end; begin SetUpOSI; DebugTBA(GetAllEquipSlotsBounds); end. [/sCAR] [sCAR] Tab_Equip_Count = 11; Tab_Equip_Head = 0; Tab_Equip_Cape = 1; Tab_Equip_Neck = 2; Tab_Equip_Quiver = 3; Tab_Equip_Weapon = 4; Tab_Equip_Body = 5; Tab_Equip_Shield = 6; Tab_Equip_Legs = 7; Tab_Equip_Gloves = 8; Tab_Equip_Boots = 9; Tab_Equip_Ring = 10;[/sCAR] [sCAR] * function AutoRetaliateEnabled: Boolean; By: Wanted * function ToggleAutoRetaliate(Enable, CheckCT: Boolean): Boolean; By: Wanted * function GetCombatLevel: LongInt; By: Wanted[/sCAR] Still thinking of how to add set fight modes... might push off into \Skill\ not sure yet In case you missed it Options tab is done too http://forums.scar-divi.com/showthread.php?2199-OSI2-RS07-Tab11-Options-scar-complete I added a Mystery Box solver. Remember to call OSI anti-randoms [sCAR]{$DEFINE RS07} {$DEFINE OSI_RS07_Color_Anti_Randoms} {$I OSI\OSI.scar} procedure ScriptTerminate; begin FreeOSI; end; begin SetUpOSI; if (OSIFindRandoms) then WriteLn('OSIFindRandoms returned true'); end. [/sCAR] Core gametabs are now essentially done Moving onto OCR and other areas that need work. Then onwards to bank, worldswitcher, antirandoms etc... I'm closing in on a fairly complete include! Next comes scripts! Biggest ones on my list Power miners Power choppers Power fishers Essence miner Demon slinger Cheers to OSI's progress! -Wanted Quote Link to comment Share on other sites More sharing options...
lazarbeam Posted March 21, 2013 Share Posted March 21, 2013 Phenomenal! Quote Link to comment Share on other sites More sharing options...
Amberleaf Posted March 21, 2013 Share Posted March 21, 2013 (edited) Godlike! As soon as you have those banking functions and procedures sorted I'll be on it like a car bonnet, as the banking functions in MSSL don't seem to work with SMART. =[ Edited March 21, 2013 by Wanted Quote Link to comment Share on other sites More sharing options...
Janilabo Posted March 21, 2013 Share Posted March 21, 2013 (edited) Godlike! As soon as you have those banking functions and procedures sorted I'll be on it like a car bonnet, as the banking functions in MSSL don't seem to work with SMART. =[ Hey mate, what kind of problems are you having with SMART and banking? I tested Withdrawing and bank opening earlier (before RuneScape update by Jagex).. Both worked just fine for me? The problem is, Jagex updated bank booths, they changed the texts. So that broke RS07_OpenBank(), however this will be fixed for next Includes Manager update (waiting for Freddy to get the service back up). But yes, let me know what kind of problems you are having, and I will take a look at em. -Jani Edited March 21, 2013 by Wanted Quote Link to comment Share on other sites More sharing options...
Wanted Posted March 21, 2013 Author Share Posted March 21, 2013 Godlike! As soon as you have those banking functions and procedures sorted I'll be on it like a car bonnet, as the banking functions in MSSL don't seem to work with SMART. =[ All the banking functions are done? Except for bank finder/opener I've always told people to use custom bank openers but I'll make one like I did for OSI 1. Quote Link to comment Share on other sites More sharing options...
Janilabo Posted March 21, 2013 Share Posted March 21, 2013 Godlike! As soon as you have those banking functions and procedures sorted I'll be on it like a car bonnet, as the banking functions in MSSL don't seem to work with SMART. =[ Think you could test with 1.01-2? I fixed the banking problems in it (that were caused because Jagex updated the Bank booths). James, how do you plan building the bank booth detection, do you use certain compass angle for each booth or are you going to support just any angle? I suppose you are sticking with highest camera angle (when collecting colors and such)? Quote Link to comment Share on other sites More sharing options...
Wanted Posted March 22, 2013 Author Share Posted March 22, 2013 Think you could test with 1.01-2? I fixed the banking problems in it (that were caused because Jagex updated the Bank booths). James, how do you plan building the bank booth detection, do you use certain compass angle for each booth or are you going to support just any angle? I suppose you are sticking with highest camera angle (when collecting colors and such)? High angle north. Will look and work a lot like OSI 1 RS2 banking [sCAR]{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= function OpenBankBooth(Loc: Integer): Boolean; Contributors: Wanted, Freddy Description: Opens a booth, true if bankscreen found. Use Loc_VEB etc. Date Created: December 14th, 2011. By Wanted. RS2 Build 688. Last Modified: November 26th, 2012. By Bixby Sayz. RS2 Build 743. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=} function OpenBankBooth(Loc: Integer): Boolean; var BankInfo: TVariantArray; CTS, I, H, T: Integer; ATPA: T2DPointArray; TPA: TPointArray; P: TPoint; begin Result := BankScreen; if (Result) then Exit; // 0 1 2 3 4 5 6 7 8 9 case (Loc) of // | CTS | CTS2 Mods | Color | Tol | Split | W | H | Min | Max | Modified By Build # Loc_LBC: BankInfo := [2, 0.23, 0.35, 9147035, 10, 0, 35, 35, 100, 750]; // December 14, 2011 Wanted 688 Loc_AKB: BankInfo := [2, 0.15, 0.09, 3883077, 14, 0, 35, 35, 100, 900]; // December 14, 2011 Wanted 688 Loc_FEB,{BankInfo := [2, 0.06, 0.21, 5272464, 4, 1, 4, 15, 250, 800];} // December 14, 2011 Wanted 688 Loc_FWB: BankInfo := [2, 0.06, 0.21, 5272464, 4, 1, 4, 15, 250, 800]; // December 14, 2011 Wanted 688 Loc_VEB: BankInfo := [2, 0.07, 1.59, 2181720, 5, 0, 35, 45, 350, 99999]; // December 14, 2011 Wanted 688 Loc_VWB: BankInfo := [2, 0.09, 0.45, 3235696, 3, 0, 35, 35, 150, 600]; // December 14, 2011 Wanted 688 Loc_DYB,{BankInfo := [2, 0.37, 0.48, 4083025, 2, 0, 35, 35, 500, 99999];}// December 14, 2011 Wanted 688 Loc_EVB: BankInfo := [2, 0.37, 0.48, 4083025, 2, 0, 35, 35, 500, 99999]; // December 14, 2011 Wanted 688 else Exit; end; CTS := GetColorToleranceSpeed; ColorToleranceSpeed(BankInfo[0]); SetColorSpeed2Modifiers(BankInfo[1], BankInfo[2]); FindColorSpiralTolEx(MSCX, MSCY, TPA, BankInfo[3], MSX1, MSY1, MSX2, MSY2, BankInfo[4]); SetColorspeed2Modifiers(0.2, 0.2); ColorToleranceSpeed(CTS); if (Length(TPA) < 1) then Exit; case (BankInfo[5]) of 0: ATPA := GroupTPAEx(TPA, BankInfo[6], BankInfo[7]); 1: ATPA := SplitTPA(TPA, BankInfo[6]); 2: ATPA := SplitTPAEx(TPA, BankInfo[6], BankInfo[7]); end; if (Length(ATPA) < 1) then Exit; {$IFDEF SCAR338_UP} SortATPAByMeanEx(ATPA, Point(MSCX, MSCY)); {$ELSE} SortATPAByMiddleEx(ATPA, Point(MSCX, MSCY)); {$ENDIF} //DebugATPABounds(ATPA); H := High(ATPA); //for I := 0 to High(ATPA) do //OSI_WriteAndLog(IntToStr(I) + ', ' + IntToStr(Length(ATPA))); for I := 0 to High(ATPA) do if (InRange(Length(ATPA), BankInfo[8], BankInfo[9])) then begin {$IFDEF SCAR338_UP} P := TPAMean(ATPA); {$ELSE} P := TPAMiddle(ATPA); {$ENDIF} MMouse(P.X, P.Y, 2, 2); if ((Loc = Loc_DYB) or (Loc = Loc_EVB)) then begin if (not (IsUpTextMulti(['Bank C', 'k Coun', 'ounter']))) then Continue; end else if (not (IsUpTextMulti(['ank B', 'k Ban', 'Bank b', 'k boot', 'booth']))) then Continue; GetMousePos(P.X, P.Y); Mouse(P.X, P.Y, 0, 0, True); if (WaitFunc(@FlagExists, True, 100, 200, 500, 1000)) then Flag; WaitRR(200, 400); T := GetSystemTime + RR(5000, 7000); repeat if (PinScreen) then if (not (EnterBankPin(Players[CurrentPlayer].Pin, False))) then begin OSI_WriteAndLog('Pin failed!'); Exit; end else begin Result := True; Exit; end; if (BankScreen) then begin Result := True; Exit; end; WaitRR(250, 400); until (GetSystemTime > T); Exit; end; end; {=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= function OpenBankNPC(Loc: Integer): Boolean; Contributors: Wanted, Freddy Description: Opens a bank via Banker, true if bankscreen found. Use Loc_VEB etc. Date Created: December 22nd, 2011. By Wanted. RS2 Build 690. Last Modified: November 26th, 2012. By Bixby Sayz. RS2 Build 743. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=} function OpenBankNPC(Loc: Integer): Boolean; var BankerInfo: TVariantArray; I, H, T, CTS: Integer; ATPA: T2DPointArray; TPA: TPointArray; TBA: TBoxArray; P: TPoint; begin Result := BankScreen; if (Result) then Exit; // 0 1 2 3 4 case (Loc) of // | CTS | CTS2 Mods | Color | Tol Modified By Build # Loc_LBC,{BankerInfo := [2, 0.48, 0.06, 6776940, 7];} // December 22, 2011 Wanted 690 Loc_FEB,{BankerInfo := [2, 0.48, 0.06, 6776940, 7];} // December 22, 2011 Wanted 690 Loc_FWB,{BankerInfo := [2, 0.48, 0.06, 6776940, 7];} // December 22, 2011 Wanted 690 Loc_AKB: BankerInfo := [2, 0.48, 0.06, 6776940, 7]; // December 22, 2011 Wanted 690 Loc_EVB,{BankerInfo := [2, 0.14, 0.76, 4533556, 11];}// December 22, 2011 Wanted 690 Loc_VEB,{BankerInfo := [2, 0.14, 0.76, 4533556, 11];}// December 22, 2011 Wanted 690 Loc_VWB: BankerInfo := [2, 0.14, 0.76, 4533556, 11]; // December 22, 2011 Wanted 690 Loc_DYB: BankerInfo := [2, 0.21, 0.07, 7633020, 20]; // December 22, 2011 Wanted 690 Loc_GEB: BankerInfo := [2, 0.42, 0.14, 6053473, 6]; // December 22, 2011 Wanted 690 else Exit; end; ATPA := FindMMDotsExOverLap([cldYellowDot]); TPA := MMsToMSs(ATPA[0]); SortTPAEx(TPA, Point(MSCX, MSCY)); H := High(TPA); SetLength(TBA, H + 1); for I := 0 to H do TBA := Box(TPA.X - 30, TPA.Y - 30, TPA.X + 30, TPA.Y + 30); ConstrainBoxes(TBA, MSX1, MSY1, MSX2, MSY2); for I := 0 to H do begin CTS := GetColorToleranceSpeed; ColorToleranceSpeed(BankerInfo[0]); SetColorSpeed2Modifiers(BankerInfo[1], BankerInfo[2]); FindColorTolEx(TPA, BankerInfo[3], TBA.X1, TBA.Y1, TBA.X2, TBA.Y2, BankerInfo[4]); SetColorspeed2Modifiers(0.2, 0.2); ColorToleranceSpeed(CTS); ATPA := SplitTPA(TPA, 5); if (Length(ATPA) < 1) then Continue; SortATPASize(ATPA, True); {$IFDEF SCAR338_UP} P := TPAMean(ATPA[0]); {$ELSE} P := TPAMiddle(ATPA[0]); {$ENDIF} MMouse(P.X, P.Y, 0, 0); if (not (IsUpTextMulti(['to B', 'anker']))) then Continue; GetMousePos(P.X, P.Y); Mouse(P.X, P.Y, 0, 0, False); if (not (ChooseOptionMulti(['Bank B', 'k B']))) then Continue; if (WaitFunc(@FlagExists, True, 100, 200, 500, 1000)) then Flag; WaitRR(200, 400); T := GetSystemTime + RR(5000, 7000); repeat if (PinScreen) then if (not (EnterBankPin(Players[CurrentPlayer].Pin, False))) then begin OSI_WriteAndLog('Pin failed!'); Exit; end else begin Result := True; Exit; end; if (BankScreen) then begin Result := True; Exit; end; WaitRR(250, 400); until (GetSystemTime > T); Continue; end; end; {=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= function OpenBankEx(Loc: Integer; AllowNPC, AllowBooth, TryBoothFirst: Boolean): Boolean; Contributors: Wanted Description: Opens bank using custom settings, true if bankscreen found. Use Loc_VEB etc. Date Created: December 22nd, 2011. By Wanted. RS2 Build 690. Last Modified: December 22nd, 2011. By Wanted. RS2 Build 690. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=} function OpenBankEx(Loc: Integer; AllowNPC, AllowBooth, TryBoothFirst: Boolean): Boolean; begin Result := False; if (not (AllowBooth)) then TryBoothFirst := False; if (TryBoothFirst) then begin if (not (OpenBankBooth(Loc))) then if (AllowNPC) then begin if (not (OpenBankNPC(Loc))) then Exit; end else Exit; Result := True; Exit; end else begin if (not (OpenBankNPC(Loc))) then if (AllowBooth) then begin if (not (OpenBankBooth(Loc))) then Exit; end else Exit; Result := True; Exit; end; end; {=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= function OpenBank(Loc: Integer): Boolean; Contributors: Wanted Description: Opens bank using recommended settings, true if bankscreen found. Use Loc_VEB etc. Date Created: December 22nd, 2011. By Wanted. RS2 Build 690. Last Modified: December 22nd, 2011. By Wanted. RS2 Build 690. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=} function OpenBank(Loc: Integer): Boolean; begin case (Loc) of Loc_DYB, Loc_EVB, Loc_AKB: Result := OpenBankEx(Loc, True, True, False); else Result := OpenBankEx(Loc, True, True, True); end; end;[/sCAR] Quote Link to comment Share on other sites More sharing options...