SRL Archive - Archive

tootoot222 - SRL Member Application Form


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…


////////////////////////////////////////////////////////////////////////////////
//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 –>

Gu3st...

2008-11-01 04:33:37

Woah… Nice one! :D

This is how we want our apps!
And it compiles too! O.o

Multiplayer - Check!
Anti-Random - Check!
Anti-Ban - Check!
if..then..else - Check!
BMPs - Check!
DTMs - Only in your function FT.
Walking - Nope, not needed

Yes from me! ;)


Well… but ofcourse, someone would have to check if your script is made by you. :/

Tootoot222

2008-11-01 04:50:51

I didn't actually put any DTM's, but there is complete support for them, all you have to do is just change where it loads the BMP's into DTM's

Narcle

2008-11-01 04:51:36

RandomWorld(Players[CurrentPlayer].Booleans[Player_Bln_Memb], False);

That returns just a integer right now, I had it switch worlds before which might be turned back too, but right now it doesn't.
To have this work correctly right now it has to be:

SelectWorld( RandomWorld(Players[CurrentPlayer].Booleans[Player_Bln_Memb], False) );

Good app though. I probably won't be voting. ;)

Tootoot222

2008-11-01 05:02:27

ah, thanks, i this was the first time i had used the world switcher, and it was kind of a last mintue addition

Narcle

2008-11-01 05:06:17

Yeah the wrong Worlds.ini is in there. Because Wizzup told Markus not to include SMART stuff in it yet… Unfortunately I didn't get the chance to tell him the new Worlds.ini is required for WorldSwitcher.scar.

Tootoot222

2008-11-01 05:09:14

I updated my worlds.ini with FAWG, and that's when i got the error

Narcle

2008-11-01 05:15:12

From: tootoot222
I updated my worlds.ini with FAWG, and that's when i got the error


That's because I didn't use FAWG for the new one.

Tootoot222

2008-11-01 06:08:34

lol i updated a bit, now when using SMART it shows where the mouse is on the debug window (it looks just like benland's SMART mouse ^_^)

Laur€ns

2008-11-01 06:17:49

Very nice app. Yes.

Scaper

2008-11-01 06:32:12

wow nice app man seems legit

yes from me

Tootoot222

2008-11-01 07:02:04

how many "yes" votes do i need? or is it just a majority after 7-14 days?

EvilChicken!

2008-11-01 07:33:15

YESSIR!


Been a while since I've seen such a good application.
I'm really hoping to see more from you once you get into SRL members! 8D

TravisV10

2008-11-01 10:13:49

yesh from meh

Gu3st...

2008-11-01 10:17:21

From: EvilChicken!
YESSIR!


Been a while since I've seen such a good application.
I'm really hoping to see more from you once you get into SRL members! 8D

Excatly! This is the best app i've seen! (after myself ofc… Just kiddind about myself)

Scaper

2008-11-01 17:37:25

hey man if/when you get members will you keep this script as SRL members only please??

good luck

Magiic

2008-11-01 18:57:19

yers from me

The_Shermanator

2008-11-01 19:45:19

Yes:)

-Shermanator

P1nky

2008-11-02 00:15:53

yes gj.

noidea

2008-11-02 01:03:04

Looks good! Beat me/Shermanator. I got 20/0 and he got 29/1.
Guys, I wasn't the one no on shermantors application~!:mad:!~

Tniffoc

2008-11-02 01:34:05

[OFFTOPIC]

From: noidea
Looks good! Beat me/Shermanator. I got 20/0 and he got 29/1.
Guys, I wasn't the one no on shermantors application~!:mad:!~


I got like 27-1 (i think)

[/OFFTOPIC]

Looks good. I didn't have a chance to actually test the script but it looks good and I like you're attitude. Yes

Tootoot222

2008-11-03 05:08:31

wow, thanks guys, didn't know that it was such a good script lol

As of 03/11/08 @12:00ish, the app has now been updated to work with the latest SMART (http://www.villavu.com/forum/showthread.php?t=36898)

Nava2

2008-11-04 17:53:32

Yes, why all the constants?

markuska815

2008-11-04 22:54:42

Yes… fairly obvious you know what youre doing

Tootoot222

2008-11-05 04:37:37

From: Nava2
Yes, why all the constants?


it was difficult to keep track of all of the points in the array, so i made some constants to help keep track. (i had almost 25 constants for Int at 1 time) also, this way i can change/remove any of the constants and it won't affect the script

P1nky

2008-11-05 10:37:44

From: tootoot222
how many "yes" votes do i need? or is it just a majority after 7-14 days?


just quite a bit more than no's


17 yes
2 no's
=
Welcome, to srl members.

d/w your in for sure unless a wierd problem pops up :P
just wait for a admin to review.:spot:

Laur€ns

2008-11-05 13:13:17

From: ~~Joker~~

just wait for a admin to review.:spot:


The admins are lazy here (no offence ;)) so it could take a while :)

