SRL Archive - S.M.A.R.T. Questions and Answers.

smart opening but not doing anything


hessels92

2008-02-16 17:59:28

hey guys i can get smart to open and all with my script at current i am using eye of newter. what happens is i run the script smart opens and then it just says Successfully compiled
Successfully executed.
wat am i doing wrong any sugestions would be greatful
cheers guys

mixster

2008-02-16 18:10:55

Have you only got SmartSetup/Ex in your script? Also, have you got the SmartSetup/Ex in a procedure - if so, then make sure then end at the end of it doesn't have a . as it would end the entire script prematurely.
Also, it would be much easier to help if you posted your script.

hessels92

2008-02-16 18:26:07

{///////////////////////////////////////////////////////////////////////////////
[ Eye of Newt[er] ]
[---------------------------------------------]
[ Writer: Gerauchert =) ]
[ Category: Buying/Banking ]
[ Version: 1.5 ]
[ Note: Updated! 2/15/08 ]
[---------------------------------------------]
--------------------------------------------------------------------------------
Description: Buys Eye of Newt at Port Sarim and Banks in Draynor...
--------------------------------------------------------------------------------

SETUP:
1) Place characters at draynor bank booths with 84 gp
2) Keep money in first bank slot!
3) Fill in player info and hit start
4) Sit Back and ENJOY!!
5) Post progress reports and errors plz!


Change Log:
v1.0 - first release

v1.5 - Major Update!
- More failsafes for walking
- Banking failsafe DDTM
- Fixed the buying endless loop
- Better radius/angles on RRW
- Faster walking/detecting DDTMs
- More randomness and antiban


///////////////////////////////////////////////////////////////////////////////}

program EyeOfNewt;
{.include SRL/SRL/Misc/Smart.scar}
{.include SRL\SRL.scar}
{.include SRL\SRL\misc\path.scar}

begin
SmartSetup('ams3', False, False); {This loads a world with the prefix ams3 using Low Detail and
Unsigned Java.}
SetTargetDC(SmartGetDC); {This sets the SCAR bitmap for ALL color/bitmap/dtm finding to
the smart bitmap.}
end.



var
x,y,WaitTime,NewtDTM,BankDTM,Newts,Loads,Clicks: Integer;


const
YourSRLId = ''; // Make sure you have one!!!
YourSRLPassword = ''; // Make sure you fill this in!!!


Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 letters of your Username
Players[0].Active := True; // Auto with this char?
Players[0].Integers[0] := 5; // Loads before switch?

end;

Procedure MainLoop; Forward;

Procedure DeclareVars;
begin
Path[0].Mainpoint.x:=615;
Path[0].Mainpoint.y:=41;
Path[0].Subpoints[0].x:=643;
Path[0].Subpoints[0].y:=21;
Path[0].Subpoints[1].x:=639;
Path[0].Subpoints[1].y:=38;
Path[0].Subpoints[2].x:=603;
Path[0].Subpoints[2].y:=35;
Path[1].Mainpoint.x:=597;
Path[1].Mainpoint.y:=119;
Path[1].Subpoints[0].x:=652;
Path[1].Subpoints[0].y:=92;
Path[1].Subpoints[1].x:=690;
Path[1].Subpoints[1].y:=94;
Path[1].Subpoints[2].x:=603;
Path[1].Subpoints[2].y:=81;
Path[1].Subpoints[3].x:=609;
Path[1].Subpoints[3].y:=109;
Path[2].Mainpoint.x:=685;
Path[2].Mainpoint.y:=65;
Path[2].Subpoints[0].x:=652;
Path[2].Subpoints[0].y:=54;
Path[2].Subpoints[1].x:=654;
Path[2].Subpoints[1].y:=30;
Path[2].Subpoints[2].x:=620;
Path[2].Subpoints[2].y:=48;
Path[2].Subpoints[3].x:=637;
Path[2].Subpoints[3].y:=74;
Path[3].Mainpoint.x:=643;
Path[3].Mainpoint.y:=81;
Path[3].Subpoints[0].x:=666;
Path[3].Subpoints[0].y:=41;
Path[3].Subpoints[1].x:=662;
Path[3].Subpoints[1].y:=58;
Path[3].Subpoints[2].x:=662;
Path[3].Subpoints[2].y:=77;
Path[3].Subpoints[3].x:=621;
Path[3].Subpoints[3].y:=76;
Path[4].Mainpoint.x:=595;
Path[4].Mainpoint.y:=126;
Path[4].Subpoints[0].x:=642;
Path[4].Subpoints[0].y:=86;
Path[4].Subpoints[1].x:=590;
Path[4].Subpoints[1].y:=89;
Path[4].Subpoints[2].x:=636;
Path[4].Subpoints[2].y:=107;
Path[4].Subpoints[3].x:=618;
Path[4].Subpoints[3].y:=121;
NewtDTM := DTMFromString('78DA636C63646028664001174F9F66F80FA48' +
'1320CFF8180B10BC8CA6340038C482490EE06B24A09A86901B2CA' +
'09A86904B20A89302707BF1A0045BD0D48');
BankDTM := DTMFromString('78DA639CC7C4C090CE8002D62CB065F80FA41' +
'981F83F10304E00AA4980C8B140D5FCF9C3C420075503028C1381' +
'6A3209A89904549383AAE6EB570654359D403579F8CD01002BC31' +
'3DD');
end;

