|
nutsnbolts Apprentice
Joined: 01 May 2002 Posts: 188 Location: USA
|
Posted: Wed Jun 12, 2002 4:06 pm
Replace word ?? |
Anyone know how to replace something that I will be outputting.
For instance, I grab something from the mud.
It has 1 hitroll.
It has 2 damroll.
#trigger {It has (%d) hitroll} {hitroll=%1}
#trigger {It has (%d) damroll} {damroll=%1}
#alias report {say This weapon has @hitrollHitroll @damrollDamroll)
What I want it to do is instead, have something like,
Sword +1hit +1dam
Basically, if it doesn't have that these texts:
It has 1 hitroll.
It has 1 damroll.
In my say alias, although I may have something like:
#alias report {say @damroll @hitroll}
It will ignore it. If anythign leave spaces..for the missing information..however if it does, it would add in +1hit +1dam.
Kinda confusing...I just don't want to keep putting @hitroll~HIT @damroll~DAM because it will then just use the variable previous and add the information in like that.
Thank you for everything, it's always appreciated. |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Wed Jun 12, 2002 4:37 pm |
Tried reading the whole post 3 times... sorry, still don't understand. Please, once again? A bit clearer this time?
Kjata |
|
|
|
nutsnbolts Apprentice
Joined: 01 May 2002 Posts: 188 Location: USA
|
Posted: Wed Jun 12, 2002 4:57 pm |
Sorry I knew this was going to be confusing...
Basically I want to output whatever I grabbed from an identify spell such as hit roll and dam roll.
However, not every item has a hitroll and damroll so I can't put in a say command:
say @hitroll HIT @damroll DAM.
because then if there are not hit/dam it would then say HIT DAM with the missing variables. Instead I was hoping whenever a hitroll is grabbed from an identify spell, it will then say and changed the text to +1hit or +1dam. If there is nothing, it will say nothing. The variables will still be there but it will not show anything.
Thank you for everything, it's always appreciated. |
|
|
|
dacheeba Adept
Joined: 29 Oct 2001 Posts: 250
|
Posted: Wed Jun 12, 2002 5:05 pm |
#alias report {#IF (@damroll OR @hitroll) {say @hitroll @damroll}}
You gotta make sure that whenever you id an item, it resets the variables to 0 before capturing the hitroll/damroll, or after you are done saing it.But I'm assuming you have something like that already. |
|
|
|
nutsnbolts Apprentice
Joined: 01 May 2002 Posts: 188 Location: USA
|
Posted: Wed Jun 12, 2002 9:28 pm |
Finally I'm doing something right...yeah dacheeba I have something to reset everything.
Thank you for everything, it's always appreciated. |
|
|
|
nutsnbolts Apprentice
Joined: 01 May 2002 Posts: 188 Location: USA
|
Posted: Wed Jun 12, 2002 9:55 pm |
say %replace( @identifyeqitem, " ", "") %replace( =, " ", "")~<%replace( @identifyeqtype~/@identifyeqstyle@identifyeqterrain, " ", "")> @identifyeqweight~kg -- @identifyeqdice
IF (@identifyeqhitroll == 1) {
+@identifyeqhitroll~Hit}
If (@identifyeqhitroll <> 1) {
#SHOW no Hit roll}
Thank you for everything, it's always appreciated. |
|
|
|
nutsnbolts Apprentice
Joined: 01 May 2002 Posts: 188 Location: USA
|
Posted: Thu Jun 13, 2002 5:43 pm |
quote:
#alias report {#IF (@damroll OR @hitroll) {say @hitroll @damroll}}
You gotta make sure that whenever you id an item, it resets the variables to 0 before capturing the hitroll/damroll, or after you are done saing it.But I'm assuming you have something like that already.
This doesn't work....
Thank you for everything, it's always appreciated. |
|
|
|
nutsnbolts Apprentice
Joined: 01 May 2002 Posts: 188 Location: USA
|
Posted: Thu Jun 13, 2002 5:48 pm |
quote:
quote:
#alias report {#IF (@damroll OR @hitroll) {say @hitroll @damroll}}
You gotta make sure that whenever you id an item, it resets the variables to 0 before capturing the hitroll/damroll, or after you are done saing it.But I'm assuming you have something like that already.
Anyway to do something like,
#IF (@hitroll = 1|2|3) {say +@hitrollHit}
I dont' know if that bar is the correct variable?
Thank you for everything, it's always appreciated. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Jun 13, 2002 6:38 pm |
#AL report {#IF (@damroll OR @hitroll) {say %if(@hitroll>0,+@hitroll Hitroll ,)%if(@damroll>0,+@damroll Damroll,)}}
Keep in mind that @hitrollHit is a variable named "hitrollHit", not a variable named "hitroll" followed by the letters Hit.
LightBulb
Senior Member |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Jun 14, 2002 1:29 am |
quote:
#AL report {#IF (@damroll OR @hitroll) {say %if(@hitroll>0,+@hitroll Hitroll ,)%if(@damroll>0,+@damroll Damroll,)}}
Keep in mind that @hitrollHit is a variable named "hitrollHit", not a variable named "hitroll" followed by the letters Hit.
LightBulb
Senior Member
You should be able to get around that like this, correct?
{@hitroll}Hit {@Damroll}Dam
li'l shmoe of Dragon's Gate MUD |
|
|
|
Pega Magician
Joined: 08 Jan 2001 Posts: 341 Location: Singapore
|
Posted: Fri Jun 14, 2002 9:39 am |
#trigger {It has (%n) hitroll.} {#var hitroll %1}
#trigger {It has (%n) damroll.} {#var damroll %1}
#alias report {say This weapon has%if(@hitroll or @damroll,%if(@hitroll," "@hitroll"Hitroll")%if(@damroll," "@damroll"Damroll")," neither hitroll nor damroll")"."} |
|
|
|
|
|