Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   On-screen Jukebox (https://forums.graalonline.com/forums/showthread.php?t=25856)

reeset1 03-18-2002 06:08 AM

On-screen Jukebox
 
NPC Code:

//superkewl musix k?
//Made by Reese
//Steal it and die
//Use it on your server and die
//Offline only K?
//Currently Holds 20 songs! OMI
if(playerenters){
toweapons On-screen Jukebox;
}
if(playerchats&&startswith(add song,#c)){
tokenize #c;
setstring songtitle,#t(3);
setstring songfile,#t(4);
setstring songtype#t(2),#t(5);
setstring songfile#t(2),#s(songfile);
setstring songtitle#t(2),#s(songtitle)(#s(songfile#t(2))).#s (songtype#t(2));
setstring songfile,;
setstring songtitle,;
}


if(weaponfired){
showstats 1024;
this.on=1;
this.on2=1;
this.move=0;
disabledefmovement;
setminimap ,,,;
timeout=0.05;
}
if(timeout){
if(this.on=1){
//Song Column
showimg 400,@Songs(Filename.Type),35,80;
changeimgvis 400,4;
changeimgzoom 400,0.8;

showimg 403,@1.#s(songtitle1),35,110;
changeimgvis 403,4;
changeimgzoom 403,0.8;

showimg 404,@2.#s(songtitle2),35,125;
changeimgvis 404,4;
changeimgzoom 404,0.8;

showimg 405,@3.#s(songtitle3),35,140;
changeimgvis 405,4;
changeimgzoom 405,0.8;

showimg 406,@4.#s(songtitle4),35,155;
changeimgvis 406,4;
changeimgzoom 406,0.8;

showimg 407,@5.#s(songtitle5),35,170;
changeimgvis 407,4;
changeimgzoom 407,0.8;

showimg 408,@6.#s(songtitle6),35,185;
changeimgvis 408,4;
changeimgzoom 408,0.8;

showimg 409,@7.#s(songtitle7),35,200;
changeimgvis 409,4;
changeimgzoom 409,0.8;

showimg 410,@8.#s(songtitle8),35,215;
changeimgvis 410,4;
changeimgzoom 410,0.8;

showimg 411,@9.#s(songtitle9),35,230;
changeimgvis 411,4;
changeimgzoom 405,0.8;

showimg 412,@10.#s(songtitle10),35,245;
changeimgvis 412,4;
changeimgzoom 412,0.8;

showimg 413,@11.#s(songtitle11),35,260;
changeimgvis 413,4;
changeimgzoom 413,0.8;

showimg 414,@12.#s(songtitle12),35,275;
changeimgvis 414,4;
changeimgzoom 414,0.8;

showimg 415,@13.#s(songtitle13),35,290;
changeimgvis 415,4;
changeimgzoom 415,0.8;

showimg 416,@14.#s(songtitle14),35,305;
changeimgvis 416,4;
changeimgzoom 416,0.8;

showimg 417,@15.#s(songtitle15),35,320;
changeimgvis 417,4;
changeimgzoom 417,0.8;

showimg 418,@16.#s(songtitle16),35,335;
changeimgvis 418,4;
changeimgzoom 418,0.8;

showimg 419,@17.#s(songtitle17),35,350;
changeimgvis 419,4;
changeimgzoom 419,0.8;

showimg 420,@18.#s(songtitle18),35,365;
changeimgvis 420,4;
changeimgzoom 420,0.8;

showimg 421,@19.#s(songtitle19),35,380;
changeimgvis 421,4;
changeimgzoom 421,0.8;

showimg 422,@20.#s(songtitle20),35,395;
changeimgvis 422,4;
changeimgzoom 422,0.8;

showimg 423,@Stop,35,410;
changeimgvis 423,4;
changeimgzoom 423,0.8;

showimg 424,@Help:Say "help" to learn how operate this.,300,85;
changeimgvis 424,4;
changeimgzoom 424,0.8;
}
//Movement
if (keydown(0) || keydown(2)) {
if (this.down==0) {
if (keydown(0)) {this.move-=1;}
if (keydown(2)) {this.move+=1;}
this.down = 1;
}
} else {
this.down = 0;
}
if (this.move<0) {this.move = 0;}
if (this.move>20) {this.move = 20;}
showimg 401,@->,25,110+(this.move*15);
changeimgvis 401,4;
changeimgzoom 401,0.8;
timeout=0.05;

}
if(keydown(5)&&!this.move=20){
setstring currentlyplaying,#s(songfile#v(this.move+1)).#s(so ngtype#v(this.move+1));
play #s(songfile#v(this.move+1)).#s(songtype#v(this.mov e+1));
}
else
stopsound #s(currentlyplaying);

//Help
if(playerchats&&strequals(#c,help)){
say2 This will explain how to use#b
the On-Screen Jukebox. To add#b
a new song, simply say:#b
add song "s" "n" "f" "t".#b
Now to explain what those mean.#b
"s" is the slot number that#b
the song will be stored to.#b
"n" is the title you give to#b
the song you are adding. If#b
you use spaces, use quotations ""#b
around it the whole name.#b
"f" is the actual filename of#b
the song. It must be located#b
in a folder in the main Graal#b
folder. DO NOT ADD THE EXTENSION.#b
"t" is the file type/extension.#b
If the file was a midi, it would#b
be like this: "mid".
Example:#b
add song "1" "Cool" "coolsong" mid#b
This would ad the song called Cool#b
to slot 1. I hope this explains#b
everything.;
}



There are a few bugs, and I have not fixed the stop command and making it so you can exit it but you can still see how purdy it looks =)
[edit] I do realize how much I could shorten this up but I was in a hurry[/edit]

reeset1 03-18-2002 07:18 AM

ruigsjdhgsiurhgajkferuifhspdfjakfjehasdfasdfjawepo garegnarfpqa

SOMEONE REPLY!!!!

BARGAD 03-18-2002 07:20 AM

looks nice

-Didnt look through all that messy code-

/CaRnIe

TDO2000 03-18-2002 03:24 PM

too long can be done shorter...

neomaximus2k 03-18-2002 03:43 PM

Quote:

Originally posted by TDO2000
too long can be done shorter...
I agree, best send the images, and levels ina ZIP and let people cut it down a bit

Kadar 03-19-2002 03:01 AM

[Kadar]
u dont need to keep typing
changeimgvis bleh,4;
changeimgzoom bleh,0.8;

You can use the for command..
[/Kadar]

Kadar 03-19-2002 07:26 AM

Quote:

Originally posted by Kaimetsu


Not... a... command...!

[Kadar]
ohwhell close enough ;)
[/Kadar]

reeset1 03-19-2002 08:29 AM

Im not an extremely good scripter, and this script includes no images. I did it soley for my own purpose and just posted it here for others to see

funnylinkwantsbomys 03-19-2002 09:10 AM

.txt plz....when i copy and paste into graal its all 1 line

Saga2001 03-19-2002 12:25 PM

Quote:

crazy kadar d00d posted:
[Kadar]
u dont need to keep typing
changeimgvis bleh,4;
changeimgzoom bleh,0.8;

You can use the for command..
[/Kadar]
for loop....say it with me, loop, thanks kai...

neomaximus2k 03-19-2002 03:44 PM

Quote:

Originally posted by Saga2001

for loop....say it with me, loop, thanks kai...

LMAO
*starts saying loop repeteadly*
the mighty LOOP will rule the world.

and yeah it is a good script i guess, but again needs trimming a lot!


All times are GMT +2. The time now is 07:59 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.