SRL Archive - RS3 Outdated / Broken Scripts

CheckMusic: Check you location in RS using music!


cbris

2007-09-09 14:49:31

In making a complex script involving heavy walking, (think mind runes :D) I stumbled on a great set of new functions in SRL 4; MusicLocation.scar.

The included functions are good, but a little heavy for what i had planed, so I made this. To use this function, simply insert the name of the music that plays in the area you character is in. If that music is not found, the script exits.

Fast, and light! Hope you like it.


function CheckMusic(Music: string): Boolean; //By Cbris
var
PlayingMusic: string;
begin
PlayingMusic := GetMusic;
if (PlayingMusic = Music) then
begin
WriteLn(music + ' is playing, you are in the right place.');
end else
begin
WriteLn(music + 'is NOT playing, you are lost!');
WriteLn('exiting...');
TerminateScript;
end;
Result := True;
end;

To use simply copy and paste into you script and add the MusicLocation include.

{.include SRL/SRL/misc/MusicLocation.scar}

Billy Bobby8

2007-09-09 14:52:14

Wow, this could really help with scripts! Nice find!

mat_de_b

2007-09-09 15:31:27

Put this in Public Test Corner?

Mr.Klean

2007-09-09 15:35:20

Hmm, this seems like a great idea to check position, although music does play the same song in a quite a large area which means you could be lost while playing the right song.

WT-Fakawi

2007-09-09 15:50:05

Its already in SRL. GetLocation; by nielsie95…But good shot :)

ShowerThoughts

2007-09-09 16:45:05

wt fawaki you always have to bring the bad news ;)

rotflmfwao

2007-09-12 19:08:29

hermpie, nice. Btw, app for members.

cbris

2007-10-14 12:35:49

Fakawi. i know it's in SRL, but the SRL GetLocation requires the .loc, something that my script does not need. CheckMusic is just a lighter variation of GetLocation. In fact, CheckMusic uses some of the same things that GetLocation does.

mark9510

2007-10-15 09:03:58

well this is not so special in my idea