SCAR Code:
program MithrilSuperheater;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/magic.scar}
{---------------------------------------------------------------------------]
[ d[-_-]b :: Mithril Superheater :: d[-_-]b ]
[---------------------------------------------------------------------------]
[ Created by: Macros, for Scar 3.15+ and SRL 28+ ]
[ Last Update : 11/8/2008 ]
[ ]
[ 1. Customize the basic setup, and player array. ]
[ 2. Use with Low Detail, Very Bright. ]
[ 3. Equip a Fire Staff. ]
[ 4. Position player in desired bank, (see basic setup). ]
[ 5. Have an adequate amount of Nature Runes in the last inventory space. ]
[ 6. Put any item in the first bank space, mithril ore in the second ]
[ and coal in third, (in the first, (infinity symbol), tab). ]
[ 7. Strongly suggested that you place one Mithril Ore in the twelfth ]
[ inventory spot, (right on top of the Superheat spell). ]
[ 8. Select the client, and hit run! (Oh and make sure you've typed in your ]
[ bank PIN, it doesn't guess them =p ]
[---------------------------------------------------------------------------}
{------------------------------------------------------------------------------]
Basic script setup.
-------------------------------------------------------------------------------}
var
MithrilBarDTM, MithrilOreDTM, CoalDTM, SuperheatDTM,
l, loads, x, y: integer;
const
StartPlayer = 0; //Determines who will play first.
MSpeed = 50; //Speed of the mouse, (higher=faster, recommended 40-60).
DropRandomItems = False; //Drop the items you get from random events, such as gems and coins?
BankName = 'veb'; //Search for "OpenBankQuiet" in the SRL Manual for a list of valid abbreviations.
RandomSkill = 'Prayer'; //Which skill would you like to use Genie Lamps on, (if any are recieved).
CompassDirection = 'S'; //Insert a direction that will show lots of bank windows in your desired bank, (first letter only).
PlayerSuperheats = 25; //How many Mithril Bars would you like to superheat?
Version = '0.21'; //Script version, (don't change).
//YourSRLID = 'Username'; //Your SRL User ID. (for when the script is done)
//YourSRLPass = 'Password'; //Your SRL User Pass. (for when the script is done)
{------------------------------------------------------------------------------]
Declare Players
-------------------------------------------------------------------------------}
procedure DeclarePlayers; //More arrays when script is done...
begin
HowManyPlayers := 1; //Set Number of Players here.
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := StartPlayer;
Players[0].Name := 'Username'; //Username
Players[0].Pass := 'Password'; //Password
Players[0].Nick := 'Nickname'; //3-4 consecutive letters of your user name, (ex: "Nickname" -> "ick").
Players[0].Strings[0] := 'mithril'; //Type of bar, (only use with mithril at the moment).
Players[0].Active := True; //Say, are you going to use this player?
end;
{------------------------------------------------------------------------------]
NO NEED TO CHANGE ANYTHING BELOW THIS LINE... Hit run and post proggies!
[------------------------------------------------------------------------------}
{------------------------------------------------------------------------------]
AntiBan!
[------------------------------------------------------------------------------}
procedure AntiBan;
begin
if not LoggedIn then Exit;
case Random(10) of
1: HoverSkill('Smithing', False);
2: HoverSkill('Magic', False);
end;
end;
{------------------------------------------------------------------------------]
Deposit all except... //NOT IN USE ATM
[------------------------------------------------------------------------------}
{NOTE: Procedure edited by Sandstorm, (originally made by: WT-Fakawi/PPLSUQBAWLZ/Stupid3ooo/Town}
{Description: Deposits from Slot to ToSlot, skipping user defined slots.
vType True = Deposit All. vType False = Deposit one by one.
Any integer is deposit with Deposit X. (except for 5 and 10)}
//Procedure DepositExcept(SlotFrom, SlotTo: Integer; vType: Variant; ItemsToSkip: Array of Integer);
Procedure DepositExcept(SlotFrom, SlotTo: Integer; vType: Variant; ItemsToSkip: Array of Integer);
Var
DepositX: Boolean;
All: Variant;
I, T, x, y: Integer;
Begin
If Not BankScreen Then
Exit;
If vType = 2 Then
srl_Warn('Deposit', '2 now means store per 2, not ''All''', 15);
DepositX := False;
Case VarType(vType) Of
3: Begin
DepositX := Not InIntArray([1, 5, 10], vType);
If vType = 1 Then
All := False
Else
All := True;
End;
11: All := vType;
End;
For I := SlotFrom To SlotTo Do
Begin
If Not ExistsItem(I) Then
Continue;
If not(InIntArray(ItemsToSkip, I)) Then
MouseItem(I, Not All);
If DepositX Then
Begin
ChooseOption('Deposit-X');
T := GetSystemTime;
While (Not FindColor(x, y, 8388608, MCX1, MCY1, MCX2, MCY2)) And (GetSystemTime - T < 3000) Do
Wait(100);
TypeSend(vType);
End Else If VarType(vType) = 3 Then
ChooseOption('Deposit-' + vType)
Else
ChooseOption('Deposit-All');
T := GetSystemTime;
Wait(RandomRange(200, 300));
While ExistsItem(I) And (GetSystemTime - T < 2000) Do
Wait(50);
End;
End;
{------------------------------------------------------------------------------]
"Find" the ore!
[------------------------------------------------------------------------------}
function FindOre(oreType: string; var rx, ry: integer; x1, y1, x2, y2: integer):
boolean;
var
ore, oreColor: integer;
oreMP: TDTMPointDef;
oreSP: array of TDTMPointDef;
oreSkel: TDTM;
begin
case lowercase(oreType) of
'coal': oreColor := 2570553;
'mithril': oreColor := 7425357;
else
begin
writeln('Desired ore type(s) not found!');
exit;
end;
end;
setarraylength(oreSP, 4);
oreMP.x := 580;
oreMP.y := 229;
oreMP.areasize := 1;
oreMP.areashape := 0;
oreMP.color := oreColor;
oreMP.tolerance := 15;
oreSP[0].x := 576;
oreSP[0].y := 227;
oreSP[0].areasize := 1;
oreSP[0].areashape := 0;
oreSP[0].color := 65536;
oreSP[0].tolerance := 0;
oreSP[1].x := 574;
oreSP[1].y := 229;
oreSP[1].areasize := 1;
oreSP[1].areashape := 0;
oreSP[1].color := 65536;
oreSP[1].tolerance := 0;
oreSP[2].x := 563;
oreSP[2].y := 230;
oreSP[2].areasize := 1;
oreSP[2].areashape := 0;
oreSP[2].color := 65536;
oreSP[2].tolerance := 0;
oreSP[3].x := 592;
oreSP[3].y := 227;
oreSP[3].areasize := 1;
oreSP[3].areashape := 0;
oreSP[3].color := 65536;
oreSP[3].tolerance := 0;
oreSkel.MainPoint := oreMP;
oreSkel.SubPoints := oreSP;
ore := AddDTM(oreSkel);
result := findDTM(ore, rx, ry, x1, y1, x2, y2);
end;
{------------------------------------------------------------------------------]
Withdraw ores from the bank.
[------------------------------------------------------------------------------}
procedure WithdrawOres;
begin;
l := 0
if (not (Loggedin)) then exit;
if (not (bankscreen)) then exit;
case lowercase(players[currentplayer].Strings[0]) of
'mithril':
begin
if FindDTM(MithrilOreDTM, x, y, 680, 275, 725, 320) then
begin
writeln('Mithril Ore found in slot 12'); //continues, this is where I'll be adding that try/catch...
end else
begin
if findOre('mithril', x, y, msx1, msy1, msx2, msy2) then
begin
Withdraw(2,1,1); //withdraws one ore, but now I want to move it to inven. slot 12
if FindDTM(MithrilOreDTM, x, y, 555, 205, 600, 250) then
begin
ItemCoords(1); //pretty sure this part will work for moving the ore to slot 12
HoldMouse(x, y, True);
ItemCoords(12);
MMouse(x, y, 5, 5);
GetMousePos(x, y);
ReleaseMouse(x, y, true);
end else
begin
writeln('Can not find Mithril Ore in inventory!');
end;
end else
begin
writeln('Can not find Mithril Ore in bank! (I)');
terminatescript;
end;
end;
end;
begin
if findOre('mithril', x, y, msx1, msy1, msx2, msy2) then
begin
Withdraw(2,1,5);
end else
begin
writeln('Can not find Mithril Ore! (II)');
terminatescript;
end;
end;
wait(100 + random(50));
begin
if findOre('coal', x, y, msx1, msy1, msx2, msy2) then
begin
Withdraw(3,1,10)
Wait(100 + random(50));
Withdraw(3,1,10)
Wait(300 + random(100));
end else
begin
writeln('Can not find Coal!');
terminatescript;
end;
CloseBank;
Wait(50 + random(50));
end;
end;
end;
end;
{------------------------------------------------------------------------------]
Cast the spell: Superheat, (five times).
[------------------------------------------------------------------------------}
procedure CastSuperheat;
var
i: Integer;
begin
i:= 0;
Wait(25 + random(50));
GameTab(7);
//Mouse(740, 180, 5, 5, True);
repeat
if (not (Loggedin)) then exit;
if FindDTM(SuperheatDTM, x, y, 670, 285, 710, 315) then
begin
Mouse(x+2, y, 1, 3, True);
end;
Wait(25 + random(50));
if findOre(players[currentplayer].Strings[0], x, y, MIX1, MIY1, MIX2, MiY2) then
begin
MMouse(x, y, 5, 5);
wait(25 + random(50));
{if IsUpText('ith') then
begin
Mouse(x, y, 5, 5, True);
Wait(1250 + random(250));
i:= i + 1;
end else}
if IsUpText('ith') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Wait(1250 + random(250));
i:= i + 1;
end else
begin
Writeln('Incorret uptext.');
exit;
end;
end else
begin
writeln('Can not find ore.');
exit;
end;
until(i >= 5);
AntiBan;
end;
{------------------------------------------------------------------------------]
Load the DTMs.
[------------------------------------------------------------------------------}
procedure LoadDTMs;
begin
MithrilBarDTM := DTMFromString('78DA6394606060106540018E8EF10C3C409A1' +
'188FF0301238823C18006189148200D32839F801A5922D4280109' +
'21026A5488700FC82E7922DCAC845F0D00D9240685');
MithrilOreDTM := DTMFromString('78DA6394626060906040017EFEC50C3C409A1' +
'188FF030123279021CE8006189148202D06243809A8510012DC04' +
'D4A8030901026A948184141176C913502344580D00094106B0');
CoalDTM := DTMFromString('78DA639461606010634001D6561A0C3C409A1' +
'188FF03012337A61A882C8C04D222404280801A0920C149408D3A' +
'90E025420D21F728020979026A2481840A0135203FC9E15703007' +
'76E0674');
SuperheatDTM := DTMFromString('78DA639460606090614001BF2245197880342' +
'310FF0702461C6A18A06AC0B40090906640038CA86A0481841001' +
'359244A85104126204D428010979026A40F24A04D40813560300F' +
'88F08C1');
end;
{------------------------------------------------------------------------------]
Bank the Mithil Bars.
[------------------------------------------------------------------------------}
procedure Bank;
var
time: Integer;
begin
MarkTime(time);
repeat
if (not (Loggedin)) then break;
OpenBankFast(BankName)
until (BankScreen or (TimeFromMark(time) > 100000));
if FindDTM(MithrilBarDTM, x, y, 550, 210, 600, 245) then //FIX coordinates
begin
Deposit(1,5,5);
end else
begin
DepositExcept(1, 27, True, []); //Procedure DepositExcept(SlotFrom, SlotTo: Integer; vType: Variant; ItemsToSkip: Array of Integer);
end;
loads := loads + 1;
end;
{------------------------------------------------------------------------------]
Progress Report.
[------------------------------------------------------------------------------}
procedure ProgressReport;
begin
ClearDebug;
Writeln('Version 0.21 by: Macros, (credits to wtfwtfwtf and Sand Storm as well).');
Writeln('Worked for ' + TimeRunning + '.');
Writeln('Banked ' + inttostr(Loads) + ' time(s).');
end;
{------------------------------------------------------------------------------]
Setup!
[------------------------------------------------------------------------------}
procedure Setup;
begin;
ClearDebug;
SetupSRL;
LoadDTMs;
ActivateClient;
DeclarePlayers;
LoginPlayer;
//SRLID := YourSRLID; (for when the script is done)
//SRLPassword := YourSRLPass; (for when the script is done)
MakeCompass('CompassDirection');
SetAngle(true);
end;
begin
setup;
repeat
OpenBankFast(BankName);
WithdrawOres;
CastSuperheat;
LampSkill := RandomSkill;
FindNormalRandoms;
Bank;
ProgressReport;
until (Loads = (PlayerSuperheats/5));
if (Players[CurrentPlayer].Active = false) then
begin
CloseBank;
LogOut;
terminatescript;
end;
end.