SRL Archive - Help and Support

Players Logs Out on second run.


Rikje

2007-09-02 06:09:08

Found problem:
after deleting the 2 '' LogOut'' in the include file mapwalk he works again…


since i have srl 4. i have the following problem:
the first rune to the mines is oke. the second one the walk to is oke. but when he is walking back. he click ones. in procedure ''ToBank'' and then he logs out.

there to places where he can logout:
when water color is 0 and when I = 20.
but he founds the water color and he clicks one time. so he is allready in the repeat loop:

repeat
D:= D+ 1;
X:= 649;
Y:= 11;
if(FindColorSpiral( x, y, TheWater, MMX1, MMY1, MMX2, MMY2))then
begin
Mouse(x+(4), y, 3, 3, true);
Wait(500);
FFlag(20);
end else
begin
TheWater:= FindWaterColor;
end;
If (D > 4) then
TheRoadColor:= FindRoadColor;
//FindRandoms;
Until(D > 20) or (RadialRoadWalk(TheRoadColor, 264, 315, 60, 0, 0));

he have clicked one time. and in the debug box is not standing ''cant find water color'' so i cant be 20. he logs out and then the debug box get spammed with. ''cant found water color!''.

i tryed to fix this for 3 full days. but i just dont get it :duh:

someone?

script:

{=========================================================================]
[ Rikjess Swamp Miner V0.7 (Only coal atm) ]
[ ]
[ Name : Swamp Miner V0.7 ]
[ WRITER : Rikjess ]
[ CATEGORY : Miner ]
[ USAGE : Mines coal in Lumby swamp. and bank in Draynor]
[ AUTOCOLOR : Yes. ]
[ NOTES : Beta. ]
[ Needs : Scar DIVI 3.11. Srl 3.81+ ]
[ ]
[=========================================================================]
[ This Script Mines Coal in the lumby Swamp west mines. ]
[ When full he will bank in Draynor bank. ]
[ Gas detection and pick repear funtion. ]
[ It will mine like 100 ores a hour. ]
[ ]
[=========================================================================]
[ Instructions. ]
[=========================================================================]
[ ]
[ ]
[ 1. USE Runescape with Low Detail, Very Bright. ]
[ 2. Set your Screen to 32 bit TRUE color. ]
[ 3. Set Playernames and Passwords in DeclarePlayers! ]
[ 5. Put your SRL Stats ID and Pass on line: 65 & 66 Please (A) ]
[ 6. Set NumberOfPlayers!!! ]
[ 7. Position your chars at Draynor Bank ]
[ 8. Watch it the first time to see if the OreTol is oke. ]
[ 9. Post your proggy and the bugs you found! ]
[=========================================================================]
[ Special Thanks: ]
[ ]
[ ILoveIt8, Pentti: Allways helping me with qeustions. ]
[ Nielsie95 : A lot of great tut. Learned a lot from those! thx. ]
[ Yohojo : your tut made me understand DDTM. ty. ]
[ Srl-forum : For having fun. And for making srl. Thx to every one! ]
[=========================================================================}


program SwampMiner;
{.include srl/srl.scar}
{.include srl/srl/skill/Mining.scar}
{.include srl/srl/skill/Fighting.scar}
{.include SRL/SRL/Misc/Trade.scar}
{.include SRL/SRL/Misc/DraynorColorFinder.scar}

var
LoadsDone, MineRock, I, NormalOre, MithrilOre, AdamantiteOre, CoalOre, Banked, GemMask, x, y : integer;
PickAxeDTM, TotalOres, CoalOres, MithrilOres, AdamantiteOres, TheRoadColor, Ax, Ay, AtMines, WaitMS, Xy, Xx, OreCollor : integer;
Active, RandomOreName : string;

const
//------------------//
LoadsToDo=2; //How many loads each player before switching. 1 = like 15mins.
OreToll=5; //The ore Toll 4-6 (try with one for you work. watch it the first time to see if its oke.)
CoalTime=8000; //Millisecons it will mine on a coal rock before next click.
//--------------//

procedure DeclarePlayers;

Begin
NumberOfPlayers(9);
HowManyBooleans := 8;
CurrentPlayer := 0;
SRLID := '1311';
SRLPassword := 'yVJnqgEf8E';

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active :=True;
Players[0].Loc := 'Bank';
Players[0].strings[1]:='1'; //NO need to this...(no commant on this string lol)

Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Active :=True;
Players[1].Loc := 'Bank';
Players[1].strings[1]:='1';

Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :='';
Players[2].Active :=True;
Players[2].Loc := 'Bank';
Players[2].strings[1]:='1';

Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :='';
Players[3].Active :=True;
Players[3].Loc := 'Bank';
Players[3].strings[1]:='1';

