Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-18-2002, 06:08 AM
reeset1 reeset1 is offline
Registered User
Join Date: Jan 2002
Posts: 112
reeset1 is on a distinguished road
Send a message via AIM to reeset1 Send a message via Yahoo to reeset1
Talking 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]
__________________
---
Reese is no longer the (Events Admin)
Reply With Quote
  #2  
Old 03-18-2002, 07:18 AM
reeset1 reeset1 is offline
Registered User
Join Date: Jan 2002
Posts: 112
reeset1 is on a distinguished road
Send a message via AIM to reeset1 Send a message via Yahoo to reeset1
ruigsjdhgsiurhgajkferuifhspdfjakfjehasdfasdfjawepo garegnarfpqa

SOMEONE REPLY!!!!
__________________
---
Reese is no longer the (Events Admin)
Reply With Quote
  #3  
Old 03-18-2002, 07:20 AM
BARGAD BARGAD is offline
Registered User
Join Date: Aug 2001
Location: Sweden
Posts: 345
BARGAD will become famous soon enough
looks nice

-Didnt look through all that messy code-

/CaRnIe
__________________
Gori

Born To Kill
Death Silent Killers

Two little newbies, out in the sun.
Then came Gori and there was only one.

Reply With Quote
  #4  
Old 03-18-2002, 03:24 PM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
too long can be done shorter...
__________________
No Webhost at the moment
Reply With Quote
  #5  
Old 03-18-2002, 03:43 PM
neomaximus2k neomaximus2k is offline
Registered User
Join Date: Feb 2002
Location: UK
Posts: 324
neomaximus2k is on a distinguished road
Send a message via ICQ to neomaximus2k
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
__________________
Beware of thy Inner self
NPC Code:

_.,.__
((o\\o\))
.-. ` \\``
__( )___.o"".,___
=== ~~~~~~~~
==
= Neo

Reply With Quote
  #6  
Old 03-19-2002, 03:01 AM
Kadar Kadar is offline
Registered User
Join Date: Jan 2002
Posts: 636
Kadar is on a distinguished road
[Kadar]
u dont need to keep typing
changeimgvis bleh,4;
changeimgzoom bleh,0.8;

You can use the for command..
[/Kadar]
__________________
Reply With Quote
  #7  
Old 03-19-2002, 07:26 AM
Kadar Kadar is offline
Registered User
Join Date: Jan 2002
Posts: 636
Kadar is on a distinguished road
Quote:
Originally posted by Kaimetsu


Not... a... command...!
[Kadar]
ohwhell close enough
[/Kadar]
__________________
Reply With Quote
  #8  
Old 03-19-2002, 08:29 AM
reeset1 reeset1 is offline
Registered User
Join Date: Jan 2002
Posts: 112
reeset1 is on a distinguished road
Send a message via AIM to reeset1 Send a message via Yahoo to reeset1
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
__________________
---
Reese is no longer the (Events Admin)
Reply With Quote
  #9  
Old 03-19-2002, 09:10 AM
funnylinkwantsbomys funnylinkwantsbomys is offline
Omi New
funnylinkwantsbomys's Avatar
Join Date: Mar 2001
Location: ohio
Posts: 2,116
funnylinkwantsbomys is on a distinguished road
Send a message via AIM to funnylinkwantsbomys
.txt plz....when i copy and paste into graal its all 1 line
__________________

"Microwave a piece of cheese for 40secs and eat it. Yum." -Funnylink
Reply With Quote
  #10  
Old 03-19-2002, 12:25 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
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...
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #11  
Old 03-19-2002, 03:44 PM
neomaximus2k neomaximus2k is offline
Registered User
Join Date: Feb 2002
Location: UK
Posts: 324
neomaximus2k is on a distinguished road
Send a message via ICQ to neomaximus2k
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!
__________________
Beware of thy Inner self
NPC Code:

_.,.__
((o\\o\))
.-. ` \\``
__( )___.o"".,___
=== ~~~~~~~~
==
= Neo

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:37 AM.


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