Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Gavvin
Newbie


Joined: 25 Dec 2006
Posts: 6
Location: DFW, TX

PostPosted: Mon Dec 25, 2006 6:18 pm   

Need help with automated singing
 
I have a character who is a bard and in order to give him more depth, he sings songs in taverns and such. Normally I accomplish this by simply cutting and pasting lines from a text file into the command line. I would like to automate this process a bit and need some help.

I have experimented with an alias that sends pmotes with the appropriate lines and has a timer to keep the spam down, but that's not really doing it for me. I have to have one or more aliases to do each song.

Here is a sample of lines from onr alias:

pmote sings in a clear tenor {BShips may come and ships may go, as long as the sea does roll{x
pmote sings in a clear tenor {BEach sailor lad just like his dad, he loves the flowing bowl.{x
pmote sings in a clear tenor {BA trip on shore he does adore with a girl that's nice and round.{x
pmote sings in a clear tenor {BWhen the money's all gone it's the same old song,{x
pmote sings in a clear tenor {B"Get up Jack! John, sit down!"{x

Is there a better way to accomplish this?

Is there perhaps a script that can call the lyrics from a text file, add pmotes and color the lyrics?

The MUD is a heavily modified Diku code.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Mon Dec 25, 2006 6:38 pm   
 
what i would to is make an array for each song you want

#VAR boatsong {Ships may come and ships may go, as long as the sea does roll|Each sailor lad just like his dad, he loves the flowing bowl.|A trip on shore he does adore with a girl that's nice and round.||When the money's all gone it's the same old song,|"Get up Jack! John, sit down!"}

then an alias to do your song

#ALIAS singsong {thissong=%1;#FORALL thissong {pmote sings in a clear tenor ~{B%i~{x}}

that will crush it together though for a quick song though
_________________
Discord: Shalimarwildcat
Reply with quote
Gavvin
Newbie


Joined: 25 Dec 2006
Posts: 6
Location: DFW, TX

PostPosted: Mon Dec 25, 2006 7:11 pm   
 
Quote:

that will crush it together though for a quick song though


That is one thing I am trying to avoid. With the delay, it seems more natural and people listening can pmote during the song. Is there a way to add a delay between lines?

I am also unsure how to activate the alias you wrote. would it be "singsong boatsong" in this case?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Mon Dec 25, 2006 7:23 pm   
 
'singsong @boatsong' is the method i believe... to make it a delay try something like...

#LOOP %numitems(@thissong) {#ALARM +%eval(%i*10) {pmote sings in a clear tenor ~{B%pop(thissong)~{x}}
_________________
Discord: Shalimarwildcat
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue Dec 26, 2006 7:45 pm   
 
...although it's the Devil's Command, #WAIT would be much easier to use in this case, and since it's not in a trigger it won't be too naughty.

#VAR boatsong {Ships may come and ships may go, as long as the sea does roll|Each sailor lad just like his dad, he loves the flowing bowl.|A trip on shore he does adore with a girl that's nice and round.||When the money's all gone it's the same old song,|"Get up Jack! John, sit down!"}

#alias singsong {ThisSong=%1;#forall @ThisSong {pmote sings in a clear tenor ~{B%i~{x};#wait 1000}

One question - does @{complicated name} not work in zMUD? It'd be much easier to use @{%1} than this ThisSong= part.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Tue Dec 26, 2006 9:54 pm   
 
I prefer to use a token holder for the current song, just copy the song you want into it, all the scripts only need to worry about the token as well, this also allows you to %pop() away the token without losing the original song, Maybe?:

#WHILE @thissong {pmote sings in a clear tenor ~{B%pop(thissong)~{x};#wait 1000}
_________________
Discord: Shalimarwildcat

Last edited by shalimar on Tue Dec 26, 2006 10:48 pm; edited 1 time in total
Reply with quote
Gavvin
Newbie


Joined: 25 Dec 2006
Posts: 6
Location: DFW, TX

PostPosted: Tue Dec 26, 2006 10:07 pm   
 
I am more confused than when I first asked the question..... Shocked

I do not understand the previous 3 posts. I need to learn more scripting. Until then...... can someone break this down for me so I can understand how to implement it or simply give me something I can plug in?

I am sorry to be such a noob.
Reply with quote
Gavvin
Newbie


Joined: 25 Dec 2006
Posts: 6
Location: DFW, TX

PostPosted: Tue Dec 26, 2006 10:23 pm   
 
OK, so I have been experimenting......

Shalimar: Your original Alias does not seem to work. I have no idea how to implement the Loop or the While statement

Fang Xianfu: Your alias works with the exception of the wait. It shoots out 1 line right after the other. I have tried adjusting the WAIT # and got all the way to 100000 without seeing any change.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Tue Dec 26, 2006 10:51 pm   
 
#ALIAS singsong {
thissong=@%1
#LOOP %numitems(@thissong) {#ALARM +%eval(%i*10) {pmote sings in a clear tenor ~{B%pop(thissong)~{x}}
}

then just use 'singsong boatsong'
_________________
Discord: Shalimarwildcat
Reply with quote
Gavvin
Newbie


Joined: 25 Dec 2006
Posts: 6
Location: DFW, TX

PostPosted: Wed Dec 27, 2006 4:25 pm   
 
Thank you. I will give it a shot when I have a chance, probably on Friday (this week is so busy).

On another note..... Does anyone have a good resource that I can get to learn more about how to do all this on my own?

ZMUD scripting for Dummies perhaps?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Wed Dec 27, 2006 7:58 pm   
 
Try reading the help files the come with, or failing that, there is a copy of the helpfiles on the site as well, it gives an example of how to use ever %function and #command.

If you know which you want to open you can go directly to that page of the helpfiles from the command line.

For #commands, drop the # off the beginning:

#HELP loop

For %functions leave the % on:

#HELP %pop

But don't discount the value of having questions that may arise answered by asking them on these forums.
_________________
Discord: Shalimarwildcat
Reply with quote
Gavvin
Newbie


Joined: 25 Dec 2006
Posts: 6
Location: DFW, TX

PostPosted: Wed Dec 27, 2006 11:16 pm   
 
Help files are good. I like help files. What I am really looking for though is something that puts things in context. Starts with some small, simple scripts and breaks them apart to explain how they work and then builds on those to form more complex scripts. I guess my real problem is that I am a network guy and have really distanced myself from programming in the last........ 18 yrs or so (how time flies!) since I got out of high school.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Wed Dec 27, 2006 11:31 pm   
 
Your best bet for good context examples is to pay attention to the forums and follow the logic in the scripts other people put up and need help on. I have learned all of what i know from these forums and the help files.
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net