Players[4].Name :='';
Players[4].Pass :='';
Players[4].Nick :='';
Players[4].Active :=True;
Players[4].Loc := 'Bank';
Players[4].strings[1]:='1';

Players[5].Name :='';
Players[5].Pass :='';
Players[5].Nick :='';
Players[5].Active :=True;
Players[5].Loc := 'Bank';
Players[5].strings[1]:='1';

Players[6].Name :='';
Players[6].Pass :='';
Players[6].Nick :='';
Players[6].Active :=True;
Players[6].Loc := 'Bank';
Players[6].strings[1]:='1';

Players[7].Name :='';
Players[7].Pass :='';
Players[7].Nick :='';
Players[7].Active :=True;
Players[7].Loc := 'Bank';
Players[7].strings[1]:='1';

Players[8].Name :='';
Players[8].Pass :='';
Players[8].Nick :='';
Players[8].Active :=True;
Players[8].Loc := 'Bank';
Players[8].strings[1]:='1';

NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;

function FindFastRandoms: Boolean; //By WT-Fakawi.
var
i : Integer;
begin
for i := 1 to 9 do
begin
case I of
1: if FindDead then
Result := True;
2: if FindMod then
Result := True;
3: if FindMime then
Result := True;
4: if FindMaze then
Result := True;
5: if FindQuiz then
Result := True;
6: if FindDemon then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
7: begin
if InBlack then
begin
Result := True;
Players[CurrentPlayer].loc := 'InBlack';
Logout;
Exit;
end;
end;
8: RC;

9: begin;
if (not(InFight)) then Exit;
if(GetHp<GetSkillLevel('hitpoints'))then
begin;
Setrun(true);
MakeCompass('N');
RunAwayDirection('N');
Wait(2000);
FindFastRandoms;
RunBack;
if(FindSymbol(x, y,'mining site'))then
Mouse(x,y,2,2,true);
end;
end;
end;
wait(1);
end;
end;

function LookForGas:boolean; forward;
procedure Tobank; forward;
Procedure DoMine; Forward;
procedure StartPlayer; forward;


{ a verry custom welcom procedure :p }
procedure Welcome;
begin
WriteLn(' || || [] ');
WriteLn(' || || ');
WriteLn(' ||---|| || Enjoy it! ');
WriteLn(' ||---|| || Script Name: Lumby Swamp miner! ');
WriteLn(' || || || // Made By: Rikjess ');
end;


{ ...i know. its not prober scripting }
procedure FindRandoms;
begin
FindFastRandoms;
FindNormalRandoms;
end;

{ Gives a sexy proggy :p. no rly! }
procedure Proggy;
begin
Writeln('[]-------------------------------------------[]');
WriteLn('[]======Rikjes, Lumby Swamp Miner V0.7=======[]');
Writeln('Worked For : ' + TimeRunning);
WriteLn('Total Banks done: ' +IntToStr(Banked));
Writeln('Total ores minned: ' +IntToStr(TotalOres));
WriteLn('Total Coal Minned: ' +IntToStr(CoalOres));
WriteLn('Total Mith Minned: ' +IntToStr(MithrilOres));
WriteLn('Total Addy Minned: ' +IntToStr(AdamantiteOres));
WriteLn('Please post the proggy and the bugs you found ^^');
Writeln('[]--------------------------------------------[]');
WriteLn('[]============================================[]');
begin
for I := 0 To HowManyPlayers - 1 do
begin
if Players[i].Active = True then
Active := 'True'
else
Active := 'False';
WriteLn((IntToStr(I)) + ' : ' + Players[I].Name + ' = ' +
Active +' | Worked: ' + IntToStr(Players[I].Worked) + ' Minutes |Loc: ' + Players[I].Loc + ' |');
end;
end;
WriteLn('[]--------------------------------------------[]');
WriteLn('[]============================================[]');
SRLRandomsReport;
end;

{ Loadds the needed BitMaps and DTMs }
procedure LoadOreStrings;
begin

NormalOre := BitmapFromString(11, 11, 'z78DA73730301033070436' +
'2238B60024C35B84CC0A5923C13F0BB937813F0EB22DE04CC5022' +
'CF04CADD404CC890EA0BFCE2F85D4E4C6A212FF470998FCC0600F' +
'B599CC1');

MithrilOre := BitmapFromString2(False, 'aC5D5B78DA6D8F5192C' +
'3200C43AFE45896219F40C3FD8F548CDB4D66B67CBCD1085B0211' +
'39D4659D2B6808B25F8BCEBA755C3AC69FCF2B7CA3DE7E8D2DAD1' +
'69ADB99E1788C088F57E8792E961E33BE13CAA9B7AF7B0BF3F63B' +
'171110E98DDD1AE06A1325354F2BD80572405452AEDF5089828A4' +
'A4BE73F73FE494E1BA093BAF6B6CE961FF9450B1A3A5EFCF2D1F5' +
'CCB48A0BB46E8A962FF74147FFFC62B7FCC81F3AECC864131397E' +
'4EA6CF49CF9249F26DFFC37F80');

