No, it's just one after another. I'll run it again though…
program New;
{.include SRL/SRL.scar}
{.include SRL/SRL/misc/MusicLocation.scar}
const
Fawr = True; //RUN FAWR?!!?
var
dtmRuneEssence, dtmPureEssence, dtmAirTiara, dtmAirTalisman, dtmAirRune: integer;
Pure, Regular : Boolean;
dtmToGateA1, dtmToGateA2, dtmToGateA3: integer;
dtmToAltar1, dtmToAltar2, dtmToAltar3, dtmEnterAltar: integer;
dtmToGateB1, dtmToGateB2, dtmToGateB3: integer;
dtmToBank1, dtmToBank2, dtmToBank3: integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Strings[0] := 'a'; //a - Regular Ess b - Pure ess c - Both
Players[0].Strings[1] := 'Unequipped' //Unequipped if you are not completely prepared
Players[0].Integers[0] := 1; //How many loads for this character
Players[0].Booleans[0] := True; //True for a tiara, False for a talisman
Players[0].Active := True;
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;
function GetLocationByMusic : String;
begin
if IsMusicPlaying('Workshop') then Result := 'Bank';
if IsMusicPlaying('Fanfare') then Result := 'Falador';
if IsMusicPlaying('Wander') then Result := 'Gate';
if IsMusicPlaying('Nightfall') then Result := 'Forest';
if IsMusicPlaying('Serene') then Result := 'Altar';
writeln(Result);
end;
procedure ChuckNorrisODileHunta;//Don't ask
var
RunDirect: string;
I: integer;
begin
case random(50) of
0: Wait(300+random(800));
1: BoredHuman;
2: RandomRClick;
3: MouseSpeed := 10 + random(7);
4: begin
I:=Random(900);
KeyDown(39);
wait(I);
KeyUp(39);
KeyDown(37);
wait(I+random(50));
KeyUp(37);
end;
7: Wait(400+random(900));
8: RunDirect := 'N';
9: RunDirect := 'S';
10: RunDirect := 'W';
11: RunDirect := 'E';
end;
FindNormalRandoms;
if FindFight then
RunTo(RunDirect, Fawr);
case random(50) of
0: Wait(300+random(800));
1: BoredHuman;
2: RandomRClick;
3: MouseSpeed := 8 + random(7);
4: Wait(400+random(500));
7: Wait(400+random(900));
8: RunDirect := 'N';
9: RunDirect := 'S';
10: RunDirect := 'W';
11: RunDirect := 'E';
end;
case random(8) of
0: SetRun(True);
1: SetRun(False);
2: Wait(Random(50));
3: Wait(Random(60));
end;
case random(20) of
0: SetRun(True);
1: SetRun(False);
end;
end;
procedure ItemDTMs;
begin
dtmRuneEssence := DTMFromString('78DA638C656060086040016101FE0C1A409A1' +
'188FF03012348DE87010D302291403A8708352940220ABF1A002E' +
'4807E4');
dtmPureEssence := DTMFromString('78DA638C606260E0646440062DD5550C72401' +
'A24FA1F0818AB30D540646124904E00AA1124A0261BA8460CBF1A' +
'00204C0781');
dtmAirTiara := DTMFromString('78DA634C65646010026224F0F7EF5F060D200' +
'D12FD0F048CE9409604AA1A882C8C04D2D14096280135B9409620' +
'7E3500E4AE0913');
dtmAirTalisman := DTMFromString('78DA637466626078C48002F66FDBC6A00CA41' +
'981F83F10307A02D5BC6440038C482490B601AA7946408D2350CD' +
'47FC6A00692F0B09');
dtmAirRune := DTMFromString('78DA639CC6C4C0F08C01053C7DF488410E483' +
'302F17F2060EC00AA79C18006189148200D32E72301354B806A1E' +
'E3570300158F0CD1');
writeln('ItemDTMs successfully loaded');
end;
procedure ToGateADDTMs;
var
SubPoint : array [0..2] of TDTMPointDef;
MainPoint : TDTMPointDef;
TDTM: TDTM;
begin
MainPoint.x :=618;
MainPoint.y :=118;
MainPoint.Areasize:=1;
MainPoint.Areashape:=0;
MainPoint.Color:=FindWaterColor;
MainPoint.Tolerance:=0;
SubPoint[0].x:=626;
SubPoint[0].y:=110;
SubPoint[0].areasize:=1;
SubPoint[0].areashape:=0;
SubPoint[0].color:=16247540;
SubPoint[0].tolerance:=50;
SubPoint[1].x:=664;
SubPoint[1].y:=106;
SubPoint[1].areasize:=1;
SubPoint[1].areashape:=0;
SubPoint[1].color:=16247540;
SubPoint[1].tolerance:=50;
SubPoint[2].x:=658;
SubPoint[2].y:=125;
SubPoint[2].areasize:=1;
SubPoint[2].areashape:=0;
SubPoint[2].color:=16247540;
SubPoint[2].tolerance:=50;
TDTM.MainPoint := MainPoint;
TDTM.SubPoints := SubPoint;
dtmToGateA1:= AddDTM(TDTM);
MainPoint.x :=642;
MainPoint.y :=143;
MainPoint.Areasize:=1;
MainPoint.Areashape:=0;
MainPoint.Color:=1337;
MainPoint.Tolerance:=255;
SubPoint[0].x:=628;
SubPoint[0].y:=39;
SubPoint[0].areasize:=1;
SubPoint[0].areashape:=0;
SubPoint[0].color:=1455424;
SubPoint[0].tolerance:=70;
SubPoint[1].x:=628;
SubPoint[1].y:=27;
SubPoint[1].areasize:=1;
SubPoint[1].areashape:=0;
SubPoint[1].color:=1455424;
SubPoint[1].tolerance:=70;
SubPoint[2].x:=613;
SubPoint[2].y:=31;
SubPoint[2].areasize:=1;
SubPoint[2].areashape:=0;
SubPoint[2].color:=1455424;
SubPoint[2].tolerance:=70;
TDTM.MainPoint := MainPoint;
TDTM.SubPoints := SubPoint;
dtmToGateA2:= AddDTM(TDTM);
MainPoint.x :=645;
MainPoint.y :=129;
MainPoint.Areasize:=1;
MainPoint.Areashape:=0;
MainPoint.Color:=1337;
MainPoint.Tolerance:=255;
SubPoint[0].x:=622;
SubPoint[0].y:=121;
SubPoint[0].areasize:=1;
SubPoint[0].areashape:=0;
SubPoint[0].color:=10140350;
SubPoint[0].tolerance:=70;
SubPoint[1].x:=636;
SubPoint[1].y:=118;
SubPoint[1].areasize:=1;
SubPoint[1].areashape:=0;
SubPoint[1].color:=10140350;
SubPoint[1].tolerance:=70;
SubPoint[2].x:=629;
SubPoint[2].y:=120;
SubPoint[2].areasize:=1;
SubPoint[2].areashape:=0;
SubPoint[2].color:=1196099;
SubPoint[2].tolerance:=70;
TDTM.MainPoint := MainPoint;
TDTM.SubPoints := SubPoint;
dtmToGateA3:= AddDTM(TDTM);
writeln('ToGateADDTMs successfully loaded');
end;
procedure ToAltarDDTMs;
begin
end;
procedure ToGateBDDTMs;
begin
end;
procedure ToBankDDTMs;
begin
end;
procedure ClearItemDTMs;
begin
FreeDTM(dtmAirTiara);
FreeDTM(dtmAirTalisman);
FreeDTM(dtmRuneEssence);
FreeDTM(dtmPureEssence);
FreeDTM(dtmAirRune);
writeln('Item DTMs successfully cleared');
end;
procedure ClearToGateADDTMs;
begin
FreeDTM(dtmToGateA1);
FreeDTM(dtmToGateA2);
FreeDTM(dtmToGateA3);
writeln('ToGateADDTMs successfully cleared');
end;
procedure ClearToAltarDDTMs;
begin
FreeDTM(dtmToAltar1);
FreeDTM(dtmToAltar2);
FreeDTM(dtmToAltar3);
writeln('ToAltarDDTMs successfully cleared');
end;
procedure ClearToGateBDDTMs;
begin
FreeDTM(dtmToGateB1);
FreeDTM(dtmToGateB2);
FreeDTM(dtmToGateB3);
writeln('ToGateBDDTMs successfully cleared');
end;
procedure ClearToBankDDTMs;
begin
FreeDTM(dtmToBank1);
FreeDTM(dtmToBank2);
FreeDTM(dtmToBank3);
writeln('ToBankDDTMs successfully cleared ');
end;
procedure WithdrawAirTiara;
var
x, y : integer;
begin
if not FindDTM(dtmAirTiara, x, y, MSX1, MSY1, MSX2, MSY2) then
wait(300+random(300));
if FindDTM(dtmAirTiara, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
case random(5) of
0: Mouse(x, y, 1, 1, True);
1: Mouse(x, y, 1, 1, True);
2: Mouse(x, y, 1, 1, True);
3: Mouse(x, y, 1, 1, True);
4: begin
Mouse(x, y, 1, 1, False);
ChooseOption('1');
end;
end;
wait(400+random(250));
CloseBank;
Gametab(4);
wait(400+random(250));
if FindDTM(dtmAirTiara, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 1, 1, True);
wait(400+random(250));
end;
OpenBankFast('feb');
Deposit(1, 1, 1);
CloseBank;
wait(200+random(300));
GameTab(5);
wait(300+random(300));
if FindDTM(dtmAirTiara, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Players[CurrentPlayer].Strings[1] := 'Equipped';
Exit;
end;
end;
Players[CurrentPlayer].Strings[2] := 'No Air Tiara Found';
NextPlayer(False);
end;
procedure WithdrawAirTalisman;
var
x, y: integer;
begin
if not FindDTM(dtmAirTalisman, x, y, MSX1, MSY1, MSX2, MSY2) then
wait(300);
if FindDTM(dtmAirTalisman, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
case random(5) of
0: Mouse(x, y, 1, 1, True);
1: Mouse(x, y, 1, 1, True);
2: Mouse(x, y, 1, 1, True);
3: Mouse(x, y, 1, 1, True);
4: begin
Mouse(x, y, 1, 1, False);
ChooseOption('1');
end;
5: writeln('JackLKrawl is not a pimp');//lol
end;
CloseBank;
GameTab(4);
if FindDTM(dtmAirTalisman, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Players[CurrentPlayer].Strings[1] := 'Equipped';
Exit;
end;
end;
Players[CurrentPlayer].Strings[2] := 'No Air Talisman found.';
NextPlayer(False);
end;
procedure WithdrawPureEssence;
var
x, y: integer;
begin
if FindDTM(dtmPureEssence, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
MMouse(x, y, 1, 1);
wait(200+random(300));
if isuptext('ure ess') then
begin
Mouse(x, y, 1, 1, False);
ChooseOption('ll');
CloseBank;
Exit;
end;
end;
if FindObj(x, y, 'ure', 8027012, 30) then
begin
Mouse(x, y, 1, 1, False);
ChooseOption('ll');
CloseBank;
Exit;
end;
Players[CurrentPlayer].Strings[2] := 'Could not find Pure Essence';
if Players[CurrentPlayer].Strings[0] = 'c' then
begin
Pure:=False;
Exit;
end;
NextPlayer(False);
end;
procedure WithdrawRegularEssence;
var
x, y: integer;
begin
wait(500+random(500));
if FindDTM(dtmRuneEssence, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
MMouse(x, y, 1, 1);
wait(200+random(300));
if isuptext('une ess') then
begin
Mouse(x, y, 1, 1, False);
ChooseOption('ll');
CloseBank;
Exit;
end;
end;
Players[CurrentPlayer].Strings[2] := 'Could not find Rune Essence';
if FindObj(x, y, 'une ess', 5723998, 30) then
begin
Mouse(x, y, 1, 1, False);
ChooseOption('All');
CloseBank;
Exit;
end;
if Players[CurrentPlayer].Strings[0] = 'c' then
begin
Regular:=False;
Exit;
end;
NextPlayer(False);
end;
procedure WithdrawBothEssence;
begin
if not (loggedin) then exit;
if Regular = False then
begin
Players[CurrentPlayer].strings[0] := 'b';
WithdrawPureEssence;
Exit;
end;
if Pure = False then
begin
Players[CurrentPlayer].strings[0] := 'a';
WithdrawRegularEssence;
Exit;
end;
case random(2) of
0: WithdrawRegularEssence;
1: WithdrawPureEssence;
end;
end;
procedure EquipPlayer;
var
x, y: integer;
begin
if not (GetLocationByMusic = 'Bank') then exit;
if not(loggedin) then
if Players[CurrentPlayer].Active = True then
LoginPlayer;
OpenBankQuiet('feb');
FixBank;
ItemDTMs;
wait(900);
if Players[CurrentPlayer].Booleans[0] = True then WithdrawAirTiara;
if Players[CurrentPlayer].Booleans[0] = False then WithdrawAirTalisman;
ClearItemDTMs;
end;
procedure WithdrawEssence;
var
x, y: integer;
begin
if not (loggedin) then exit;
OpenBankQuiet('feb');
FFlag(0);
wait(300+random(300));
FixBank;
ItemDTMs;
case Players[CurrentPlayer].Strings[0] of
'a' : WithdrawRegularEssence;
'b' : WithdrawPureEssence;
'c' : WithdrawBothEssence;
end;
ClearItemDTMs;
end;
procedure DepositRunes;//I'm keeping this procedure simple for now.
var
x, y, A, B: integer;
begin
if not LoggedIn then exit;
if not FindDTM(dtmAirRune, x, y, MIX1, MIY1, MIX2, MIY2) then exit;
if not GetLocationByMusic = 'Bank' then exit;
MMouse(x, y, 5, 5);
if isuptext('ir Rune') then
begin
GetMousePos(A, B);
OpenBankFast('feb');
wait(500+random(900));
Mouse(A, B, 0, 0, False);
ChooseOption('All');
CloseBank;
Exit;
end;
if FindObj(a, b, 'ir Rune', 14803685, 30) then
begin
OpenBankFast('feb');
wait(500+random(900));
Mouse(A, B, 0, 0, False);
ChooseOption('All');
CloseBank;
Exit;
end;
end;
procedure ToGateA;
var
x, y, a, b: integer;
begin
if not loggedin then exit;
ToGateADDTMs;
case DTMRotated(dtmToGateA1, x, y, MMX1, MMY1, MMX2, MMY2) of
True: begin
Mouse(x+25, y, 1, 1, True);
end;
False:begin
MakeCompass('N');
RadialWalk(FindWaterColor, 200, 260, 60, 0, 0);
end;
end;
if FlagPresent then Wait(3000+random(500));
if FlagPresent then FFlag(5);
case DTMRotated(dtmToGateA2, x, y, MMX1, MMY1, MMX2, MMY2) of
True: begin
Mouse(x, y, 1, 1, True);
end;
False:begin
MakeCompass('N');
RadialRoadWalk(FindFallyRoadColor, 160, 260, 60, 0, 0);
end;
end;
if FlagPresent then Wait(3000+random(500));
if FlagPresent then FFlag(5);
case DTMRotated(dtmToGateA3, x, y, MMX1, MMY1, MMX2, MMY2) of
True: begin
Mouse(x, y, 1, 1, True);
FFlag(10);
end;
False:begin
MakeCompass('N');
RadialRoadWalk(FindRoadColor, 170, 260, 60, 0, 0);
end;
end;
if FlagPresent then Wait(3000+random(500));
if FlagPresent then FFlag(5);
case GetLocationByMusic of
'Falador': begin
MakeCompass('N');
RadialRoadWalk(FindFallyRoadColor, 170, 200, 60, 0, 0);
RadialRoadWalk(FindRoadColor, 170, 200, 60, 0, 0);
end;
'Gate': begin
Writeln('Successfully reached Gate');
ClearToGateADDTMs;
Exit;
end;
'Forest': if DTMRotated(dtmToGateA3, A, B, MMX1, MMY1, MMX2, MMY2) then
begin
writeln('O...K...Odd...');
writeln('You''re about where you should be...but just in case');
if FindSymbol(x, y, 'Rare Trees') then
begin
writeln('OK, strange. Alright, ' + Players[CurrentPlayer].Name + ' is good to go!');
ClearToGateADDTMs;
wait(500+random(500));
Exit;
end;
end else
begin
if FindRoadColor > 0 then
begin
RadialRoadWalk(FindRoadColor, 0, 360, 60, 0, 0);
begin
Mouse(x, y, 1, 1, True);
FFlag(0);
ClearToGateADDTMs;
Exit;
end;
end else
NextPlayer(False);
end;
end;
end;
procedure ToAltar; //I got lazy, I'll fix it later.
var
x, y, a, b: integer;
begin
if not loggedin then exit;
if Players[CurrentPlayer].Strings[1] = 'Unequipped' then exit;
if GetLocationByMusic = 'Bank' then exit;
ToAltarDDTMs;
case DTMRotated(dtmToAltar1, x, y, MMX1, MMY1, MMX2, MMY2) of
True: Mouse(x, y+5, 1, 1, True);
False:begin
if FindSymbolin(x, y, 'Rare Trees', MMX1, MMY1, 664, 0) then
begin
Mouse(x, y, 1, 1, True);
FFlag(20);
if DTMRotated(dtmToAltar1, x, y, MMX1, MMY1, MMX2, MMY2) then
Mouse(x, y, 1, 1, True);
end else
begin
NextPlayer(False);
ClearToAltarDDTMs;
Exit;
end;
end;
end;
if FlagPresent then Wait(3000+random(500));
if FlagPresent then FFlag(5);
case DTMRotated(dtmToAltar2, x, y, MMX1, MMY1, MMX2, MMY2) of
True: Mouse(x, y, 1, 1, True);
False:begin
if FindSymbol(x, y, 'Water source') then
Mouse(x, y+50, 1, 1, True);
while FlagPresent do
begin
if FindSymbol(x, y, 'Spinning wheel') then
Mouse(x, y+80, 1, 1, True);
end;
end;
end;
if FlagPresent then Wait(3000+random(500));
if FlagPresent then FFlag(5);
case DTMRotated(dtmToAltar3, x, y, MMX1, MMY1, MMX2, MMY2) of
True: Mouse(x, y, 1, 1, True);
False:begin
Players[CurrentPlayer].Loc := 'Lost';
NextPlayer(False);
end;
end;
if FlagPresent then Wait(3000+random(500));
if FlagPresent then FFlag(5);
case DTMRotated(dtmEnterAltar, x, y, MSX1, MSY1, MSX2, MSY2) of
True: Mouse(x, y, 1, 1, True);
False: begin
if FindObj(x, y, 'ysterious', 55, 40) then
Mouse(x, y, 1, 1, True);
end else
begin
ClearToAltarDDTMs;
Exit;
end;
end;
if FlagPresent then Wait(3000+random(500));
if FlagPresent then FFlag(5);
ClearToAltarDDTMs;
if GetLocationByMusic = 'Altar' then Exit;
Players[CurrentPlayer].loc := GetLocationByMusic;
NextPlayer(False);
end;
procedure ToCraft;
begin
end;
procedure ToGateB;
begin
if not loggedin then exit;
if Players[CurrentPlayer].Strings[1] = 'Unequipped' then exit;
if GetLocationByMusic = 'Bank' then exit;
end;
procedure ToBank;
begin
end;
begin
SetupSRL;
SetupSRLMusic;
WithdrawEssence;
ToGateA;
ToAltar;
end.
[Runtime Error] : Out Of Range in line 446 in script C:\Program Files\SCAR 3.13\Scripts\Aer Faber V1.0a.scar
then there are type mismatches, and these all over the place.
Anyway, I deleted about 200 lines of code in this version trying to figure out what it was, and I've narrowed it down to if thens, and some cases. It had no trouble walking.