SRL Archive - Other Scripts

Musical SCAR!


Ruroken

2007-03-19 16:15:21

It lets you play music!

press numbers 1 to 6 to play different notes on the 'guitar' :)

this is ver 1….more to come.

Save in : C:\Program Files\SCAR 2.03\Scripts

and 'extract here'

– OR –

just set 'RootFolder' to the folder path that contains 'MusicalSCAR.scar'[ATTACH]2507[/ATTACH]

SKy Scripter

2007-03-19 16:40:02

Hey… This Looks Really Fun :)

Ruroken

2007-03-19 16:43:56

:) more updates to come

Ron

2007-03-19 18:00:48

Great script!

There are quite a few ways to make this better and easier for the scripter and user.

If you don't extract the files in the folder you specified, then it gets all messed up. Instead of using that const "RootFolder". You can use ScriptPath instead. Which will get the path of the script. That way the user can put the script anywhere.

Also, sometimes the sound isn't played all the way because of the loop. So before you exit the if statement, it should wait until the user isn't holding that button anymore. Example:

procedure PlayMySound(Note, Cha : string);
var
Ch : char;
begin
Ch := Cha[1];
if(IsKeyDown(Ch))then
begin
PlaySound(Note);
while IsKeyDown(Ch) do
Wait(20);
end;
end;

procedure Play;
var
i : integer;
begin
for i := 0 to 5 do
PlayMySound(ScriptPath + Note[i], IntToStr(i + 1));
end;
Note: In the above example, I put ScriptPath right before the Note because in the procedure SetNotes, I disposed of the const (RootFolder) before all the '\1st.wave'.

Also that repeat/until loop at the bottom should have a wait. A wait of at least… 30 or 40. Otherwise it takes up 99% of CPU Usage and slows down everything.

Hope that helps! :)

~Ron

Ruroken

2007-03-19 20:32:14

Ehhhh….i'll fix it soon.

Im running on five hrs of sleep…. Ron's explanation made little to no sense..

Oh, and could i have your MSN Ron?

bullzeye95

2007-03-19 21:50:26

[email]RonTheConMSN@hotmail.com[/email] (or maybe it's @msn.com?)

Ron

2007-03-19 22:49:12

lol well we can always discuss it on MSN if you like. :)

Yeah that's the correct MSN email (hotmail), thank you Bullzeye.

Ruroken

2007-03-20 14:46:54

ok, thanks

Piano version soon? Or more notes to the guitar one.

YoHoJo

2007-03-25 16:35:30

Didnt keane make one of these…
Except it was a harmonica?
Never mind.. this is different :P

legendaryhero90

2007-03-25 23:28:51

i'll try it thanks!

Lalaji

2007-05-05 13:34:31

laggs too much for me.

Gwallunit

2007-05-05 15:07:11

Lol this is actually Really cool :)

Tim0suprem0

2007-06-30 14:30:35

haha this rocks!

Ruroken

2007-06-30 15:10:22

:) glad everyone likes it

m4g3owns

2007-07-09 06:17:58

doesnt wana work for me >.<

the flea

2007-07-09 16:24:12

haha nice idea :) you could record statements like "found a fight" and put them in srl and then if they have the option checked it will play that sound if the random find a fight to alert you if your nearby :)

Ruroken

2007-07-09 16:37:59

;)

i had that idea a while ago….put it in a few private scripts.

mooman001

2007-07-15 23:33:57

WARNING: do not run on vista ROFL

n3ss3s

2007-07-19 15:07:36

WARNING: do not run on vista ROFL

Haha, I wonder what happened :D

Ruroken

2007-10-09 16:10:05

>.>

Vista prob yelled at him for trying to play shounds and shut him down :p