|
Virus Wanderer
Joined: 29 Jun 2002 Posts: 69 Location: USA
|
Posted: Fri Feb 14, 2003 5:22 pm
Trigger Help |
Ok, I have a trigger:
^You have been hit for (%d) points of damage in the ({Head|Center Torso|Center Torso ~(rear~)|Left Torso|Left Torso ~(rear~)|Right Torso|Right Torso ~(rear~)|Right Arm|Left Arm|Left Leg|Right Leg}){~(transfer~)|}$
Whats its set up to do is:
#GAG
loc = %replace(%2,"(","")
loc = %replace($loc,")","")
loc = %replace($loc," ",_)
#SH %ansi(high,red)DAMAGE!!%ansi(high,white) %1 to %2
damage_taken = %eval($damage_taken + %1)
#VAR $loc %eval(${$loc} - %1)
When I get a damage emit it works fine. But when I get several it mixed them up due to the variable loc that I created. (Oh, bear in mind that I change @ to $). Is there an easier way to do the replacements that I need done then what I did? I need to make ( and ) turn into nothing "" and I need spaces " " turned into _. Ok.
Richard Powell
Mux Alias: Virus
2796 Wizard Staff
64.89.10.1 port 2796
Rich@gigdev.com |
|
|
|
Virus Wanderer
Joined: 29 Jun 2002 Posts: 69 Location: USA
|
Posted: Fri Feb 14, 2003 8:32 pm |
Ok, the problem I was having is I was writing to then claling the same variable 3 times in that script. I fixed it by simply typing %replace(%replace(%replace(%2,"(",""),")","")," ",_)
Also, instead of writing to a variable I used it right inside the code I needed.
Heres what I used:
#GAG
#SH %ansi(high,red)DAMAGE!!%ansi(high,white) %1 to %2
damage_taken = %eval($damage_taken + %1)
#VAR %replace(%replace(%replace(%2," ",_),"(",""),")","") %eval(${%replace(%replace(%replace(%2," ",_),"(",""),")","")} - %1)
Richard Powell
Mux Alias: Virus
2796 Wizard Staff
64.89.10.1 port 2796
Rich@gigdev.com |
|
|
|
|
|
|
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
|
|