function SetDDTM(DDTM: String): Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..4] of TDTMPointDef;
dtmSubPointz: Array [0..3] of TDTMPointDef;
GrassDTM,GrasssDTM,RockDTM: TDTM;
RColor: Integer;
begin
RoadColor := FindRoadColor;
case DDTM of

'Grass': begin
dtmMainPoint.x := 783;
dtmMainPoint.y := 307;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 1797975;
dtmMainPoint.Tolerance := 255;

dtmSubPoints[0].x := 783;
dtmSubPoints[0].y := 307;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 1797975;
dtmSubPoints[0].Tolerance := 255;

dtmSubPoints[1].x := 776;
dtmSubPoints[1].y := 227;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := RoadColor;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 775;
dtmSubPoints[2].y := 253;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := RoadColor;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 764;
dtmSubPoints[3].y := 262;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := RoadColor;
dtmSubPoints[3].Tolerance := 0;

dtmSubPoints[4].x := 744;
dtmSubPoints[4].y := 266;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := RoadColor;
dtmSubPoints[4].Tolerance := 0;


GrassDTM.MainPoint := dtmMainPoint;
GrassDTM.SubPoints := dtmSubPoints;
Result := AddDTM(GrassDTM);
end;

'Grasss': begin
dtmMainPoint.x := 848;
dtmMainPoint.y := 187;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 1797982;
dtmMainPoint.Tolerance := 255;

dtmSubPoints[0].x := 848;
dtmSubPoints[0].y := 187;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 1797982;
dtmSubPoints[0].Tolerance := 255;

dtmSubPoints[1].x := 857;
dtmSubPoints[1].y := 257;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := RoadColor;
dtmSubPoints[1].Tolerance := 0;

dtmSubPoints[2].x := 876;
dtmSubPoints[2].y := 268;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := RoadColor;
dtmSubPoints[2].Tolerance := 0;

dtmSubPoints[3].x := 901;
dtmSubPoints[3].y := 237;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := RoadColor;
dtmSubPoints[3].Tolerance := 0;

dtmSubPoints[4].x := 897;
dtmSubPoints[4].y := 267;
dtmSubPoints[4].AreaSize := 0;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := RoadColor;
dtmSubPoints[4].Tolerance := 0;

GrasssDTM.MainPoint := dtmMainPoint;
GrasssDTM.SubPoints := dtmSubPoints;
Result := AddDTM(GrasssDTM);
end;


'Rock': begin
RColor := FindRockColor;
dtmMainPoint.x := 852;
dtmMainPoint.y := 161;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := FindRoadColor;
dtmMainPoint.Tolerance := 255;

dtmSubPointz[0].x := 852;
dtmSubPointz[0].y := 161;
dtmSubPointz[0].AreaSize := 0;
dtmSubPointz[0].AreaShape := 0;
dtmSubPointz[0].Color := FindRoadColor;
dtmSubPointz[0].Tolerance := 255;

