Tootoot222
2008-11-01 03:48:11
<!– BEGIN TEMPLATE: formanswers –>
tootoot222 - SRL Member Application Form
tootoot222
What is the meaning to life?
Where you Referred to SRL? If yes, by whom?
no
Programming Knowledge
Java, C++, Delphi, tiny little bit of Html
Other Communitys
Freddy1990 forums
How Long have You Played Runescape
2-3 years
Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.
Well, about me, I'm a teenager who likes to script in SCAR, and I play RuneScape occationally… uhh… not much else, I guess…
——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted
o_0 i have to post it here? it's like 900 lines long…
If you get an error in WorldSwitcher.scar about line 75, replace line 75 with:
——————————————————
<!– END TEMPLATE: formanswers –>
tootoot222 - SRL Member Application Form
tootoot222
What is the meaning to life?
Where you Referred to SRL? If yes, by whom?
no
Programming Knowledge
Java, C++, Delphi, tiny little bit of Html
Other Communitys
Freddy1990 forums
How Long have You Played Runescape
2-3 years
Are you affilated in anyway with Jagex LTD?
No
—————————————————–
Please write down a paragraph about Yourself.
Well, about me, I'm a teenager who likes to script in SCAR, and I play RuneScape occationally… uhh… not much else, I guess…
——————————————————
Please Post a Sample of your Work. Only SCAR Scripts Accepted
o_0 i have to post it here? it's like 900 lines long…
////////////////////////////////////////////////////////////////////////////////
//Script Name: TootMageSmither. //
//Created By: Tootoot2222. //
//Script Version: 2.0. //
//Purpose: Uses the "Superheat ore" spell to smith ores in your inventory. //
//Scar Version: 3.15b not tested on 3.20 beta 7. //
//SRL Version: Revision #28. //
//Usage: Setup lines 136 - 160 (more if you want copy + paste more players). //
// Refer to the charts at lines 98 - 134 to fill out some of the stuff. //
// Make sure that you have the ores you need in the bank, //
// and some nature runes in your inventory. //
// If you don't have a fire staff (or such) equipped //
// then put that player's Booleans[Player_Bln_Fire] to True. //
// Change line 27 to False if you don't want to use SMART. //
// Also comment out (put // before) line 21 if you arn't using SMART. //
// If you're using SMART, and you close the debug window, //
// just hit F12 to bring it back up. //
////////////////////////////////////////////////////////////////////////////////
program TootMageSmither;
{.include SRL\SRL\Misc\Smart.scar}
{.include SRL\SRL.scar}
{.include SRL\SRL\Skill\Magic.scar}
{.include SRL\SRL\Misc\WorldSwitcher.scar}
const
UsingSmart = True; //Change this if not using SMART
NatTolerance1 = 25; //Change this if the script is unable to find nature runes
NatTolerance2 = 5; //Only if using masks
FireTolerance1 = 25; //Change this if the script is unable to find fire runes
FireTolerance2 = 5; //Only if using masks
{*******************************************************************************
DO NO EDIT LINES 38 - 93! NOT EVEN IF YOU KNOW WHAT YOURE DOING!!
*******************************************************************************}
Script_Falador_East_Bank = 'feb';
Script_Falador_West_Bank = 'fwb';
Script_Varrock_East_Bank = 'veb';
Script_Varrock_West_Bank = 'vwb';
Script_Draynor_Bank = 'db';
Script_Al_Kharid_Bank = 'akb';
Script_Lumbridge_Bank = 'lb';
Player_Str_Bank = 0; //Name of the bank we're at (2-3 letter name)
Player_Str_Ore1 = 1; //Name of Ore1
Player_Str_Ore2 = 2; //Name of Ore2
Player_Str_BarN = 3; //Name of Bar
Player_Str_Or1T = 4; //Type of thing to search for for Ore1 (bmp, mask, dtm, color)
Player_Str_Or2T = 5; //Type of thing to search for for Ore2 (bmp, mask, dtm, color)
Player_Str_BarT = 6; //Type of thing to search for for Bar (bmp, mask, dtm, color)
Player_Int_Make = 0; //What we're making
Player_Int_Bars = 1; //How many bars we're making
Player_Int_CBar = 2; //How many bars we have in the inv
Player_Int_SNat = 3; //Starting amount of nature runes
Player_Int_CNat = 4; //Current amount of nature runes
Player_Int_SFir = 5; //Starting amount of fire runes
Player_Int_CFir = 6; //Current amount of fire runes
Player_Int_Ore1 = 7; //What main ore we're smithing
Player_Int_Ore2 = 8; //What secondary ore we're smithing
Player_Int_BarP = 9; //What bar we're smithing
Player_Int_2Pr1 = 10; //The ratio of Ore2 to Ore1
Player_Int_Invs = 11; //Amount of unchanging inventory slots
Player_Int_Rnd1 = 12; //Amount of numbers we can take off of Ore1's name
Player_Int_Rnd2 = 13; //Amount of numbers we can take off of Ore2's name
Player_Int_AO1N = 14; //Amount of Ore1 we're supposed to have
Player_Int_AO2N = 15; //Amount of Ore2 we're supposed to have
Player_Int_AO1I = 16; //Amount of Ore1 in the inventory
Player_Int_AO2I = 17; //Amount of Ore2 in the inventory
Player_Bln_Fire = 0; //Fire runes?
Player_Bln_Ore1 = 1; //Do we have Ore1 in the bank?
Player_Bln_Ore2 = 2; //Do we have Ore2 in the bank?
Player_Bln_Memb = 3; //Are we a member?
Player_Mak_Brnz = 0; //Code for Bronze
Player_Mak_Iron = 1; //Code for Iron
Player_Mak_Slvr = 2; //Code for Silver
Player_Mak_Gold = 3; //Code for Gold
Player_Mak_Mith = 4; //Code for Mithril
Player_Mak_Addy = 5; //Code for Adamantite
Player_Mak_Rune = 6; //Code for Runeite
var
bmp_NatureRune, bmp_FireRune: Integer;
Type_NatureRune, Type_FireRune: String;
NatureTolerance, FireTolerance: TIntegerArray;
Tolerance: array of array [1..3] of array [0..1] of Integer;
//Woohoo! 3 dimensional array!
SingleOre, ShowingDebug: Boolean;
procedure DeclarePlayers;
begin
{
Bank:
'feb' = (Falador East Bank)
'fwb' = (Falador West Bank)
'veb' = (Varrock East Bank)
'vwb' = (Varrock West Bank)
'db' = (Draynor Bank)
'akb' = (Al-Kharid Bank)
'lb' = (Lumbridge Bank)
Alternately, you could use:
Script_Falador_East_Bank = 'feb';
Script_Falador_West_Bank = 'fwb';
Script_Varrock_East_Bank = 'veb';
Script_Varrock_West_Bank = 'vwb';
Script_Draynor_Bank = 'db';
Script_Al_Kharid_Bank = 'akb';
Script_Lumbridge_Bank = 'lb';
Make:
Bronze = 0;
Iron = 1;
Silver = 2;
Gold = 3;
Mith = 4;
Addy = 5;
Rune = 6;
Alternately, you could use:
Player_Mak_Brnz = 0;
Player_Mak_Iron = 1;
Player_Mak_Slvr = 2;
Player_Mak_Gold = 3;
Player_Mak_Mith = 4;
Player_Mak_Addy = 5;
Player_Mak_Rune = 6;
Bars:
0 = Smith until you run out of natures or ores
Anything else = Amount of bars to make/Amount of nature runes to use (it's the same)
}
NumberOfPlayers(1);
CurrentPlayer:= 0;
Players[0].Name:= ''; //Username
Players[0].Pass:= ''; //Password
Players[0].Nick:= ''; //Nickname (2-5 letters of your name with no spaces)
Players[0].Pin:= ''; //Bank pin
Players[0].Active:= True; //Are we using this player?
Players[0].Strings[Player_Str_Bank]:= ''; //What bank are we starting at? (refer to charts above)
Players[0].Integers[Player_Int_Make]:= 0; //What are we making? (refer to charts above)
Players[0].Integers[Player_Int_Bars]:= 0; //How many bars to smith? (refer to charts above)
Players[0].Booleans[Player_Bln_Fire]:= True; //Do we have fire runes in our inventory?
Players[0].Booleans[Player_Bln_Memb]:= False; //De we have a members account?
{
Players[1].Name:= ''; //Username
Players[1].Pass:= ''; //Password
Players[1].Nick:= ''; //Nickname (2-5 letters of your name with no spaces)
Players[1].Pin:= ''; //Bank pin
Players[1].Active:= True; //Are we using this player?
Players[1].Strings[Player_Str_Bank]:= ''; //What bank are we starting at? (refer to charts above)
Players[1].Integers[Player_Int_Make]:= 0; //What are we making? (refer to charts above)
Players[1].Integers[Player_Int_Bars]:= 0; //How many bars to smith? (refer to charts above)
Players[1].Booleans[Player_Bln_Fire]:= True; //Do we have fire runes in our inventory?
Players[1].Booleans[Player_Bln_Memb]:= False; //De we have a members account?
}
SetLength(Tolerance, Length(Players));
end;
{*******************************************************************************
DO NO EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING!
*******************************************************************************}
{*******************************************************************************
LAST WARNING! LAST WARNING! LAST WARNING! LAST WARNING! LAST WARNING!
*******************************************************************************}
{*******************************************************************************
procedure NextPlayer2(Active: Boolean);
By: Dankness and modified by Ron and by Raymond and Tootoot222
Description: Logs in the next player.
Boolean: True - Current player is ok. False - Current player is false.
Doesn't go into an infinate loop when all players are false
*******************************************************************************}
procedure NextPlayer2(Active: Boolean);
begin
if RandomPlayer then
RandomNextPlayer(Active)
else
begin
WriteLn('NextPlayer2(Active: ' + BoolToStr(Active)+ ');');
Players[CurrentPlayer].Active := Active;
Logout;
PlayerCurTime := (GetSystemTime div 1000);
Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked +
((PlayerCurTime - PlayerStartTime) / 60);
if(AllPlayersInactive) then
Exit;
CurrentPlayer := (CurrentPlayer + 1) mod Length(Players);
while Players[CurrentPlayer].Active = False do
CurrentPlayer := (CurrentPlayer + 1) mod Length(Players);
SRL_Logs := SRL_Logs + 1;
LoginPlayer;
end;
end;
{*******************************************************************************
function TimeRunningEx(From: Integer): String;
By: from Phalanx's script/RsN modified by Tootoot222
Description: Returns the time since From.
*******************************************************************************}
function TimeRunningEx(From: Integer): String;
var
RHours, Minutes, Seconds, RMinutes, RSeconds: LongInt;
begin
Seconds := From div 1000;
Minutes := Seconds div 60;
RHours := Minutes div 60;
Result := IntToStr(Seconds) + ' Seconds';
if Minutes <> 0 then
begin
RSeconds := Seconds mod (Minutes * 60);
Result := IntToStr(Minutes) + ' Minutes and ' + IntToStr(RSeconds) +
' Seconds';
end;
if RHours <> 0 then
begin
RMinutes := Minutes mod (RHours * 60);
RSeconds := Seconds mod (Minutes * 60);
Result := IntToStr(RHours) + ' Hours, ' + IntToStr(RMinutes) +
' Minutes and ' + IntToStr(RSeconds) + ' Seconds';
end;
end;
{*******************************************************************************
function FT(var X, Y: Integer; Thing: Integer; ThingType: String;
X1, Y1, X2, Y2: Integer; Tol: array of Integer): Boolean;
By: Tootoot222
Description: Finds "Thing" in x1, y1, x2, y2 and stores the coords in x, y;
*******************************************************************************}
function FT(var X, Y: Integer; Thing: Integer; ThingType: String;
X1, Y1, X2, Y2: Integer; Tol: array of Integer): Boolean;
begin
case Lowercase(ThingType) of
'b', 'bmp', 'bitmap':
Result:= FindBitmapToleranceIn(Thing, X, Y, X1, Y1, X2, Y2, Tol[0]);
'c', 'clr', 'color':
Result:= FindColorTolerance(X, Y, Thing, X1, Y1, X2, Y2, Tol[0]);
'd', 'dtm':
Result:= FindDTM(Thing, X, Y, X1, Y1, X2, Y2);
'm', 'msk', 'bmpmask', 'bitmapmask', 'bmp mask', 'bitmap mask', 'mask':
Result:= FindBitmapMaskTolerance(Thing, X, Y, X1, Y1, X2, Y2, Tol[0], Tol[1]);
end;
end;
{*******************************************************************************
function FindLastInv(Thing: Integer; ThingType: String; Tol: TIntegerArray): Integer;
By: Tootoot222
Description: Returns the inv slot of the last occurrence of Thing in inventory
Returns 0 if Thing is not found
*******************************************************************************}
function FindLastInv(Thing: Integer; ThingType: String; Tol: TIntegerArray): Integer;
var
B: TBox;
X, Y: Integer;
begin
for Result:= 28 downto 1 do
begin
B:= InvBox(Result);
if(ExistsItem(Result)) then
if(FT(X, Y, Thing, ThingType, B.X1, B.Y1, B.X2, B.Y2, Tol)) then
Exit;
end;
Result:= 0;
end;
{*******************************************************************************
function FindFirstInv(Thing: Integer; ThingType: String; Tol: TIntegerArray): Integer;
By: Tootoot222
Description: Returns the inv slot of the first occurrence of Thing in inventory
Returns 0 if Thing is not found
*******************************************************************************}
function FindFirstInv(Thing: Integer; ThingType: String; Tol: TIntegerArray): Integer;
var
B: TBox;
X, Y: Integer;
begin
for Result:= 1 to 28 do
begin
B:= InvBox(Result);
if(ExistsItem(Result)) then
if(FT(X, Y, Thing, ThingType, B.X1, B.Y1, B.X2, B.Y2, Tol)) then
Exit;
end;
Result:= 0;
end;
procedure SetSingleOre;
begin
SingleOre:= InIntArray([Player_Mak_Iron, Player_Mak_Slvr, Player_Mak_Gold], Players[CurrentPlayer].Integers[Player_Int_Make]);
end;
procedure SetPlayer(var P: array of TUser; Current: Integer);
begin
with P[Current] do
begin
case Integers[Player_Int_Make] of
Player_Mak_Brnz:
begin
Integers[Player_Int_Ore1]:= srl_GetBitmap(bmp_Ore_Copper);
Strings[Player_Str_Ore1]:= 'Copper ore';
Strings[Player_Str_Or1T]:= 'bmp';
Integers[Player_Int_Ore2]:= srl_GetBitmap(bmp_Ore_Tin);
Strings[Player_Str_Ore2]:= 'Tin ore';
Strings[Player_Str_Or2T]:= 'bmp';
Integers[Player_Int_BarP]:= srl_GetBitmap(bmp_Bar_Bronze);
Strings[Player_Str_BarN]:= 'Bronze bar';
Strings[Player_Str_BarT]:= 'bmp';
Integers[Player_Int_2Pr1]:= 1;
Integers[Player_Int_Rnd1]:= 7;
Integers[Player_Int_Rnd2]:= 4;
Tolerance[Current][1][0]:= 25;
Tolerance[Current][1][1]:= 5;
Tolerance[Current][2][0]:= 25;
Tolerance[Current][2][1]:= 5;
Tolerance[Current][3][0]:= 25;
Tolerance[Current][3][1]:= 5;
end;
Player_Mak_Iron:
begin
Integers[Player_Int_Ore1]:= srl_GetBitmap(bmp_Ore_Iron);
Strings[Player_Str_Ore1]:= 'Iron ore';
Strings[Player_Str_Or1T]:= 'bmp';
Integers[Player_Int_BarP]:= srl_GetBitmap(bmp_Bar_Iron);
Strings[Player_Str_BarN]:= 'Iron bar';
Strings[Player_Str_BarT]:= 'bmp';
Integers[Player_Int_2Pr1]:= 0;
Integers[Player_Int_Rnd1]:= 2;
Tolerance[Current][1][0]:= 25;
Tolerance[Current][1][1]:= 5;
Tolerance[Current][3][0]:= 25;
Tolerance[Current][3][1]:= 5;
end;
Player_Mak_Slvr:
begin
Integers[Player_Int_Ore1]:= srl_GetBitmap(bmp_Ore_Silver);
Strings[Player_Str_Ore1]:= 'Silver ore';
Strings[Player_Str_Or1T]:= 'bmp';
Integers[Player_Int_BarP]:= srl_GetBitmap(bmp_Bar_Silver);
Strings[Player_Str_BarN]:= 'Silver bar';
Strings[Player_Str_BarT]:= 'bmp';
Integers[Player_Int_2Pr1]:= 0;
Integers[Player_Int_Rnd1]:= 8;
Tolerance[Current][1][0]:= 25;
Tolerance[Current][1][1]:= 5;
Tolerance[Current][3][0]:= 25;
Tolerance[Current][3][1]:= 5;
end;
Player_Mak_Gold:
begin
Integers[Player_Int_Ore1]:= srl_GetBitmap(bmp_Ore_Gold);
Strings[Player_Str_Ore1]:= 'Gold ore';
Strings[Player_Str_Or1T]:= 'bmp';
Integers[Player_Int_BarP]:= srl_GetBitmap(bmp_Bar_Gold);
Strings[Player_Str_BarN]:= 'Gold bar';
Strings[Player_Str_BarT]:= 'bmp';
Integers[Player_Int_2Pr1]:= 0;
Integers[Player_Int_Rnd1]:= 4;
Tolerance[Current][1][0]:= 25;
Tolerance[Current][1][1]:= 5;
Tolerance[Current][3][0]:= 25;
Tolerance[Current][3][1]:= 5;
end;
Player_Mak_Mith:
begin
Integers[Player_Int_Ore1]:= srl_GetBitmap(bmp_Ore_Mithril);
Strings[Player_Str_Ore1]:= 'Mithril ore';
Strings[Player_Str_Or1T]:= 'bmp';
Integers[Player_Int_BarP]:= srl_GetBitmap(bmp_Bar_Mithril);
Strings[Player_Str_BarN]:= 'Mithril bar';
Strings[Player_Str_BarT]:= 'bmp';
Integers[Player_Int_2Pr1]:= 4;
Integers[Player_Int_Rnd1]:= 2;
Tolerance[Current][1][0]:= 25;
Tolerance[Current][1][1]:= 5;
Tolerance[Current][3][0]:= 25;
Tolerance[Current][3][1]:= 5;
end;
Player_Mak_Addy:
begin
Integers[Player_Int_Ore1]:= srl_GetBitmap(bmp_Ore_Adamant);
Strings[Player_Str_Ore1]:= 'Adamantite ore';
Strings[Player_Str_Or1T]:= 'bmp';
Integers[Player_Int_BarP]:= srl_GetBitmap(bmp_Bar_Adamant);
Strings[Player_Str_BarN]:= 'Adamantite bar';
Strings[Player_Str_BarT]:= 'bmp';
Integers[Player_Int_2Pr1]:= 6;
Integers[Player_Int_Rnd1]:= 7;
Tolerance[Current][1][0]:= 25;
Tolerance[Current][1][1]:= 5;
Tolerance[Current][3][0]:= 25;
Tolerance[Current][3][1]:= 5;
end;
Player_Mak_Rune:
begin
Integers[Player_Int_Ore1]:= srl_GetBitmap(bmp_Ore_Runite);
Strings[Player_Str_Ore1]:= 'Runite ore';
Strings[Player_Str_Or1T]:= 'bmp';
Integers[Player_Int_BarP]:= srl_GetBitmap(bmp_Bar_Runite);
Strings[Player_Str_BarN]:= 'Runite bar';
Strings[Player_Str_BarT]:= 'bmp';
Integers[Player_Int_2Pr1]:= 8;
Integers[Player_Int_Rnd1]:= 7;
Tolerance[Current][1][0]:= 25;
Tolerance[Current][1][1]:= 5;
Tolerance[Current][3][0]:= 25;
Tolerance[Current][3][1]:= 5;
end;
end;
case Integers[Player_Int_Make] of
Player_Mak_Mith, Player_Mak_Addy, Player_Mak_Rune:
begin
Integers[Player_Int_Ore2]:= srl_GetBitmap(bmp_Ore_Coal);
Strings[Player_Str_Ore2]:= 'Coal';
Strings[Player_Str_Or2T]:= 'bmp';
Tolerance[Current][2][0]:= 20;
Tolerance[Current][2][1]:= 5;
Integers[Player_Int_Rnd2]:= 1;
end;
end;
end;
SetSingleOre;
end;
function EnoughInv(Needed: Integer): Boolean;
begin
Result:= (28 - InvCount) >= Needed;
end;
function GetRuneCountInv(Thing: Integer; ThingType: String; Tol: TIntegerArray): Integer; forward;
procedure Proggy; forward;
procedure GetPlayerAmnts(P: array of TUser; Current: Integer);
begin
with P[Current] do
begin
Integers[Player_Int_AO1I]:= CountItems(Integers[Player_Int_Ore1], Strings[Player_Str_Or2T], Tolerance[Current][1]);
Wait(3);
if(not(SingleOre)) then
Integers[Player_Int_AO2I]:= CountItems(Integers[Player_Int_Ore2], Strings[Player_Str_Or2T], Tolerance[Current][2]);
Wait(3);
Integers[Player_Int_CBar]:= CountItems(Integers[Player_Int_BarP], Strings[Player_Str_BarT], Tolerance[Current][3]);
Wait(3);
Integers[Player_Int_CNat]:= GetRuneCountInv(bmp_NatureRune, Type_NatureRune, NatureTolerance);
Wait(3);
if(Booleans[Player_Bln_Fire]) then
Integers[Player_Int_CFir]:= GetRuneCountInv(bmp_FireRune, Type_FireRune, FireTolerance);
Wait(3);
Integers[Player_Int_Invs]:= ((InvCount - Integers[Player_Int_AO1I]) - Integers[Player_Int_AO2I]) - Integers[Player_Int_CBar];
Integers[Player_Int_AO1N]:= Trunc((28 - Integers[Player_Int_Invs]) / (Integers[Player_Int_2Pr1] + 1));
Integers[Player_Int_AO2N]:= Integers[Player_Int_AO1N] * Integers[Player_Int_2Pr1];
Proggy;
end;
end;
procedure FreePlayerBmps(var P: TUser);
begin
with P do
begin
FreeBitmap(Integers[Player_Int_Ore1]);
FreeBitmap(Integers[Player_Int_Ore2]);
FreeBitmap(Integers[Player_Int_BarP]);
end;
end;
procedure FreeScriptBmps;
begin
FreeBitmap(bmp_NatureRune);
FreeBitmap(bmp_FireRune);
end;
function GetItemCount(B: TBox): Integer;
var
X, Y, Z, T: Integer;
begin
Result:= 0;
if(FindColor(X, Y, 65536, B.X1, B.Y1, B.X2, B.Y2)) then
begin
Result:= 1;
try
if(FindColor(X, Y, 65535, B.X1, B.Y1, B.X2, B.Y2)) then
if(FindColorSpiral(Z, T, 65535, B.X1, B.Y1, B.X2, B.Y2)) then
Result:= StrToInt(TrimLetters(Replace(Replace(Lowercase(Trim(TrimOthers(GetTextAtEx(Z, Y - 1, 6, StatChars, False, False, 0, 3, 65535, 5, False, tr_AllChars)))), 'k', '000'), 'm', '000000')));
except
end;
end;
end;
function GetBankItemCount(Index: Integer): Integer;
begin
Result:= GetItemCount(BankIndexToMSBox(Index));
end;
function GetInvItemCount(Slot: Integer): Integer;
begin
Result:= GetItemCount(InvBox(Slot));
end;
function GetInvCountEx(Thing: Integer; ThingType: String; Tol: TIntegerArray): Variant;
var
X, Y: Integer;
begin
Result:= False;
X:= FindFirstInv(Thing, ThingType, Tol);
if(not(X < 1)) then
begin
if(ExistsItem(X)) then
begin
Result:= True;
Y:= GetInvItemCount(X);
case Y of
0: Result:= False;
1: Result:= True;
else
Result:= Y;
end;
end;
end;
end;
function GetRuneCountInv(Thing: Integer; ThingType: String; Tol: TIntegerArray): Integer;
var
X: Variant;
begin
X:= GetInvCountEx(Thing, ThingType, Tol);
case X of
True: Result:= 1;
False: Result:= 0;
else
Result:= X;
end;
end;
procedure DepositEx(Amount, Thing: Integer; ThingType: String; Tol: array of Integer);
var
I: Integer;
begin
case Random(2) of
0: I:= FindFirstInv(Thing, ThingType, Tol);
1: I:= FindLastInv(Thing, ThingType, Tol);
end;
if(not(I < 1)) then
Deposit(I, I, Amount);
end;
function WithdrawingNotes(SetIt, ToWhat: Boolean): Boolean;
var
X, Y: Integer;
begin
if(FindColorTolerance(X, Y, 2700606, 230, 310, 230, 310, 15)) then
begin
Result:= True;
if((SetIt) and (not(ToWhat))) then
begin
Mouse(X - 2, Y - 10, 30, 20, True);
Result:= False;
end;
Exit;
end;
if(FindColorTolerance(X, Y, 4279898, 230, 310, 230, 310, 15)) then
begin
Result:= False;
if((SetIt) and (ToWhat)) then
begin
Mouse(X - 2, Y - 10, 30, 20, True);
Result:= True;
end;
Exit;
end;
end;
function GetItemFromBank(Amount, Thing: Integer; ThingType, ThingName: String; Note: Boolean; Tol: array of Integer): Integer;
var
X, Y, T, TT: Integer;
A: Boolean;
B: TBox;
label
Back;
begin
Result:= -1;
if((not(BankScreen)) or not(LoggedIn)) then
Exit;
A:= False;
MarkTime(TT);
Back:
if(not(FT(X, Y, Thing, ThingType, 25, 85, 480, 290, Tol))) then
SearchBank(ThingName);
MarkTime(T);
repeat
Wait(300);
A:= FT(X, Y, Thing, ThingType, 25, 85, 480, 290, Tol);
until((A) or (TimeFromMark(T) > 6000));
if(not(A)) then
if(not(TimeFromMark(T) > 20000)) then
goto Back;
if(A) then
if(GetBankItemCount(BankPointToBankIndex(MSTPointToBankPoint(IntToPoint(X, Y)))) > 0) then
begin
Wait(RandomRange(1000, 1500));
Result:= BankPointToBankIndex(MSTPointToBankPoint(IntToPoint(X, Y)));
B:= BankIndexToMSBox(Result);
WithdrawingNotes(True, Note);
if(Amount = 1) then
MouseBox(B.X1 + 4, B.Y1 + 4, B.X2 - 4, B.Y2 - 4, 1)
else
begin
MouseBox(B.X1 + 4, B.Y1 + 4, B.X2 - 4, B.Y2 - 4, 2);
Wait(RandomRange(200, 250));
if((Amount = 0) or (Amount >= (28 - InvCount))) then
ChooseOption('Withdraw-All')
else
if(Amount = -1) then
ChooseOption('Withdraw-All but one')
else
if(not(ChooseOption('Withdraw-' + IntToStr(Amount)))) then
if(ChooseOption('Withdraw-X')) then
begin
Wait(1000 + Random(100));
TypeSend(IntToStr(Amount));
end;
end;
end else
Result:= -2;
end;
function SearchWithdrawEx(Amount, Thing: Integer; ThingType, ThingName: String; Tol: array of Integer): Boolean;
var
I, T: Integer;
begin
Result:= False;
MarkTime(T);
repeat
if((not(BankScreen)) or (not(LoggedIn))) then
Exit;
I:= CountItems(Thing, ThingType, Tol);
if(I = Amount) then
begin
Result:= True;
Exit;
end else
if(I > Amount) then
begin
DepositEx(I - Amount, Thing, ThingType, Tol);
Result:= True;
end else
if(EnoughInv(Amount - I)) then
begin
if(GetItemFromBank(Amount - I, Thing, ThingType, ThingName, False, Tol) = -2) then
Result:= False;
end;
Wait(RandomRange(1000, 1500));
until((CountItems(Thing, ThingType, Tol) = Amount) or (TimeFromMark(T) > 30000));
Result:= True;
end;
procedure GetRightOreAmounts;
begin
if((not(BankScreen)) or (not(LoggedIn))) then
Exit;
WithdrawingNotes(True, False);
with Players[CurrentPlayer] do
begin
GetPlayerAmnts(Players, CurrentPlayer);
DepositEx(Integers[Player_Int_CBar], Integers[Player_Int_BarP], Strings[Player_Str_BarT], Tolerance[CurrentPlayer][3]);
Banked:= Banked + Integers[Player_Int_CBar];
GetPlayerAmnts(Players, CurrentPlayer);
if(not(SearchWithdrawEx(Integers[Player_Int_AO1N], Integers[Player_Int_Ore1], Strings[Player_Str_Or1T], Copy(Lowercase(Strings[Player_Str_Ore1]), 0, Length(Strings[Player_Str_Ore1]) - Random(Integers[Player_Int_Rnd1])), Tolerance[CurrentPlayer][1]))) then
begin
Booleans[Player_Bln_Ore1]:= False;
GetPlayerAmnts(Players, CurrentPlayer);
if(not(EnoughInv(Integers[Player_Int_AO1N] - CountItems(Integers[Player_Int_Ore1], Strings[Player_Str_Or1T], Tolerance[CurrentPlayer][1])))) then
if(not(SingleOre)) then
begin
DepositEx(Integers[Player_Int_AO1N] - Integers[Player_Int_AO2I], Integers[Player_Int_Ore2], Strings[Player_Str_Or2T], Tolerance[CurrentPlayer][2]);
if(SearchWithdrawEx(Integers[Player_Int_AO1N], Integers[Player_Int_Ore1], Strings[Player_Str_Or1T], Copy(Lowercase(Strings[Player_Str_Ore1]), 0, Length(Strings[Player_Str_Ore1]) - Random(Integers[Player_Int_Rnd1])), Tolerance[CurrentPlayer][1])) then
Booleans[Player_Bln_Ore1]:= True
else
Booleans[Player_Bln_Ore1]:= False;
end;
end else
Booleans[Player_Bln_Ore1]:= True;
GetPlayerAmnts(Players, CurrentPlayer);
if(SearchWithdrawEx(Integers[Player_Int_AO2N], Integers[Player_Int_Ore2], Strings[Player_Str_Or2T], Copy(Lowercase(Strings[Player_Str_Ore2]), 0, Length(Strings[Player_Str_Ore2]) - Random(Integers[Player_Int_Rnd2])), Tolerance[CurrentPlayer][2])) then
Booleans[Player_Bln_Ore2]:= True
else
Booleans[Player_Bln_Ore2]:= False;
end;
end;
procedure Bank;
begin
FindNormalRandoms;
OpenBank(Players[CurrentPlayer].Strings[Player_Str_Bank], True, True);
FindNormalRandoms;
Wait(500 + Random(1000));
FindNormalRandoms;
InPin(Players[CurrentPlayer].Pin);
FindNormalRandoms;
Wait(100 + Random(100));
FindNormalRandoms;
GetRightOreAmounts;
CloseBank;
FindNormalRandoms;
Wait(500 + Random(1000));
FindNormalRandoms;
end;
procedure Smith;
var
B: TBox;
I, T, TT: Integer;
begin
repeat
GameTab(7);
CastSpell(26);
MarkTime(T);
MarkTime(TT);
repeat
Wait(300);
if(TimeFromMark(T) > 2000) then
if(TimeFromMark(TT) > 20000) then
Exit
else
FindNormalRandoms;
until(GetCurrentTab = 4);
FindNormalRandoms;
Wait(10);
GetPlayerAmnts(Players, CurrentPlayer);
with Players[CurrentPlayer] do
I:= FindLastInv(Integers[Player_Int_Ore1], Strings[Player_Str_Or1T], Tolerance[CurrentPlayer][1]);
if(I > 15) then
with Players[CurrentPlayer] do
I:= FindFirstInv(Integers[Player_Int_Ore1], Strings[Player_Str_Or1T], Tolerance[CurrentPlayer][1]);
if(I = 0) then
Break;
GetInvItemBounds(I, B);
with B do
MouseBox(X1 + 4, Y1 + 4, X2 - 4, Y2 - 4, 1);
MarkTime(T);
MarkTime(TT);
repeat
Wait(300);
if(TimeFromMark(T) > 2000) then
if(TimeFromMark(TT) > 20000) then
Exit
else
FindNormalRandoms;
until(GetCurrentTab = 7);
until(False);
MouseBox(630, 170, 655, 200, 1);
end;
procedure CopyClient; forward;
procedure ReadToCopy;
begin
ClearTimeouts;
if(IsFKeyDown(12)) then
begin
WRiteln('moo');
CopyClient;
end else
SetTimeout(1, 'ReadToCopy');
end;
{*******************************************************************************
procedure CopyClient;
By: Tootoot222
Description: Copies the client and puts the image of it onto the debug window
Usage: Press F12 to start copying, and press F11 to stop (you can start back
again by just pressing F12)
*******************************************************************************}
procedure CopyClient;
var
W, H, X, Y, T: Integer;
A, B: Boolean;
begin
try
ClearTimeouts;
T:= 2000;
A:= IsFKeyDown(12);
B:= IsFKeyDown(11);
if(A) then
begin
DisplayDebugImgWindow(766, 504);
ShowingDebug:= True;
Writeln('Showing Debug;');
end;
if((B) and (ShowingDebug)) then
begin
ShowingDebug:= False;
Writeln('Not showing Debug;');
ReadToCopy;
end;
if(ShowingDebug) then
begin
GetClientDimensions(W, H);
SafeCopyCanvas(GetClientCanvas, GetDebugCanvas, 0, 0, W, H, 0, 0, W, H);
GetDebugCanvas.Pen.Color:= 255;
GetDebugCanvas.Brush.Color:= 255;
GetMousePos(X, Y);
GetDebugCanvas.Ellipse(X, Y, X + 4, Y + 4);
if(not(GetSCARVersion = 320)) then
SetTimeout(Round(T / 1000), 'CopyClient')
else
SetTimeout(T, 'CopyClient');
end;
except
Writeln('Failed to show window');
finally
end;
end;
procedure Proggy;
begin
ClearDebug;
with Players[CurrentPlayer] do
begin
Writeln('******TootMageSmither Version 2.0******');
Writeln('Currently using player: ' + Name + '.');
Writeln('Worked for ' + TimeRunningEx(TimeFromMark(Worked)));
if(Banked = 1) then
Writeln('Smithed ' + IntToStr(Banked) + ' ' + Strings[Player_Str_BarN] + '.')
else
Writeln('Smithed ' + IntToStr(Banked) + ' ' + Strings[Player_Str_BarN] + 's.');
Writeln('Started with: ' + IntToStr(Integers[Player_Int_SNat]) + ' nature runes, currently have: ' + IntToStr(Integers[Player_Int_CNat]) + ' nature runes.');
if(Booleans[Player_Bln_Fire]) then
Writeln('Started with ' + IntToStr(Integers[Player_Int_SFir]) + ' fire runes, currently have ' + IntToStr(Integers[Player_Int_CFir]) + ' fire runes.');
Writeln('Currently have ' + IntToStr(Integers[Player_Int_AO1I]) + ' ' + Strings[Player_Str_Ore1] + ' in the inventory.');
if(not(SingleOre)) then
Writeln('Currently have ' + IntToStr(Integers[Player_Int_AO2I]) + ' ' + Strings[Player_Str_Ore2] + ' in the inventory.');
Writeln('******TootMageSmither Version 2.0******');
end;
end;
function PlayerDone: Boolean;
begin
Result:= False;
GetPlayerAmnts(Players, CurrentPlayer);
with Players[CurrentPlayer] do
begin
Result:= Integers[Player_Int_Invs] > (Integers[Player_Int_AO1N] + Integers[Player_Int_AO2N]);
if(Result) then
Exit;
Result:= not(Booleans[Player_Bln_Ore1]);
if(Result) then
Exit;
if(not(SingleOre)) then
Result:= not(Booleans[Player_Bln_Ore2]);
if(Result) then
Exit;
Result:= Integers[Player_Int_CNat] < 2;
if(Result) then
Exit;
if(Booleans[Player_Bln_Fire]) then
Result:= Integers[Player_Int_CFir] < 6;
if(Result) then
Exit;
if(not(Integers[Player_Int_Bars] = 0)) then
Result:= Integers[Player_Int_Bars] <= Banked;
if(Result) then
Exit;
end;
end;
function SetupPlayer: Boolean;
begin
MarkTime(Players[CurrentPlayer].Worked);
SetPlayer(Players, CurrentPlayer);
SelectWorld(RandomWorld(Players[CurrentPlayer].Booleans[Player_Bln_Memb], False));
LoginPlayer;
GameTab(4);
FindNormalRandoms;
Result:= True;
Players[CurrentPlayer].Integers[Player_Int_SNat]:= GetRuneCountInv(bmp_NatureRune, Type_NatureRune, NatureTolerance);
if(Players[CurrentPlayer].Integers[Player_Int_SNat] = 0) then
begin
Writeln('No nature runes detected in inventory');
Result:= False;
end;
if(Players[CurrentPlayer].Booleans[Player_Bln_Fire]) then
begin
Players[CurrentPlayer].Integers[Player_Int_SFir]:= GetRuneCountInv(bmp_FireRune, Type_FireRune, FireTolerance);
if(Players[CurrentPlayer].Integers[Player_Int_SFir] = 0) then
begin
Writeln('No fire runes detected in inventory');
Result:= False;
end;
end;
FindNormalRandoms;
GetPlayerAmnts(Players, CurrentPlayer);
end;
procedure SetupScript;
begin
GetApplication.Minimize;
if(UsingSmart) then
begin
SMARTSetupEx(2, False, True, False);
repeat
Wait(100);
until(SmartActive);
Wait(200);
SetTargetDC(SmartGetDC);
DisplayDebugImgWindow(766, 504);
ShowingDebug:= True;
ReadToCopy;
repeat
Wait(100);
until(RSReady);
end else
ActivateClient;
ClearDebug;
SetupSRL;
DeclarePlayers;
bmp_NatureRune:= BitmapFromString(10, 10, 'beNpNj20KgzAQBe' +
'/QPz2kiEiIVlND6reIlOKFnfJgEYZA3g4v2dA+jifs/ecYh+80wW9' +
'ZFMLcvdcYt5SAKw4nApzbOoYWAaxEjkr65gU4mqrBHkp1BQia8ooc' +
'CcG56D2CfcNKEJqylKDwXoJQF4UEhfcSBJ/nEhRaiXZxWSZBoX3jv' +
'8gFMdV5+g==');
Type_NatureRune:= 'bmp';
NatureTolerance:= [NatTolerance1, NatTolerance2];
bmp_FireRune:= srl_GetBitmap(bmp_Rune_Fire);
Type_FireRune:= 'bmp';
FireTolerance:= [FireTolerance1, FireTolerance2];
end;
procedure MainLoop;
begin
SetupScript;
Wait(1000 +- Random(999));
repeat
if(SetupPlayer) then
repeat
Bank;
Proggy;
Smith;
Proggy;
until(PlayerDone);
FreePlayerBmps(Players[CurrentPlayer]);
NextPlayer2(False);
until(AllPlayersInactive);
FreeScriptBmps;
end;
begin
MainLoop;
end.
If you get an error in WorldSwitcher.scar about line 75, replace line 75 with:
H := StrToInt(ReadINI('Worlds', 'Count', AppPath + 'includes\SRL\SCSS\worlds.ini'));——————————————————
<!– END TEMPLATE: formanswers –>