AdamantiteOre := BitmapFromString(6, 6, 'z78DA558E410E00210803BFA' + //Not Working i Think...
'4D2E27A54A3FF7FD212F0A024E53243434A36B94CA9968166110A' +
'04A002C9696C29B22CE13845E5877A9B7626A24F4FE344C7E0C23' +
'88ED3A76769C68A1D0E12B62568343865D1CA729CFB07EFC75630' +
'93DAC91F0EBE2D59');

CoalOre := BitmapFromString2(False, 'a64B7178DA8D8D510A0421' +
'0C43AF5493D6EAA7237AFF236DEBECC7C0C0B2080F79265144647' +
'9404609708C602D089AAEE46A41B53495334DAB4134CDBB1DB3D3' +
'D48C883A836E3B8DE7A6E36498C6FBD9B92C17CE2FB29B5D3A982' +
'D9142811C1DF732E31013B3AC2F3B7AE9CFA46D9DB4DF5D8280DC' +
'7C2E54E8A6BFBB11643CBEBA741AECF6D50C6C7F754FEBC90FFC2' +
'');

PickAxeDTM := DTMFromString('78DA63BCC4C4C0B09391011530229140FA305' +
'0CD56026AEE01D5EC22A0E61850CD69026A4E03D5EC25A0E60211' +
'6AAE00D56CC0AF060006350AF0');

GemMask := BitmapFromString2(False, 'aC5B4378DAED98C10EC320' +
'0C437F299490F40A2DFCFF2735EE61B74D93A6551DF33B58915A6' +
'28C90108888740F919A42725F42CB6AD001D57CD6DA434D2BEA1D' +
'BAAC8ABA6C8F3F0D43451BBA592BA19E777C4D5073F4F79AA1A94' +
'11D1D7C93410821B7444E7E659EEFF36CD4AC2BFF7A1DE6DB4BF4' +
'A217BDE670642EE6FACF5CD7F832177723733117BD78B2CCF47AF' +
'08DDBEE3DDF43E4630621845CCE011A9');

end;

{ Change the currently playing music }
procedure ChangeMusic;
var
Tx, Ty : integer;
begin
GameTab(13);
if (FindColorSpiral(Tx, Ty, 65280, 555, 296, 711, 447)) then
Mouse(Tx, Ty, 1, 1, True);
end;

{ LogOut wait 5sec + random 3 and log back }
procedure LogOutFake;
begin
WriteLn('A fake LogOut');
Case Random(4) of
0: TypeSend('Brb');
1: TypeSend('arg');
2: TypeSend('gtg');
3: TypeSend('Bye');
end;
Wait(1000);
LogOut;
SleepAndMoveMouse(5000+Random(5000));
LogInPlayer;
Wait(1000);
WriteLn('ContinueMining');
end;

{ Some simple anit-ban }
procedure AntiBansz;
begin
case Random(13) of

0: LogOutFake;

1: begin
if FindObjOre(x, y, 'Rock', 2834753, 5, 1) then;
begin
Mouse(x, y, 2, 2, False);
ClickOption('rospect',1);
end;
end;

2: RandomRClick;

3: begin
HoverSkill('magic', false);
wait(1000+random(2000));
GameTab(4);
end;

4: RandomRClick;

5: GameTab(1+random(10));

6: AlmostLogout;

7: GameTab(1 + Random(10));

8: begin
HoverSkill('mining', false);
wait(1000+random(500));
GameTab(4);
end;


9: begin
HoverSkill('smithing', False);
wait(500+random(500));
GameTab(4);
end;


10: HoverSkill('attack', False);

11: RandomRClick;

12: ChangeMusic;

end;
//
end;

{Make A random Talk }
procedure RandomTalk;
begin
If (Random(50) = 1) then
begin
case Random(26) of

0: TypeSend('Mining can be sooooo boring..');
1: TypeSend('i like this mine, yeaj!');
2: TypeSend('Mining rulezz');
3: TypeSend('I need money,, mining is a good way isnt?');
4: TypeSend('=p');
5: TypeSend(':o');
6: TypeSEnd('=]');
7: TypeSend(':c');
8: TypeSend('I like mining. and you?');
9: TypeSend('yeaj, i got a ore');
10:TypeSend('Metal rulezz :p');
11:TypeSend('Disturbed is a good band, what kind of music you guys like?');
12:TypeSend('Tralalla');
13:TypeSend('I have a Dream! =p');
14:TypeSend('yesterday my pickaxe broke :(');
15:TypeSend('At the drawven mines you can buy pick hé?');
16:TypeSend('Avatar the last airbender rulezz!');
17:TypeSEnd('hi');
18:TypeSend('yo');
19:TypeSend('bots ar killing this game. =['); // says the bot :p
20:TypeSend('school is boring');
21:TypeSend('Get up, come on get down with the sickness');
22:TypeSend('Jump! =p');
23:TypeSend('w00tage! i have ores ^^');
24:TypeSend('*cough* Mining is so boring *cough*');
25:TypeSend('i like those uncuts =]');
end;
end;
end;