dtmSubPointz[1].x := 846;
dtmSubPointz[1].y := 173;
dtmSubPointz[1].AreaSize := 4;
dtmSubPointz[1].AreaShape := 0;
dtmSubPointz[1].Color := RColor;
dtmSubPointz[1].Tolerance := 0;

dtmSubPointz[2].x := 847;
dtmSubPointz[2].y := 181;
dtmSubPointz[2].AreaSize := 4;
dtmSubPointz[2].AreaShape := 0;
dtmSubPointz[2].Color := RColor;
dtmSubPointz[2].Tolerance := 0;

dtmSubPointz[3].x := 833;
dtmSubPointz[3].y := 189;
dtmSubPointz[3].AreaSize := 4;
dtmSubPointz[3].AreaShape := 0;
dtmSubPointz[3].Color := RColor;
dtmSubPointz[3].Tolerance := 0;

RockDTM.MainPoint := dtmMainPoint;
RockDTM.SubPoints := dtmSubPointz;
Result := AddDTM(RockDTM);
end;
end;
end;

Function BankDDTM: Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..5] of TDTMPointDef;
TempTDTM: TDTM;
begin
dtmMainPoint.x := 913;
dtmMainPoint.y := 261;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := 6203578;
dtmMainPoint.Tolerance := 255;

dtmSubPoints[0].x := 913;
dtmSubPoints[0].y := 261;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := 6203578;
dtmSubPoints[0].Tolerance := 255;

dtmSubPoints[1].x := 898;
dtmSubPoints[1].y := 254;
dtmSubPoints[1].AreaSize := 4;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := 195836;
dtmSubPoints[1].Tolerance := 30;

dtmSubPoints[2].x := 899;
dtmSubPoints[2].y := 263;
dtmSubPoints[2].AreaSize := 4;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := 60909;
dtmSubPoints[2].Tolerance := 30;

dtmSubPoints[3].x := 898;
dtmSubPoints[3].y := 267;
dtmSubPoints[3].AreaSize := 4;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := 195836;
dtmSubPoints[3].Tolerance := 30;

dtmSubPoints[4].x := 890;
dtmSubPoints[4].y := 267;
dtmSubPoints[4].AreaSize := 4;
dtmSubPoints[4].AreaShape := 0;
dtmSubPoints[4].Color := 195836;
dtmSubPoints[4].Tolerance := 30;

dtmSubPoints[5].x := 861;
dtmSubPoints[5].y := 292;
dtmSubPoints[5].AreaSize := 0;
dtmSubPoints[5].AreaShape := 0;
dtmSubPoints[5].Color := FindWaterColor;
dtmSubPoints[5].Tolerance := 0;

TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;


Procedure Randoms(Time: Integer);
var
q: Integer;
begin
q := GetSystemTime;
if(not(LoggedIn))then Exit;
if(FindFight)then
RunAway('S',True,3,4000);
FTWait(Time);
FindNormalRandoms;
Status(IntToStr(GetSystemTime-q) + ' ms Random Check');
end;

Procedure PReport;
var
Active: String;
i: Integer;
begin
for i := 0 to (HowManyPlayers - 1) do
begin
if(Players[i].Active = True)then
Active := 'True';
if(Players[i].Active = False)then
Active := 'False';
Writeln(Players[i].Nick + ' Active : ' + Active + ' Gained : '
+ IntToStr(Players[i].Integers[1]) + ' Newts ' + Players[i].Loc);
end;
end;

Procedure Report;
begin
SRLRandomsReport;
Writeln('-------------------------------------------');
Writeln('---------------Eye of Newt[er]-------------');
Writeln('-------------------------------------------');
Writeln('Ran For : ' + TimeRunning);
Writeln('Gained : ' + IntToStr(Newts) + ' Newts');
Writeln('-------------------------------------------');
Writeln('---------------HAPPY AUTOING!!!------------');
Writeln('-------------------------------------------');
PReport;
SendSRLReport;
end;

Procedure Switch(Active: Boolean; Reason: String);
begin
if(Active = True)then
begin
Players[CurrentPlayer].Loc := Reason;
Report;
NextPlayer(True);
MainLoop;
end else
Players[CurrentPlayer].Loc := Reason;
Report;
NextPlayer(False);
MainLoop;
end;

