|
Dan_Bradley Beginner
Joined: 11 Oct 2002 Posts: 21
|
Posted: Sat Jun 21, 2003 11:44 am
Emote cycling script |
Ok heres my boggle, im not so good at zmud coding so please help me out with this one.
What I want:
@@@@@@@@@@@@
To have something like alias1|alias2|alias3|alias4|alias5|alias6|alias7... going on to maybe 30
Each Alias will contain an emote, e.g Alias1 = emote smiles slightly as he looks at you.
So for the bit above i would like an Alias lets call it "Ranemote" for example, when i use Ranmote it will do the first alias on the list, then next time i use it , it will do the second alias, BUT heres thet ricky bit, the aliaseses it has used goes to the end of the Variable? (can that be done?)
So it will eventually cycle through 30 different aliases on the long run.
As far as usage goes, im basically going to use it to acompany a tell.
e.g
Special Tell
@@@@@@@@@@@@@
stell why, you look most baeutiful today!
so stell woudl call the random alias emote thing, then send a tell.. (btw the person its sending tells to will never change, so lets call him Bob for now).
I hope i have elaborated enough to show someone exactly what i would like to be able to do?
Thankyou for your time, anyone who reads and helps me out with this one. |
|
|
|
Dan_Bradley Beginner
Joined: 11 Oct 2002 Posts: 21
|
Posted: Sat Jun 21, 2003 2:17 pm |
ok i have had a go at doing it myself, but i still don't know how to get it to cycle and re add aliases to the variable. Hell i might not of even figured out the best way to achieve the way to do this script..
#class {hemotes}
#var hemotes {hemote1|hemote2|hemote3|hemote4|hemote5|hemote6|hemote7|hemote8|hemote9|hemote10}
#alias {hcycle} {current={%item( @hemotes, 1)}
#alias {hem} {hcycle;tell bob --Emoted-- %-1}
#alias {hemote 1} {emote licks his lips and smiles.}
#alias {hemote 2} {emote grins evilly and scratches his head.}
#alias {hemote 3} {emote sighs loudly.}
#alias {hemote 4} {emote stifles a yawn.}
#alias {hemote 5} {emote shuffles restlessly.}
#alias {hemote 6} {emote looks at his feet.}
#alias {hemote 7} {emote fiddles with his dagger hilt.}
#alias {hemote 8} {emote gazes off into oblivion.}
#alias {hemote 9} {emote idly pats you on the arm.}
#alias {hemote 10} {emote kicks dust around.}
#class 0 |
|
|
|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Sat Jun 21, 2003 5:28 pm |
We start with one huge string list containing all emote messages. A list can be manipulated like a queue with zmud command #additem and function %pop.
{code}
#var emotes {licks his lips and smiles.|grins evilly and scratches his head.|sighs loudly.|stifles a yawn.|shuffles restlessly.|looks at his feet.|fiddles with his dagger hilt.|gazes off into oblivion.|idly pats you on the arm.|kicks dust around.}
#alias hem {
#var em %pop(emotes)
emote @em
#additem emotes @em
}
{/code}
This will work as long as you don't have duplicates of the same emote in the list. This takes care of the cycling emotes. %pop removes the front one, and #additem inserts it at the end. The tells and such you can put into the "hem" alias or wherever suits you (i didn't quite get the whole purpose of them). if at any time you wanted to pick a random emote, that is possible too:
emote %item(@emotes, %random(1, %numitems(@emotes)))
--------
salford.cslab.uky.edu:4000 |
|
|
|
Dan_Bradley Beginner
Joined: 11 Oct 2002 Posts: 21
|
Posted: Sat Jun 21, 2003 7:53 pm |
thankyou, just what i was after :)
|
|
|
|
Dan_Bradley Beginner
Joined: 11 Oct 2002 Posts: 21
|
Posted: Sun Jun 22, 2003 2:43 am |
figured it out..
|
|
|
|
Dan_Bradley Beginner
Joined: 11 Oct 2002 Posts: 21
|
Posted: Sun Jun 22, 2003 2:49 am |
bah annoying problem.
Ok iv edited the names and deleted some of the emotes to make the post shorter
#class {handtalk}
#var emotes {Bleh while clentching her jaw.|makes a hidden signal to Bob indicating her feelings.}
#alias ht {tell bob HandTalk: %-1;#var em %pop(emotes);#send emote @em;#show Liz @em;#additem emotes @em}
#TRIGGER {Owen tells you 'HandTalk: (*)'} {#sub {Liz HandTalks: '%1'};#var em %pop(emotes);#send emote @em;#show Liz @em;#additem emotes @em}
#TRIGGER {tell bob HandTalk: (*)} {#sub {You HandTalk: '%1'}}
#TRIGGER {you tell bob 'HandTalk: (*)'} {#sub ""}
#class 0
my question is this, why exactly does this work fine on my zmud but not on hers? She gets the error:
ht test
You HandTalk: 'test'
Liz %pop(emotes)
Any help would be appreciated, we are really frustrated :( She's using 6.16 and im using 6.40 thats the only diference i can think of. |
|
|
|
Dan_Bradley Beginner
Joined: 11 Oct 2002 Posts: 21
|
Posted: Sun Jun 22, 2003 3:06 am |
oooh %pop wasnt available in older versions? thats makes sense.. any alternatives?
|
|
|
|
Dan_Bradley Beginner
Joined: 11 Oct 2002 Posts: 21
|
Posted: Mon Jun 23, 2003 12:16 pm |
Im still getting problems with the above script.. it doesn't seem to be sending the Emotes to the mud when it uses the #send command, any ideas ??
|
|
|
|
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Mon Jun 23, 2003 5:55 pm |
How about (should work with 6.16 and above):
#CLASS HandTalk
#VAR HandTalkers {Joe|Bill|Bob}
#VAR Emotes {emote1|emote2|emote3|example of emote with *t as a target}
#VAR EmoteIndex 1
#ALIAS doemote {#EXEC {emote %replace(%item(@Emotes,@EmoteIndex), "*t", %-1)};#ADD EmoteIndex 1;#IF (@EmoteIndex > %numitems(@Emotes)) {#VAR EmoteIndex 1}}
#ALIAS ht {tell %1 HandTalk: %-2;doemote %proper(%1)}
#TRIGGER {^({@HandTalkers}) tells you 'HandTalk: (*)'$} {#SUB {%1 HandTalks: '%2'};doemote %1}
#TRIGGER {^You tell (%w) 'HandTalk: (*)'} {#SUB {You HandTalk to %1: '%2'}}
#CLASS 0
I made it so that you can easily set it up with multiple partners by adding them to the HandTalkers stringlist. Heck, you can send handtalks to anyone... the list really only controls whether a tell from someone can be parsed and acknowledged as a handtalk.
The *t you see in the emote list gives you support for targets in your emotes. The name will be substituted into this place whenever the emote is fired. This is part of what enables multiple partners (which, although you may not want them now, may be desirable as you interact with more Aiel on WoTMUD). |
|
|
|
Dan_Bradley Beginner
Joined: 11 Oct 2002 Posts: 21
|
Posted: Mon Jun 23, 2003 11:24 pm |
ahh, the god is at it again :) Good work charbal.. spot on coding. Thanks :)
Dan |
|
|
|
|
|