{ atm a small auto respowner }
procedure TalkBack;
begin
if IsChatBlackTextAnyLine(+Players[currentplayer].Nick) then
Exit;

if FindChatText('ing lvl') or FindChatText('g lvl') then
begin
case Random(3) of
0: TypeSend(IntToStr(Players[CurrentPlayer].level[15]));
1: TypeSend('Mining'+IntToStr(Players[CurrentPlayer].level[15])+' here ')
2: TypeSend(IntToStr(Players[CurrentPlayer].level[15])+'here');
end;
end;

if FindChatText('hello') then
begin
case Random(3) of
0: TypeSend('eey');
1: TypeSend('hello');
2: TypeSend('hi');
end;
end;

if FindChatText('you just advanced') then
begin
case Random(3) of
0: TypeSend('Yea new lvl!');
1: TypeSend('w00t lvl up ');
2: TypeSend('lvl up! =]');
end;
end;
RandomTalk;
end;

{ Looks if there is a pick axe.. }
function AxeWithMe(InInvent : string):Boolean;
Var
Bx, By : integer;
begin
FindRandoms;
case InInvent of
'1': GameTab(4);
'2': GameTAb(5);
end;
if FindDTM(PickAxeDTM, Bx, By, MIX1, MIY1, MIX2, MIY2) then
begin
Result := True;
end else
if FindPick then
Result := True;
end;

{ Looks witch ore your char can mine, and set a ore name to mine }
procedure WhatOreCanIMine;
Var
MithrilLvl, AddyLvl : boolean;
begin
if (not(loggedin)) then
Exit;
MithrilLvl := False;
AddyLvl := False;
if (Players[CurrentPlayer].level[15]) > 54 then
MithrilLvl := True;
if (Players[CurrentPlayer].level[15]) > 69 then
AddyLvl := True;
RandomOreName:='Coal';
WaitMS:=CoalTime;

if MithrilLvl then
begin
if random(10) = 1 then
begin
RandomOreName:='Mithril'
WaitMS:=20000;
end;
end;

if AddyLvl then
begin
if Random(10) = 1 then
begin
RandomOrename:='Adamantite'
WaitMS:=30000;
end;
end;
end;

{ Repear the pickaxe when broke loop }
procedure RepearPick;
begin
if FindFastRandoms then Exit;
if FindNormalRandoms then Exit;
if (AxeWithMe(Players[CurrentPlayer].strings[1])) then
Exit;
if (not(FindPick)) then ToBank;
end;

{ updates rock cordinates
By wuzzip }



{ Clicks on a rock }
function AtackOre(orenamed:string):boolean;
begin
if (not(loggedin)) then
Exit;
if InvFull then
Exit;
case Orenamed of

'Coal' : OreCollor:= 2175024;
'Mithril' : OreCollor:= 4862514;
'Adamantite': OreCollor:= 6717286;

end;
FindRandoms;
if (not(FindObjEx(Xx, Xy, 'ine Rock', MSX1, MSY1, MSX2, MSY2, OreCollor, OreToll, 5, 2, 50, True))) then
Exit;
begin
LookforGas;
If Random(10)=1 then
begin
Mouse(Xx, Xy, 2, 2, False);
ClickOption('ine',1);
end else
Mouse(Xx, Xy, 3, 3, True);
Result:=True;
end;
Wait(500);
if FlagPresent then
begin;
Wait(2000+ Random(1000));
DoMine;
end;
LookforGas;
end;

{ Looks if you mined the ore by using the black message in the chat box }
function Oremined: boolean;
begin
if InvFull then
Exit;
if FindBlackChatMessage('anage') or FindBlackChatMessage('vailable') then
result:= True;
end;

{ A Rotate Compass procedure }
procedure ChangeCompass;
begin
if (not(loggedin)) then
Exit;
FindRandoms;
case Random(4) of

0: MakeCompass('N');
1: MakeCompass('E');
2: MakeCompass('W');
3: MakeCompass('S');
end;
end;

{ Gas detection (i hope..) }
function LookforGas:Boolean;
var
Ax, Ay, Agas: integer;
begin
if (not(loggedin)) then
Exit;
AX:= MSCX;
AY:= MSCY;
if FindGas(Xx, Xy) then
begin
MarkTime(Agas);
Result:=True;
//MouseSpeed:= 1;
MouseFindNoFlag(MMCX, MMCY + 5, 2, 2);
repeat
FindFastRandoms;
FindNormalRandoms;
SleepAndMoveMouse(3000);
until(timefrommark(Agas)>20000)
MouseSpeed:= 12;
end;
end;