{*******************************************************************************
function RRW(TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
By: Nielsie95 -- Modified by Gerauchert =)
Description: Same as normal, but took out the flag finder =/
StartRadial/EndRadial: Any number between 0-720. 0=N,90=E,180=S,270=W.
*******************************************************************************}

function RRW(TheColor: Integer; StartRadial, EndRadial: Integer; Radius: Integer; Xmod, Ymod: Integer): Boolean;
var
tpa: TPointArray;
i: Integer;
begin
Result := False;
if (not LoggedIn) then Exit;
if (RoadColorChecker) then
if (DebugRadialRoad) then
WriteLn(' THROUGH RADIALROADWALK= ---> ' + IntToStr(RoadColor));
if RadialWalkEx(tpa, MMCX, MMCY, TheColor, 0, StartRadial, EndRadial, Radius) then
for i := 0 to High(tpa) do
if MFNF(tpa[i].x, tpa[i].y, Xmod, Ymod) then
begin
Result := True;
Break;
end;
end;

{*******************************************************************************
Procedure XFlag(Dist: Integer);
By: gerauchert
Description: Waits until a certain distance from the flag.
Ex: XFLag(10); will wait until 20 pixels from the flag
*******************************************************************************}
Procedure XFLag(Dist: Integer);
var
Time: Integer;
begin
Time := GetSystemTime;
repeat
if(FlagDistance <= Dist*2)then
Break;
if((GetSystemTime - Time) > 25000)then
Break;
Wait(100);
if(Random(20) = 1)then SleepAndMoveMouse(500 + random(200));
until(not(FlagPresent));
end;

{*******************************************************************************
function Function GetMMLevelz(LevelType : String): integer;
By: Raymond -- MODIFIED BY GERAUCHERT
Description: Returns the level shown next to the minimap.
Colorsign returns the color of the text (Green,Yellow,Orange,Red).
Returns -1 if failed.
*******************************************************************************}
Function GetMMLevelz(LevelType : String): integer;
var
TP : TPoint;
I,x,y : Integer;
Colors : TIntegerArray;
Signs : TStringArray;
ColorSign: String;
begin;
Result := -1;
ColorSign := '';
Case LowerCase(Leveltype) of
'health','hp','hitpoints' : TP := Point(729,29);
'prayer','pray' : TP := Point(746,68);
'run' : TP := Point(740,107);
else
begin;
Writeln('Wrong leveltype.');
Exit;
end;
end;
Colors := [65280,65535,2070783,255];
Signs := ['Green','Yellow','Orange','Red'];
For I := 0 to 3 do
if FindColor(x,y, Colors[I], TP.x,TP.y,TP.x + 30,TP.y + 10) then
Break;
if (I > 3) then
Exit;
Result := StrToIntDef(GetNumbers(GetTextAtEx(x - 10, y-1,0, StatChars,False,False,0,0,Colors[I],50,False, tr_AllChars)), -1);
if Result < 10 then
Result := Max(Result,StrToIntDef(GetNumbers(GetTextAtEx(x - 9, y-1,0, StatChars,False,False,0,0,Colors[I],50,False, tr_AllChars)), -1));
if Result < 10 then
Result := Max(Result,StrToIntDef(GetNumbers(GetTextAtEx(x - 8, y-1,0, StatChars,False,False,0,0,Colors[I],50,False, tr_AllChars)), -1));
if Result < 10 then
Result := Max(Result,StrToIntDef(GetNumbers(GetTextAtEx(x - 9, y-1,0, StatChars,False,False,1,0,Colors[I],50,False, tr_AllChars)), -1));
If Result < 0 then
Exit;
ColorSign := Signs[I];
end;

Procedure RRun;
begin
if(not(LoggedIn))then Exit;
if(GetMMLevelz('run') >= 60)then
SetRun(True);
GameTab(4);
end;

