Bonfield
2010-12-18 02:34:29
I am trying to search for clay in the bank, and what i want to do is store it in as a player integer to use later on, but the way i tried to do it must be wrong because it hovers the top left of the bankscreen/runescape client, the script never finds the clay and i can not figure ot why
EDIT: sorry i didnt now there was a help section
function Find_Clay: Boolean;
var
i: Integer;
begin
for i := 1 to 40 do // the first 4 lines in the bank
writeln(inttostr(Get_Black_Count(i, SRL_OUTLINE_BLACK, True)));
if(Get_Black_Count(i, SRL_OUTLINE_BLACK, True) = CLAY_BLACKCOUNT) then
begin
Players[CurrentPlayer].Integers[CLAY_BANKSLOT] := i;
writeln('Player ' + IntToStr(CurrentPlayer) + ' has clay in bankslot '+ inttostr(Players[CurrentPlayer].Integers[CLAY_BANKSLOT]));
Exit;
end;
end;
{*******************************************************************************
function Withdraw_Clay: Boolean;
By: Bonfield
Description: Deposits soft clay to bank
*******************************************************************************}
function Withdraw_Clay: Boolean;
var
Max_Time: Integer;
Index: TPoint;
Bank_Slot: TBox;
begin
if (not LoggedIn) then Exit;
if (not In_Bank) then Exit;
Max_Time := GetSystemTime + (2 * 60 * 1000); // Max time of 2 minutes.
Open_Bank(WHICH_BANK);
while (not(Result)) and (GetTimeRunning < Max_Time) do
begin
if (Players[CurrentPlayer].Integers[CLAY_BANKSLOT] = 0) then
Find_Clay else
begin
writeln('lolz');
Index := BankIndexToBankPoint(Players[CurrentPlayer].Integers[CLAY_BANKSLOT]);
writeln('Index X is ' + IntToStr(Index.X));
writeln('Index Y is ' + IntToStr(Index.Y));
Bank_Slot := BankIndexToMSBox(Players[CurrentPlayer].Integers[CLAY_BANKSLOT]);
MouseBox(Bank_Slot.X1, Bank_Slot.Y1, Bank_Slot.X2, Bank_Slot.Y2, 3);
if WaitUpTextMulti(['Withdraw-1 c', 'w-1 Clay', 'lay'], 500) then
begin
Result := True;
Withdraw(Index.X, Index.Y, 0);
writeln('Withdrew Clay');
CloseBank;
Exit;
end else
Result := False;
writeln('Withdraw failed CountColor was correct but uptext wasnt');
end;
end;
end;EDIT: sorry i didnt now there was a help section