{ The Mine Loop }
procedure DoMine;
var
NotFoundRock : integer;
begin
SleepAndMoveMouse(1000);
if random(2) = 1 then
if (not(AxeWithMe(Players[CurrentPlayer].strings[1]))) then
LogOut;
//GameTab(4);
if (not(loggedIn)) then Exit;
FindRandoms;
if InvFull then //somethimes the others mess up the script. will mine 2 ore when invent is full...
begin
Players[CurrentPlayer].Loc := 'To Bank';
FindRandoms;
Exit;
end;
if Random(5) = 1 then ChangeCompass;
WhatOreCanIMine;
if (not(AtackOre(RandomOreName))) then
begin
if InvFull then
begin;
Players[CurrentPlayer].Loc := 'To Bank';
FindRandoms;
Exit;
end;
ChangeCompass;
end;
If XX and XY = 0 then
begin
ChangeCompass;
FindRandoms;
NotFoundRock:= NotFoundRock + 1;
if (NotFoundRock = 8) then LogOut;
if (not(loggedin)) then Exit;
DoMine;
end;
Flag;
MarkTime(MineRock);
TalkBack;
//RandomTalk;
FindRandoms;
NotFoundRock := 0;

repeat
if InvFull then
begin;
Players[CurrentPlayer].Loc := 'To Bank';
FindRandoms;
Exit;
end;
if FindPick then RepearPick;
if LookforGas then DoMine;
if FindFastRandoms then DoMine;
if FindNormalRandoms then DoMine;
if Random(30)=1 then AntiBansz;
if HandleTrade then DoMine;
if Oremined then DoMine;
if(timefrommark(MineRock)>WaitMS+Random(1000))then DoMine;
if(timefrommark(AtMines)>900000)then
begin;
WriteLn('To long at the mines..');
Players[CurrentPlayer].Loc := 'To Bank';
FindRandoms;
Exit;
end;
SleepAndMoveMouse(1000);
if (not(loggedin)) then Exit;
until(InvFull);
Players[CurrentPlayer].Loc := 'To Bank';
end;

{ Find Road color, there some problems with the FindRoadColor;, with some java's.
it was finding the wrong color. so i needed to make my owne.

By nieslies acla.}
function FindMyRoadColor : Integer;
var
X, Y, Z: Extended;
Points: TPointArray;
Colors, UniqueColors: TIntegerArray;
i, a: Integer;
NewColor: Boolean;
begin
if not LoggedIn then Exit;
ColorToleranceSpeed(0);
FindColorsSpiralTolerance(MMCX, MMCY, Points, 6710894, MMX1, MMY1, MMX2, MMY2, 20);
if Length(Points) < 1 then
begin
ColorToleranceSpeed(1)
Exit;
end;
Colors := GetColors(Points);

for i := 0 to Length(Colors) -1 do
begin
NewColor := True;
for a := 0 to GetArrayLength(UniqueColors) - 1 do
begin
if(UniqueColors[a] = Colors[i])then
begin
NewColor := False;
Break;
end;
end;
if(NewColor)then
begin
SetArrayLength(UniqueColors, GetArrayLength(UniqueColors) + 1);
UniqueColors[GetArrayLength(UniqueColors) - 1] := Colors[i];
end;
end;
for i := 0 to Length(UniqueColors) -1 do
if UniqueColors[i] <> 0 then
begin
ColorToXYZ(UniqueColors[i], X, Y, Z);
if (X < 20) and (X > 8) then
if (Y < 21) and (Y > 9) then
if (Z < 20) and (Z > 8) then
if CountColor(UniqueColors[i], MMX1, MMY1, MMX2, MMY2) > 50 then
begin
WriteLn('My RoadColor: '+IntTostr(UniqueColors[i]))
Result := UniqueColors[i];
Break;
end;
end;

ColorToleranceSpeed(1);
end;




{ Sets the vars Ax and Xy for the walk to the mines }
procedure SetSearchTo;
begin
if (I = 1) then
begin
Ax:=686;
Ay:=68;
exit;
end;
if (I = 2) or (I = 3) then
begin
Ax:=715;
Ay:=80;
Exit;
end;
Ax:=682;
Ay:=155;
end;