Procedure WalkToMagicShop;
begin
if(not(LoggedIn))then Exit;
RoadColor := FindRoadColor;
Clicks := 0;
Writeln('Leaving the Bank');
repeat
if(not(LoggedIn))then Exit;
if(Clicks >= 3)then
Switch(False,'DDTM Finding Failed.');
RRW(FindRoadColor,310,290,60 + random(10),3,3);
Wait(1000 + random(500));
Clicks := Clicks + 1;
XFlag(0);
until(DTMRotated(SetDDTM('Grasss'),x,y,mmx1,mmy1,mmx2,mmy2));
Writeln('Heading to the road');
Mouse(x,y+5,3,3,True);
Wait(2000 + random(500));
XFlag(0);
Clicks := 0;
if(DTMRotated(SetDDTM('Rock'),x,y,mmx1,mmy1,mmx2,mmy2))then
begin
Mouse(x+14,y,2,1,True);
Wait(2000 + random(500));
XFlag(15);
end;
WalkPath(0);
XFlag(15);
MarkTime(WaitTime);
repeat
if(not(LoggedIn))then Exit;
if(Clicks >= 4)then
Switch(False,'Couldnt Find Crossroads.');
RRW(FindRoadColor,345,150,35,5,3);
Clicks := Clicks + 1;
XFlag(6);
if(WalkPath(4))then
begin
Writeln('Used Backup Path.');
Break;
end;
until(WalkPath(1));
Writeln('Walking down to the magic shop');
SymbolAccuracy := 0.85;
Clicks := 0;
repeat
if(not(LoggedIn))then Exit;
if(FindSymbol(x,y,'Magic Shop'))then Break;
if(Clicks >= 3)then
Switch(False,'Could Not Find Shop.');
SymbolAccuracy := SymbolAccuracy - 0.05;
RRW(RoadColor,270,180,20 + random(5),4,4);
Clicks := Clicks + 1;
XFlag(8);
until(FindSymbol(x,y,'Magic Shop'));
Writeln('At the magic shop!');
Mouse(x,y,2,2,True);
Wait(1000 + random(500));
XFlag(0);
end;

Procedure WalkToBank;
begin
if(not(LoggedIn))then Exit;
Clicks := 0;
RoadColor := FindRoadColor;
Writeln('Leaving the Shop');
repeat
if(not(LoggedIn))then Exit;
if(WalkPath(2))then Break;
if(Clicks >= 3)then
Switch(False,'Couldnt Find Crossroads.');
RRW(FindRoadColor,30,75,40 + random(5),4,4);
Clicks := Clicks + 1;
XFlag(5);
until(WalkPath(2));
Writeln('Passing the crossroads');
Clicks := 0;
repeat
if(not(LoggedIn))then Exit;
if(Clicks >= 4)then
Switch(False,'Walking Failed.');
RRW(FindRoadColor,65,110,40 + random(5),5,2);
Clicks := Clicks + 1;
XFlag(4);
until(WalkPath(3));
Writeln('Heading down to the bank');
XFlag(2);
if(DTMRotated(SetDDTM('Grass'),x,y,mmx1,mmy1,mmx2,mmy2))then
begin
Mouse(x-9,y+5,3,3,True);
Wait(1000 + random(500));
XFlag(2);
end else
begin
Switch(False,'DDTM Finding Failed.');
end;
Clicks := 0;
repeat
if(not(LoggedIn))then Exit;
if(Clicks >= 3)then
Switch(False,'Could Not Find Bank.');
RRW(FindRoadColor,150,180,75 + random(5),2,4);
Wait(1000 + random(500));
XFlag(2);
until(DTMRotated(BankDTM,x,y,mmx1,mmy1,mmx2,mmy2));
Writeln('At Bank!');
Mouse(x,y,2,2,True);
Wait(1000 + random(500));
XFlag(0);
end;

Function HandleDoor: Boolean;
var
DoorColors: TIntegerArray;
TPA: TPointArray;
i,z: Integer;
begin
if(not(LoggedIn))then Exit;
SleepAndMoveMouse(500 + random(200));
MarkTime(WaitTime);
begin
DoorColors := [2320518,872554,2585751,1005942,2652058,1073022,2387341];
x := mscx;
y := mscy;
for i := 0 to 6 do
FindColorsSpiralTolerance(x,y,TPA,DoorColors[i],msx1,msy1,msx2,msy2,4);
for z := 0 to High(TPA) do
begin
MMouse(TPA[z].x,TPA[z].y,2,2);
if(IsUpText('lose'))then
begin
Result := True;
Status('DoorHandling Successful');
Exit;
end;
if(IsUpText('pen'))then
begin
GetMousePos(x,y);
Mouse(x,y,0,0,False);
if(ChooseOption('pen'))then
begin
XFlag(0);
Result := True;
Status('DoorHandling Successful');
Exit;
end;
end;
end;
Status('DoorHandling Failed...NextPlayer');
Switch(False,'Door Handling Failed');
end;
end;