Iroki

2008-11-05 14:17:26

I think that you're in, YES for me :), but you can make it shorter. (maybe 500 - 600 lines) i made one which has 414 lines and it doesn't include WorldSwither and runes finding procedure.

Tootoot222

2008-11-06 01:42:14

yes, i though it was odd that it ended up being as long as it was, as there's really nothing that needed to get done… oh well, i guess i had alot of stuff to do to set up the main things (Bank; Smith;)

Daniel

2008-11-06 06:05:04

Yes, you have done a good job at your script. You're also a good person to talk to when i'm feeling down (/me cuts himself).

boberman

2008-11-06 11:44:07

No from me, and for a couple of reasons.

about 5 of the 50 functions have comments in them. Out of those 5, 4 of them where made by someone else and modified by you. IDK, maybe you where just trying to give credit where credit was due.

Comments are non-existant. This is a complex script, it deserves a comment here and there.

The quality of the script varies DRAMATICALLY in some areas. For example
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;

Thats freaking ugly and show a lack of understanding of scripting. First off, finding randoms every other line is not needed and just makes the script longer.

Second, it hides what you are doing. Between the random wait times, and findnormalrandoms you have hidden an open bank procedure that enters a pin number. Checking for randoms before opening the bank, and after opening the bank, sure. but checking in between putting in the pin number and then 2-3 times just for the heck of it?

I have never recieved a random while I have a bank screen open. Before opening it, yes, after opening it? yes. but never while it is opened. runescape isn't THAT annoying.

another one thats pretty bad is this one

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;

Yikes, multiple cascading if statements with several exits is really bad. It makes your code hard to follow and just looks bad. rather then doing something like this, a single boolean in the player that can be flipped when one of these conditions occurs would probably be better, and make your code much cleaner looking.

Your probably getting in, but really, you script is just ugly, in some places its pretty good, but in others (as posted) it becomes terribly bad.

Tootoot222

2008-11-07 01:36:20

[QUOTE=Dan's The Man;495143]Yes, you have done a good job at your script. You're also a good person to talk to when i'm feeling down (/me cuts himself).

^_^ /me is glad to see that the powers of the IRC didn't let me down

From: boberman
Comments are non-existant. This is a complex script, it deserves a comment here and there.


well, originally i wasn't planning on submitting this script, but then it occored to me that i might be able to get in with it, but that was well into version 1.5, and most of the coding had already been done, i just needed to rewrite a few things (GetRightOreAmounts, namely).



ok, the randoms thing was a little overboard, it could have done without most of those



the thing with the Exit's, i suppose i could write it like:

function PlayerDone: Boolean;
var
R: array [0..5] of Boolean;
I, L: Integer;
begin
Result:= True;
GetPlayerAmnts(Players, CurrentPlayer);
with Players[CurrentPlayer] do
begin
R[0]:= Integers[Player_Int_Invs] > (Integers[Player_Int_AO1N] + Integers[Player_Int_AO2N]);
R[1]:= not(Booleans[Player_Bln_Ore1]);
if(not(SingleOre)) then
R[2]:= not(Booleans[Player_Bln_Ore2]);
R[3]:= Integers[Player_Int_CNat] < 2;
if(Booleans[Player_Bln_Fire]) then
R[4]:= Integers[Player_Int_CFir] < 6;
if(not(Integers[Player_Int_Bars] = 0)) then
R[5]:= Integers[Player_Int_Bars] <= Banked;
L:= Length(R) - 1;
for I:= 0 to L do
Result:= ((Result) and (R[I]));
end;
end;

eh, if that's what's better, although the exit thing would be faster, as it doesn't have to evaluate all of the conditions

P1nky

2008-11-07 10:18:07

From: Laur€ns;494614
The admins are lazy here (no offence ;)) so it could take a while :)


yea reported the thread, like 3-4 days ago.

guess really busy :)

Gu3st...

2008-11-09 07:32:00

Welcome, Sir!

Wizzup?

2008-11-09 11:16:24

In!