|
yull26m Beginner
Joined: 05 Jan 2010 Posts: 26
|
Posted: Fri Mar 05, 2010 10:24 am
I need help with a script that I can not figure out for some reason. |
the mud output is this:
Code: |
Contact listing
===============================================
[SL] sloo[ X:46 Y:50 Z:0 R:4.6 B:268 H:90 S:90 |RSD
[GZ] HELP! X:46 Y:50 Z:20 R:4.6 B:268 H:20 S:20 |RSD
[**] catch me if you can X:46 Y:50 Z:0 R:4.6 B:268 H:0 S:0 |RSD
[**] sloop X:46 Y:50 Z:0 R:4.6 B:268 H:0 S:0 |RSD
[**] snabbsomfan X:46 Y:50 Z:0 R:4.6 B:268 H:0 S:0 |RSD
[**] GhostRider X:47 Y:50 Z:0 R:3.6 B:267 H:0 S:0 |RSD |
but to simplify what I am asking will explain bout this context a little bit.
[GZ] HELP! X:46 Y:50 Z:20 R:4.6 B:268 H:20 S:20 |RSD
[GZ] is the ship ID
HELP! is the ships name
I do not care bout the X Y or Z
R:4.6 means the ship is 4.6 rooms away
H:20 means it is heading in a north by northwest direction
S:20 means it is traveling at a speed of 20
|RSD the R means it is rear the S means starboard and the D means it is docked
I want a trigger or script that will set the ID to a variable the name to a variable, the rooms to a variable, the heading to a variable, the speed to a variable and the arc "|RSD" to a variable. I have tried and can not come up with anything that works.
the trigger I tried putting in is:
#trigger {[(*)] (*) X:(*) Y:(*) Z:(*) R:(*) B:(*) H:(*) S:(*) |(*)} {@ID = %1;@NAME = %2;@ROOMS = %6;@BEAR = %7;@HEADING = %8;@SPEED = %9;@ARC = %10;#SA @ID IS @ROOMS AWAY;#SA -----------------------------;#SA -----------------------------;#SA -----------------------------;#SA HEADING @HEADING AT THE SPEED OF @SPEED;#SA -----------------------------;#SA -----------------------------;#SA -----------------------------;#SA AND HE IS IN THE ARC OF @ARC}
if someone can write me a script to assign those stats to variables, I can write the rest of it. |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Fri Mar 05, 2010 8:32 pm |
~[(%x)~]%s(*)%sX:(%d)%sY:(%d)%sZ:(%d)%sR:(%x)%sB:(%d)%sH:(%d)%sS:(%d)%s~|(%w)
use the above as your trigger pattern |
|
_________________ Taz :) |
|
|
|
yull26m Beginner
Joined: 05 Jan 2010 Posts: 26
|
Posted: Sat Mar 06, 2010 5:16 am |
thanx tons bud...that works perfectly......
I almost had it working but still new to setting variables and some of the stuff still stumps me... |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Mar 06, 2010 10:42 am |
Also, get rid of the @ in front of your variables when you're giving them a value. It needs to be ID=%1, not @ID=%1.
Charneus |
|
|
|
yull26m Beginner
Joined: 05 Jan 2010 Posts: 26
|
Posted: Sat Mar 06, 2010 6:00 pm |
Thanx for the advice bout not putting @ in front of variables, but I have already written the script with the trigger pattern that taz wrote for me, and I left the @ in when I wrote it and it works great.
|
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Mar 06, 2010 7:46 pm |
Just because something 'works great' in zMUD doesn't mean it was intended that way. ;) In CMUD, you can't use @ when setting the variable. Why? Because instead of setting the variable, it'd be setting what's IN the variable (for instance, if ID had a value of foo, doing @ID=bar would be the equivalent of foo=bar). It's been a while since I've messed with zMUD, but it wouldn't surprise me if you had variables for all your possible IDs (and variables for everything else. :\).
Charneus |
|
|
|
|
|