Procedure BuyEyeOfNewt;
begin
if(not(LoggedIn))then Exit;
MarkTime(WaitTime);
repeat
if(not(LoggedIn))then Exit;
if(TimeFromMark(WaitTime) > 60000)then
begin
Switch(False,'Could Not Find Betty');
end;
if(FindObjCustom(x,y,['etty'],[5704536,3540791,6622566,5048910,4393027,3147312],4))then Break;
SymbolAccuracy := 0.75;
if(FindSymbol(x,y,'magic shop'))then
begin
Mouse(x,y,3,3,True);
XFlag(0);
end;
FTWait(1);
until(FindObjCustom(x,y,['etty'],[5704536,3540791,6622566,5048910,4393027,3147312],4));
begin
Mouse(x,y,2,2,False);
if(ChooseOption('rade'))then
begin
XFlag(0);
MarkTime(WaitTime);
Status('Waiting for shop screen');
repeat
if(not(LoggedIn))then Exit;
if(TimeFromMark(WaitTime) > 15000)then
begin
BuyEyeOfNewt;
Exit;
end;
Randoms(1);
until(GetColor(61,308) = 0);
Status('We are in the shop screen');
if(not(GetColor(56,75) = 2070783))then
Mouse(56,75,3,3,True);
MarkTime(WaitTime);
repeat
if(not(LoggedIn))then Exit;
SleepAndMoveMouse(500 + random(200));
if(FindDTM(NewtDTM,x,y,msx1,msy1,msx2,msy2))then
begin
Status('buyin the newts');
Mouse(x,y,1,1,False);
if(ChooseOption('X'))then
begin
Wait(1000 + random(200));
TypeSend('28');
Wait(800 + random(200));
Break;
end;
end else
Switch(False,'Could Not Find Eye Of Newt');
until(TimeFromMark(WaitTime) > 15000);
Status('Closing the shop screen');
MMouse(485,42,3,3);
Wait(500 + random(200));
if(IsUpText('ose'))then
begin
GetMousePos(x,y);
Mouse(x,y,0,0,True);
Randoms(3);
Status('Walking to bank');
Exit;
end else
Switch(False,'Failed To Close Shop Window');
end else
begin
BuyEyeOfNewt;
Exit;
end;
end;
end;

Function DraynorBank: Boolean;
var
BColor: TIntegerArray;
TTPA: TPointArray;
i,z: Integer;
begin
if(not(LoggedIn))then Exit;
begin
BColor := [5797254,5862532,6060168,7303026,7829371,5598845];
MakeCompass('W');
x := mscx;
y := mscy;
for i := 0 to 5 do
begin
FindColorsSpiralTolerance(x,y,TTPA,BColor[i],msx1,msy1,msx2,msy2,3);
end;
MarkTime(WaitTime);
for z := 0 to High(TTPA) do
begin
if(TimeFromMark(WaitTime) > 15000)then
begin
Result := False;
Exit;
end;
if(BankScreen)then
begin
Result := True;
Exit;
end;
MMouse(TTPA[z].x,TTPA[z].y,3,3);
Wait(300 + random(200));
if(IsUpText('oth') or IsUpText('ker'))then
Mouse(TTPA[z].x,TTPA[z].y,0,0,False);
if(ChooseOption('kly') or ChooseOption('ank'))then
begin
Result := True;
Exit;
end;
end;
end;
end;

