 |
inimical Beginner
Joined: 12 Aug 2003 Posts: 14
|
Posted: Thu Aug 05, 2004 1:29 am
Using MXP with #SUBSTITUTE to add images |
The mud I play has several poker halls, where players can get together and play 5 card draw. What I'm trying to do is replace the text format of the cards:
[ Four of Clubs ] [ Seven of Spades ] [ Jack of Diamonds ] [ Queen of Clubs ] [ Ace of Clubs ]
with .gif's of each card. So far, no luck. I've been trying to use something like:
Code: |
#TRIG {~[ (*) ~]} {#IF (%1=="Four of Clubs") {#SUB {~<image cards/4h.gif>}}
|
or
Code: |
#TRIG {~[ (*) ~] ~[ (*) ~] ~[ (*) ~] ~[ (*) ~] ~[ (*) ~]}
|
with the same basic concept. In all instances, the images will either all be substituted directly on top of each other or only the last card in the hand will match. Does anyone have experience using mxp and <image>? I toyed around with using #MXP instead of #SUB, but that hasn't done me any good either. |
|
_________________ |
|
|
 |
inimical Beginner
Joined: 12 Aug 2003 Posts: 14
|
Posted: Thu Aug 05, 2004 6:58 am |
Is it possible to use variables within mxp? If I set it up using something like
Code: |
#TRIG {~[ &FirstRank of &FirstSuit ~] ~[ &SecondRank of &SecondSuit ~] ~[ &ThirdRank of &ThirdSuit ~] ~[ &FourthRank of &FourthSuit ~] ~[ &FifthRank of &FifthSuit ~]} {#mxp {<image cards/@FirstRank@FirstSuit.gif> <image cards/@SecondRank@SecondSuit.gif> <image cards/@ThirdRank@ThirdSuit.gif> <image cards/@FourthRank@FourthSuit.gif> <image cards/@FifthRank@FifthSuit.gif>} |
it would work. However, zmud variables aren't expanded within mxp commands, so in reality it doesn't do jack If there is a way to set mxp variables that I could use in this way, I'd love some suggestions on how to do it. |
|
_________________ |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Aug 05, 2004 3:45 pm |
zMUD variables are expanded using either #MXP or #SUB. However, @Firstsuit.gif is recognized as a variable name, so you'd need to use @FirstRank@{FirstSuit}.gif.
The numbered parameters might be simpler.
#TR {~[ (%w) of (%w) ~] ~[ (%w) of (%w) ~] ~[ (%w) of (%w) ~] ~[ (%w) of (%w) ~] ~[ (%w) of (%w) ~]} {#MXP ~<image cards\%1%2.gif> ~<image cards\%3%4.gif> ~<image cards\%5%6.gif> ~<image cards\%7%8.gif> ~<image cards\%9%10.gif>} |
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
 |
inimical Beginner
Joined: 12 Aug 2003 Posts: 14
|
Posted: Fri Aug 06, 2004 7:39 am |
That works just fine, it actually occured to me a minute after I posted . I'm now trying to give it some added functionality. When you "sayto dealer 'card number'", you kick that card in and draw another, I want to be able to replace cards by clicking those I don't want. It looked pretty simple, doing so like this:
Code: |
#MXP ~<send "sayto dealer first">~<image cards/%1%2.gif>~</send> ~<send "sayto dealer second">~<image cards/%3%4.gif>~</send> ~<send "sayto dealer third"> ~<image cards/%5%6.gif>~</send> ~<send "sayto dealer fourth">~<image cards/%7%8.gif>~</send> ~<send "sayto dealer fifth">~<image cards/%9%10.gif>~</send>
|
but what resulted was a convoluted overlapping of the <send>'s. They don't match up with the images, they seem to be crammed to one side. Know of a way to sort that out? |
|
_________________ |
|
|
 |
DeathDealer Adept

Joined: 20 Jul 2004 Posts: 268
|
Posted: Fri Jan 14, 2005 6:37 pm |
Just curious, but on my mud we also have a card game (blackjack in this case)
And i was just curious, they have # for the #'s and words for the words.
So 6 of clubs and king of clubs.
Wanted to make a change to the script so that it would work on either #'s or words, but at a loss as to how to do that.
Tried this:
#TR { (%w) of (%w).} {#MXP ~<Images\%1%2.gif>}
#ECHO You get a King of hearts.
Result printed on screen
You get a King of hearts.
<Images\Kinghearts.gif>
Now, dunno if it matters in the whole thing, but the mud isn't MXP enabled. But I DO have MXP enabled in ZMud.
Any help? |
|
|
 |
DeathDealer Adept

Joined: 20 Jul 2004 Posts: 268
|
Posted: Thu Jan 20, 2005 3:46 pm A *bump* with a *grovel* |
A *bump* with a *grovel*
|
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Thu Jan 20, 2005 6:03 pm |
Use %a instead of %w to match either digits or letters.
|
|
_________________ Kjata |
|
|
 |
DeathDealer Adept

Joined: 20 Jul 2004 Posts: 268
|
Posted: Fri Jan 21, 2005 2:20 pm |
Thanks for that tip!
Now, can u tell me why it is diplaying the text <Images\Kinghearts.gif> rather than the image?
(and yes, the images are in the Images directory in the mud directory) |
|
Last edited by DeathDealer on Fri Jan 21, 2005 2:51 pm; edited 1 time in total |
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Fri Jan 21, 2005 2:42 pm |
Because <Images\Kinghearts.gif> is not a valid MXP tag. What you want is <image Images\Kinghearts.gif>
|
|
_________________ Kjata |
|
|
 |
DeathDealer Adept

Joined: 20 Jul 2004 Posts: 268
|
Posted: Fri Jan 21, 2005 2:53 pm |
oh dammit...LOL
I was thinking from the examples above that the directory was CALLED image cards and not that it was a tag for image and card was the directory.
*sigh* *slap self*  |
|
_________________
 |
|
|
 |
DeathDealer Adept

Joined: 20 Jul 2004 Posts: 268
|
Posted: Fri Jan 21, 2005 3:03 pm |
k, got a followup question. It don't work exactly as I would like. Might be because the image it to big or something: Any way to get it to NOT overlap like that?
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Jan 22, 2005 1:57 pm |
Use smaller pictures, maybe?
|
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
 |
DeathDealer Adept

Joined: 20 Jul 2004 Posts: 268
|
Posted: Mon Jan 24, 2005 2:18 pm |

|
|
_________________
 |
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Mon Jan 24, 2005 10:14 pm |
Try <image ... align=bottom> and see if that works.
|
|
_________________ Kjata |
|
|
 |
DeathDealer Adept

Joined: 20 Jul 2004 Posts: 268
|
Posted: Tue Jan 25, 2005 1:41 pm |
Tried:
#MXP ~<image "Images\%1%2.gif" align="bottom">
&
#MXP ~<image Images\%1%2.gif align=bottom>
Both show the exact same thing as without the align. |
|
_________________
 |
|
|
 |
|
|