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
talonfreak2003
Beginner


Joined: 02 Dec 2004
Posts: 27
Location: Kansas... whippie!

PostPosted: Sat Oct 20, 2007 6:10 pm   

Script help?
 
Alright, I'm not exactly great with scripts, so I figured I'd come here to ask for abit of advice/help.

What I'm looking for is either help making the script or help on understanding how to make the script.

Whenever someone goes to quest, they get this multiple line feed:
Quote:

Someone asks The High Priest of Arkane for a quest.
The High Priest of Arkane says 'Thank you, brave Someone!'
The High Priest of Arkane says 'Vile pilferers have stolen the King's sceptre from the royal treasury!'
The High Priest of Arkane says 'My court wizardess, with her magic mirror, has pinpointed its location.'
The High Priest of Arkane says 'Look in the general area of <area>l for <room>!'
The High Priest of Arkane says 'You have 52 1/2 hours to complete this quest.'
The High Priest of Arkane says 'May the gods go with you!'


Now, I already have, for the most part, the entire script worked out, to fire off of "Look in the general are of". The problem I run into is there's usually 5-15 people in the same room as me questing, so my script also fires off of theirs. What would be the easiest way to have it only fire off on my quests? I would post my questing script but it's rather long (70kb worth of quests)[/quote]
_________________
Yes, I'm a programing newb, but I can fix a car faster than you can spin your head.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Oct 20, 2007 8:34 pm   
 
Put the trigger(s) in a class and disable it. Create an alias and use #t+ to enable in when you ask for a quest (create an alias to do both). Have the trigger for the last line use #t- do disable the class again.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Oct 20, 2007 10:37 pm   
 
You could also check for the name. For instance, change the first line to read:
Code:
#trigger {@myname asks the priest of High Arkane for a quest.} {#t  questscript}

Just put the script, minus the above trigger, into a folder called questscript. Also, make a variable myname with your name in it. You'll want to make a trigger to turn off the script, too. Probably want the last line to turn it off.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Oct 20, 2007 10:39 pm   
 
Stupid cell limits. I was going to add that you would need to disable the folder when you first make it. And the trigger I made is if your script starts off you asking the high priest. Change it as you see fit. :-)
Reply with quote
talonfreak2003
Beginner


Joined: 02 Dec 2004
Posts: 27
Location: Kansas... whippie!

PostPosted: Mon Oct 22, 2007 4:50 am   
 
I got it to work. Everything is divided into folders
Inside the Script_Triggers folder is the one to disable it after it's been selected using
Code:
#TRIGGER {$The High Priest of Arkane says 'May the gods go with you!'$} {#T- Script_Triggers}


The one that permanently runs is
Code:
 #TRIGGER {^* asks The High Priest of Arkane for a quest.$} {#IF ("%1"="Aritan") {#T+ Script_Triggers} {#SHOW @questgauge}
_________________
Yes, I'm a programing newb, but I can fix a car faster than you can spin your head.
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Mon Oct 22, 2007 7:43 am   
 
If you have Relogin set up on your ZMud session, you can alternatively also use %char instead of writting your name out.

So the part with #if ("%1"="Aritian") would be #if ("%1"=%char)

Just a thought.


Prog
Reply with quote
talonfreak2003
Beginner


Joined: 02 Dec 2004
Posts: 27
Location: Kansas... whippie!

PostPosted: Fri Oct 26, 2007 3:24 am   
 
Ok, next question... how do I make it gag all the lines going in.

Code:
s;s;c fly;c pass;w;s;w;w;w;w;w;w;w;w;w;w;w;s;s;s;e;s;s;w;w;se;s;se;e;n;n;e;e;s;se;e;se;se;n;ne;nw;sw;s;e;n;n;n;n;n;n


How do I make it gag all that when it's imputed. I put #GAG infront of it, but it doesn't gag it :)
_________________
Yes, I'm a programing newb, but I can fix a car faster than you can spin your head.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Fri Oct 26, 2007 3:41 am   
 
#forall "s|s|c fly|c pass|w|s|w|w|w|w|w|w|w|w|w|w|w|s|s|s|e|s|s|w|w|se|s|se|e|n|n|e|e|s|se|e|se|se|n|ne|nw|sw|s|e|n|n|n|n|n|n" {#send %i}

Alternatively, you could create a trigger:

#oninput "GagInput" {*} {#gag}

And keep it disabled. Before you send a big load of commands, use #t+ to enable it, and then once they've been sent, use #t- to disable it.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Oct 26, 2007 5:08 am   
 
If you set it up as a path then you can also use this alias
#ALIAS QuietPath {#SEND {%replace(%pathexand(%alias(%1)),"|",%cr)}
alternately if you use some moce compex commands in the paths like your example shows
#ALIAS QuietPath {#SEND {%replace(%exec(.%1),"|",%cr)}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
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