Procedure BankIt;
var
Fails: Boolean;
z: Integer;
begin
if(not(LoggedIn))then Exit;
MarkTime(WaitTime);
if(DraynorBank = True)then
begin
MarkTime(WaitTime);
repeat
if(not(LoggedIn))then Exit;
if(TimeFromMark(WaitTime) > 12000)then
begin
BankIt;
end;
Randoms(1);
until(BankScreen);
FixBank;
z := CountItemsDTM('inv',NewtDTM);
Newts := Newts + z
Players[CurrentPlayer].Integers[1] := Players[CurrentPlayer].Integers[1] + z;
ReportVars[0] := ReportVars[0] + z;
SleepAndMoveMouse(500 + random(200));
Deposit(1,28,2);
FixBank;
SleepAndMoveMouse(500 + random(200));
MMouse(94,80,5,5);
Wait(500 + random(200));
if(IsUpText('oin'))then
begin
GetMousePos(x,y);
Mouse(x,y,0,0,False);
ChooseOption('X');
Wait(800 + random(300));
TypeSend('84');
Wait(500 + random(500));
CloseBank;
FTWait(2);
MakeCompass('n');
Loads := Loads + 1;
Exit;
end else
begin
CloseBank;
Switch(False,'Out Of Cash');
end;
end else
begin
if(Fails = True)then
Switch(False,'Could Not Find Bank');
Writeln('Bank not found, trying again with DDTM');
Clicks := 0;
MakeCompass('n');
repeat
if(not(LoggedIn))then Exit;
if(Clicks >= 3)then
Switch(False,'Could Not Find Bank');
RRW(FindRoadColor,160,180,50,2,2);
Clicks := Clicks + 1;
XFlag(2);
until(DTMRotated(BankDDTM,x,y,mmx1,mmy1,mmx2,mmy2));
Mouse(x,y,2,2,True);
Wait(1000 + random(500));
XFlag(0);
Fails := True;
BankIt;
end;
end;

Function Finished: Boolean;
var
z,i: Integer;
begin
z:= 0;
for i:= 0 to HowManyPlayers - 1 do
begin
if(Players[i].Active = False)then
z:= z + 1;
if(z = HowManyPlayers)then
begin
Result:= True;
Writeln('All Players Are False! ... Thank You For Using Eye of Newt[er]!');
Exit;
end else
Result:= False;
end;
end;

Procedure StartUp;
begin
Loads := 0;
SetAngle(True);
GameTab(4);
MakeCompass('n');
end;

Procedure ScriptSetup;
begin
if(YourSRLId = '') or (YourSRLPassword = '')then
begin
Writeln('TERMINATED!!! Read the instructions N00B!');
TerminateScript;
end;
ScriptID := '646';
SRLId := YourSRLId;
SRLPassword := YourSRLPassword;
SetupSRL;
DeclarePlayers;
DeclareVars;
ClearDebug;
ActivateClient;
if(not(LoggedIn))then
LoginPlayer;
end;

Procedure MainLoop;
begin
repeat
if(Finished)then Break;
if(not(LoggedIn))then NextPlayer(False);
StartUp;
repeat
if(not(LoggedIn))then Break;
RRun;
WalkToMagicShop;
FTWait(2);
HandleDoor;
BuyEyeOfNewt;
RRun;
HandleDoor;
WalkToBank;
BankIt;
Report;
until(Loads >= Players[CurrentPlayer].Integers[0]);
Switch(True,'Ready to go!');
until(Finished);
FreeDTM(NewtDTM);
FreeDTM(BankDTM);
end;


begin
ScriptSetup;
MainLoop;
end.

here is the script…

Wizzup?

2008-02-16 19:26:22

Hessels. I added SCAR tags and took our your SRLID and Pass. :)

Harry

2008-02-16 19:30:48

I think he has his problem solved now, been chatting with him on MSN.

Hessels says:
haha its all good it worked when i logged in so it running now u have done lots 4 me :) thx
Hy71194 says:
So it works on other scripts, just not that one?
Hessels says:
yea like that script is running now. i started logged in

Close?

hessels92

2008-02-16 23:30:39

yes thx guys

fom

2008-02-17 01:11:23

begin
SmartSetup('ams3', False, False); {This loads a world with the prefix ams3 using Low Detail and
Unsigned Java.}
SetTargetDC(SmartGetDC); {This sets the SCAR bitmap for ALL color/bitmap/dtm finding to
the smart bitmap.}
end.

If you put a period after end it terminates the script, you need a ;