{ Walks To lumby swamp west mines. }
procedure WalkToSW;
var
TheWater : integer;
begin
if (not(loggedin)) then Exit;
Players[CurrentPlayer].Loc := 'To Mines.';
MakeCompass('N');
I:= 0;
TheRoadColor:= 0;
TheRoadColor:= FindMyRoadColor;
if TheRoadColor = 0 then LogOut;
Wait(500);
RadialRoadWalk(TheRoadColor, 132, 90, 64, 0, 0);
Wait(3000);
if FlagPresent then
Flag;
RadialRoadWalk(TheRoadColor, 175, 143, 60, 0, 0);
RadialRoadWalk(TheRoadColor, 180, 120, 48, 0, 0);
FindRandoms;
RadialRoadWalk(TheRoadColor, 170, 120, 50, 0, 0);
begin
TheWater:= 0;
TheWater:= FindWaterColor;
if TheWater = 0 then
LogOut;
repeat
I:= I+ 1;
SetSearchTo;
X:= Ax;
Y:= Ay;
if(FindColorSpiral(x, y, TheWater, MMX1, MMY1, MMX2, MMY2))then
begin
Mouse(x+(6), y-(5), 3, 3, true);
FindRandoms;
FFlag(10);
end;
If (I = 30) then
LogOut;
Until(FindSymbol(x,y,'mining site')) or (I > 30);
end;
if(not(FindSymbol(x,y,'mining site')))then
begin
Players[CurrentPlayer].Loc := 'No Mines';
WriteLn('Not found mines');
LogOut;
Exit;
end;
Mouse(x,y,2,2,true);
FFlag(1);
Players[CurrentPlayer].Loc := 'Mines';
WriteLn('Found the Mine');
end;

{ Looks for the bank by using a DDtm }
{ @jagex: it was pritty hard to make him. but thx for that girl on a chair. she gave me the helping hand ^^ }
function FindBankDDtm:Boolean;
var
DraynorBank,D,DTMTol,DTMArea, RoadColorDtm:Integer;
DraynorBankMP: TDTMPointDef;
DraynorBankSP: array[0..3] of TDTMPointDef;
DraynorBankDTMSkel: TDTM;
begin
MMouse(10, 10, 40, 40);
RoadColorDtm:= FindRoadColor;
DTMArea:=0;
DTMTol:=0;
Begin
DraynorBankMP.x:=593;
DraynorBankMP.y:=63;
DraynorBankMP.areasize:=1;
DraynorBankMP.areashape:=0;
DraynorBankMP.color:=0;
DraynorBankMP.tolerance:=255;

DraynorBankSP[0].x:=643;
DraynorBankSP[0].y:=42;
DraynorBankSP[0].areasize:=DTMArea;
DraynorBankSP[0].areashape:=0;
DraynorBankSP[0].color:=RoadColorDTm;
DraynorBankSP[0].tolerance:=DTMTol;

DraynorBankSP[1].x:=609;
DraynorBankSP[1].y:=40;
DraynorBankSP[1].areasize:=DTMArea;
DraynorBankSP[1].areashape:=0;
DraynorBankSP[1].color:=RoadColorDtm;
DraynorBankSP[1].tolerance:=DTMTol;

DraynorBankSP[2].x:=648;
DraynorBankSP[2].y:=69;
DraynorBankSP[2].areasize:=DTMArea;
DraynorBankSP[2].areashape:=0;
DraynorBankSP[2].color:=RoadColorDtm;
DraynorBankSP[2].tolerance:=DTMTol;

DraynorBankSP[3].x:=603;
DraynorBankSP[3].y:=26;
DraynorBankSP[3].areasize:=7+DTMArea;
DraynorBankSP[3].areashape:=0;
DraynorBankSP[3].color:=195836;
DraynorBankSP[3].tolerance:=5+DTMTol;

DraynorBankDTMSkel.MainPoint:=DraynorBankMP;
DraynorBankDTMSkel.SubPoints:=DraynorBankSP;
DraynorBank:=AddDTM(DraynorBankDTMSkel);
End;

begin
for D:=1 To 5 Do
begin
DTMTol:=DTMTol+5;
DTMArea:=DTMArea+1
if (FindDTM(DraynorBank,x, y,MMX1,MMY1,MMX2,MMY2)) Then
begin
Mouse(x,y,1,1,True);
Result:=True;
WriteLn('Found Bank by using DDTM');
FreeDTM(DraynorBank);
Exit;
end;
end;
end;
FreeDTM(DraynorBank);
PerfectNorth;
end;

