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


Joined: 29 Jan 2008
Posts: 17

PostPosted: Fri Feb 08, 2008 5:32 pm   

how do I get %something
 
(%w) gives you something

how do I get a %something for the something ?
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Fri Feb 08, 2008 5:44 pm   
 
do you mean automatically respond to the line: (%w) gives you %w?

and that often looks like

(%w) gives you %d %w

(%w) gives you {a|an} %w or (%w) gives you {a|an|the|some} *

or is %something actual text, I thought not though

if you mean get a "specific thing" for another "specific thing" I would use a database function to get the name of the appropriate "specific thing" - perhaps %iskey(@allsomethings,@something)


Last edited by Leitia on Fri Feb 08, 2008 5:56 pm; edited 1 time in total
Reply with quote
Darklord
Beginner


Joined: 29 Jan 2008
Posts: 17

PostPosted: Fri Feb 08, 2008 5:52 pm   
 
This is what Im building,
Someone give me a weapon
ie
Ssuya gives you Steel Dagger

Trigger sees 'give you' with (%w) gives you

I need a %something for the weapon

then I will

#IF (%ismember( %something, @weaponlist)) {cast vice %something} {say blah blah blah}
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Fri Feb 08, 2008 6:00 pm   
 
I am confused by that make-believe function

you are not capturing anything there but the person, so how is this %something at all relevant?
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Fri Feb 08, 2008 6:03 pm   
 
Is that the question? you must also capture (%w) for the something, but you will need to make a database of somethings by the way they look in triggers
Reply with quote
Darklord
Beginner


Joined: 29 Jan 2008
Posts: 17

PostPosted: Fri Feb 08, 2008 6:07 pm   
 
with your 1st reply, I think I see my error, just need to use gives you (%w) vs (%w) gives you, or use (w%) gives you (w%)

using %w for what ever I need and place it where its needed.
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Fri Feb 08, 2008 6:08 pm   
 
This person will only give one specific something, but there are many such people?
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Fri Feb 08, 2008 6:14 pm   
 
yes, every time you add (%w) it references a new %1 variable

%w gives you (%w) is one variable called %1
(%w) gives you %w is also one variable called %1
(%w) gives you (%w) is two variables called %1 and %2

you need to save those with #var or #addkey or use them right away

%w matches only 'dagger' but would match the 'a' if it were 'a dagger' in a line
Reply with quote
Darklord
Beginner


Joined: 29 Jan 2008
Posts: 17

PostPosted: Fri Feb 08, 2008 6:58 pm   
 
(%w) gives you (%w)
#IF (%ismember( %2, @weaponlist)) {cast vice %2} {say Sorry %1 %2 doesnt appear in my weapon list}

Stuipd me thought the (%w) had to be at the begining, learn something every day

Thanks for you help and time
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Fri Feb 08, 2008 7:02 pm   
 
using a comma with a tag phrase is easier to read.

say Sorry %1~, %2 doesnt appear in my weapon list

I do think you need a tilde though

(I was not trying to correct grammar, just I would not think twice over the comma, but I seem caught in the throws of propriety and need to point out you have not punctuated your contraction)
Reply with quote
Darklord
Beginner


Joined: 29 Jan 2008
Posts: 17

PostPosted: Fri Feb 08, 2008 7:27 pm   
 
One more thing, and I will correct that

#IF (%ismember( %2, @weaponlist)) {cast vice %2 | give %2 %1} {say Sorry %1~, %2 doesnt appear in my weapon list )

how do we do two action if true?
1 cast vice %2 cast vice on the weapon
2 give %2 %1 give the weapon back

What tired doesnt work well, well not at all
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Fri Feb 08, 2008 7:33 pm   
 
{cast vice %2;give %2 %1}
Reply with quote
Darklord
Beginner


Joined: 29 Jan 2008
Posts: 17

PostPosted: Fri Feb 08, 2008 7:33 pm   
 
never mind, figgered it out, press enter
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Fri Feb 08, 2008 7:37 pm   
 
that was unexpected, I have no idea why that worked, you made an execution stack? cool, that is like using #input to send the give sword thing to the command buffer. Your way seems not so robotic then using the command separator semicolon.
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Fri Feb 08, 2008 7:41 pm   
 
and speaking of awkward english I am full of it, I should have said Your way seems not as robotic as
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Fri Feb 08, 2008 7:54 pm   
 
I don't get a stack

if the spell gets interrupted by the give command or gives the sword back unchanged you may need #input or an alarm trigger or another trigger to give the weapon back, I would not use the | unless you can find documentation
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Fri Feb 08, 2008 8:01 pm   
 
huh, is this an alias or or a trigger?

you really don't want people forcing you to cast for them, but I will mind my own business now

(hehe I can push up my rating by not editing, actually that was unintended, this board was almost real time and I worried because I got an update after editing my first reply. I will be more considerate.)
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