{ Walks to the bank }
procedure ToBank;
var
TheWater, D : integer;
begin
if (not(loggedin)) then
Exit;
Makecompass('N');
WriteLn('Walk To Bank');
Setrun(False);
FindRandoms;
begin
TheWater:= FindWaterColor;
if TheWater = 0 then
LogOut;
repeat
D:= D+ 1;
X:= 649;
Y:= 11;
if(FindColorSpiral( x, y, TheWater, MMX1, MMY1, MMX2, MMY2))then
begin
Mouse(x+(4), y, 3, 3, true);
Wait(500);
FFlag(20);
end else
begin
TheWater:= FindWaterColor;
end;
If (D > 4) then
TheRoadColor:= FindRoadColor;
//FindRandoms;
Until(D > 20) or (RadialRoadWalk(TheRoadColor, 264, 315, 60, 0, 0));
If (D > 20) then
begin
LogOut;
Exit;
WriteLn('i = 20');
end;
Flag;
RadialRoadWalk(TheRoadColor, 70, 10, 60, 0, 0);
Wait(20);
SetRun(True);
Wait(20);
RadialRoadWalk(TheRoadColor, 350, 275, 50, 0, 0);
RadialRoadWalk(TheRoadColor, 320, 354, 40, 0, 0);
RadialRoadWalk(TheRoadColor, 359, 275, 47, 0, 0);
//if (not (RadialRoadWalk(TheRoadColor, 280, 300, 54, 0, 0))) then
TheRoadColor:= FindRoadColor;
repeat
if FindBankDDtm then Exit;
if (RadialRoadWalk(TheRoadColor, 280, 300, 54, 0, 0)) then
begin
WriteLn('Found the bank by using RadialWalk');
Exit;
end;
RadialRoadWalk(TheRoadColor, 359, 290, 40, 0, 0);
FindRandoms;
if (not(loggedin)) then Exit;

until(RadialRoadWalk(TheRoadColor, 280, 300, 54, 0, 0));
end;
Flag;
end;

{ A smiple bank procedure }
procedure Bank;
begin
WriteLn('try to open bank');
if (not(loggedIn)) then exit;
Flag;
FindRandoms;
OpenBankQuiet('db');
Wait(1000);
if (not(Bankscreen)) then
if (FindSymbol(x,y,'bank')) then
begin
Mouse(x, y, 1, 1, true);
OpenBankQuiet('db');
end;
if (not(Bankscreen)) then
begin
Players[CurrentPlayer].Loc := 'No Bank';
WriteLn('Could not found bank..');
LogOut;
end else
begin
Players[CurrentPlayer].Loc := 'Bank';
WriteLn('Where at the bank');
end;

TotalOres := TotalOres + CountItemBmpMaskTol(NormalOre, 5, 15);
CoalOres := CoalOres + CountItemBmpTol(CoalOre, 10);
MithrilOres := MithrilOres + CountItemBmpTol(MithrilOre, 10);
AdamantiteOres := AdamantiteOres + CountItemBmpTol(AdamantiteOre, 10);
Banked := Banked + 1;

ReportVars[0] := CountItemBmpTol(CoalOre, 10);
ReportVars[1] := CountItemBmpTol(MithrilOre, 10);
ReportVars[2] := CountItemBmpTol(AdamantiteOre, 10);
ReportVars[3] := CountItemBmpMaskTol(NormalOre, 5, 15);
ReportVars[4] := CountItemBmpMaskTol(GemMask, 5, 15);
Banks := Banks + 1;

case Players[currentplayer].strings[1] of
'1': DePosit(2,28,2);
'2': DePositAll;
end;
Wait(1000);
CloseBank;
Wait(2000);
FindRandoms;
end;

{ Looks if the pick is equiped of if he is weared }
procedure WherePickAxe;
begin
//GameTab(4);
FindRandoms;
if FindDTM(PickAxeDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Players[CurrentPlayer].strings[1]:='1';
EquipPick := False;
FindPickHeadColor;
Exit;
end;
Wait(1000);
FindRandoms;
GameTAb(5);
if FindDTM(PickAxeDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
Players[CurrentPlayer].strings[1]:='2';
EquipPick := True;
FindPickHeadColor;
end;

{ LogNext }
procedure LogNext;
begin
SetChat('Off',1);
repeat
Wait(1000);
FindFastRandoms;
FindNormalRandoms;
until(not(LoggedIn));
LoadsDone:= 0;
NextPlayer(true);
Proggy;
end;

{ Gets the player ready to mine }
procedure StartPlayer;
begin
WherePickAxe;
FindFastRandoms;
FindNormalRandoms;
if (not(AxeWithMe(Players[CurrentPlayer].strings[1]))) then
begin
WriteLn('Not found axe... player turned to false.');
Players[CurrentPlayer].Loc := 'No PickAxe Found.';
Nextplayer(false);
StartPlayer;
end;
GetAllLevels;
if (Players[CurrentPlayer].level[15]) < 30 then
begin
WriteLn('Not high anouhg mining lvl to run this script...');
Players[CurrentPlayer].Loc :='To Low Mining lvl';
NextPlayer(false);
StartPlayer;
end;
WriteLn('[------------------------------]');
WriteLn(Players[CurrentPlayer].Name + ' mines:');
WriteLn('Coal');
if (Players[CurrentPlayer].level[15]) > 54 then
WriteLn(' Mithril');
if (Players[CurrentPlayer].level[15]) > 69 then
WriteLn(' Adamantite');
WriteLn('[------------------------------]');
LoadsDone:= LoadsDone+1;
MakeCompass('N');
HighestAngle;
FindFastRandoms;
FindNormalRandoms;
SetChat('On', 1);
SetChat('Friends', 2);
SetChat('Off', 3);
end;

procedure StartScript;
begin
ClearDeBug;
SetupSRL;
SetupMining;
ScriptID:='246';
Welcome;
Wait(500);
DeclarePlayers;
Proggy;
Wait(1000);
LoadOreStrings;
Activateclient;
MouseSpeed:= 12;
LoginPlayer;
FindFastRandoms;
FindNormalRandoms;
end;

{ Main loop }
begin
StartScript;
repeat
StartPlayer;

If Players[CurrentPlayer].Loc = 'Bank' then
begin
WalkToSW;
SetRun(True);
MarkTime(AtMines);
DoMine;
end;

if Players[CurrentPlayer].Loc = 'To Bank' then
begin
ToBank;
Bank;
end;

FindFastRandoms;
FindNormalRandoms;
Proggy;
MakeCompass('E');
PerfectNorth;
MakeCompass('E');
PerfectNorth;
if LoadsDone = LoadsToDo then LogNext;
if (not(loggedin)) then nextplayer(false);
Until(false);
end.


edit:
ive changed ToBank; a little bit to test:

procedure ToBank;
var
TheWater, D : integer;
begin
if (not(loggedin)) then
Exit;
Makecompass('N');
WriteLn('Walk To Bank');
Setrun(False);
FindRandoms;
D:= 0;
begin
TheWater:= FindWaterColor;
if TheWater = 0 then
LogOut;
repeat
D:= D+ 1;
X:= 649;
Y:= 11;
if(FindColorSpiral( x, y, TheWater, MMX1, MMY1, MMX2, MMY2))then
begin
Mouse(x+(4), y, 3, 3, true);
Wait(500);
FFlag(10);
end else
begin
TheWater:= FindWaterColor;
end;
WriteLn('D= ' +IntToStr(D));
If (D > 4) then
TheRoadColor:= FindRoadColor;
//FindRandoms;
Until(D > 20) or (RadialRoadWalk(TheRoadColor, 264, 315, 60, 0, 0));
If (D > 20) then
begin
WriteLn('i = 20');
//LogOut;
end;
Flag;
RadialRoadWalk(TheRoadColor, 70, 10, 60, 0, 0);
Wait(20);
SetRun(True);
Wait(20);
RadialRoadWalk(TheRoadColor, 350, 275, 50, 0, 0);
RadialRoadWalk(TheRoadColor, 320, 354, 40, 0, 0);
RadialRoadWalk(TheRoadColor, 359, 275, 47, 0, 0);
//if (not (RadialRoadWalk(TheRoadColor, 280, 300, 54, 0, 0))) then
TheRoadColor:= FindRoadColor;
repeat
if FindBankDDtm then Exit;
if (RadialRoadWalk(TheRoadColor, 280, 300, 54, 0, 0)) then
begin
WriteLn('Found the bank by using RadialWalk');
Exit;
end;
RadialRoadWalk(TheRoadColor, 359, 290, 40, 0, 0);
FindRandoms;
if (not(loggedin)) then Exit;

until(RadialRoadWalk(TheRoadColor, 280, 300, 54, 0, 0));
end;
Flag;
end;

the test in de de bug box the first run:
Walk To Bank
WaterColor = 12227199
D= 1
D= 2
D= 3
D= 4
D= 5
Could not find Road Color!
D= 6
Could not find Road Color!
D= 7
RoadColor = 6711150
RoadColor = 6842480
RoadColor = 6842480
Found Bank by using DDTM


the secont run:
Walk To Bank
WaterColor = 12227199
D= 1
<here did he logs out>
Could not find Water Color!
D= 2
Could not find Water Color!
D= 3
Could not find Water Color!
D= 4
Could not find Water Color!
D= 5
Could not find Road Color!
Could not find Water Color!
D= 6
Could not find Road Color!
Could not find Water Color!
D= 7
Could not find Road Color!
Could not find Water Color!
etc..

MasterKill

2007-09-02 06:18:17

Do you reset D : integer to 0 again after your walk?

couse you have exit; before writeLn('i = 20'); you don't see the error.

I hope that's it, gl

Rikje

2007-09-02 06:20:44

meh,, have edit that part before posting.
but first is had I. and reseted I:= 0; but i had the same he logged out. so i changed it to D.

i only use D in this loop. D get freed afer the procedure. so its atomatic 0 again.

edit:
And the logout is after the repeat loop. and this happends:
it logs out and after that it is spamming cant find water color. after the repeat loop is no findwatercolor called.

edit edit: iam allmost sure iam not looking on the right place. but i dont know where to look else.