|
Alexiel Novice
Joined: 05 Mar 2007 Posts: 33 Location: Paulsboro,NJ
|
Posted: Sun Nov 11, 2007 9:16 pm
Help with XP,Gold,Kill and tick counter |
Alright, I've been working on this counter for a bit, unfortunately I believe I messed up someplace, since my counter is way off when I'm grouping. This is what I have:
Code: |
#alias {xp} {gt -=In @tcounter ticks we have slayed @kcount mobs and I have gotten @xps Xps and @gld gold.=-}
#VAR {tcounter} {0}
#VAR {xps} {0}
#VAR {gld} {0}
#VAR {kcount} {0}
#TRIGGER {^The Great Bell of Hillsborough rings 1 time.} {#ad tcounter 1}
#TRIGGER {^The Great Bell of Hillsborough rings (%1) times.} {#ad tcounter 1}
#TRIGGER {^You receive your reward for the kill, (%d)} {#ad xps %1;#ad kcount 1}
#TRIGGER {^gold coins, and you receive (%d).} {#ad gld %1}
#ALIAS {reset} {#var tcounter 0;#var xps 0;#var gld 0;#var kcount 0;#var sanc 0} |
I think it might be something with #ad but I am not overly sure, if anyone can help me that'd be great! |
|
|
|
Progonoi Magician
Joined: 28 Jan 2007 Posts: 430
|
Posted: Sun Nov 11, 2007 9:46 pm |
Those two triggers:
Code: |
#TRIGGER {^The Great Bell of Hillsborough rings 1 time.} {#ad tcounter 1}
#TRIGGER {^The Great Bell of Hillsborough rings (%1) times.} {#ad tcounter 1}
|
Should be:
Code: |
#TRIGGER {^The Great Bell of Hillsborough rings (%d) time{s|}.} {#ad tcounter 1}
|
You can of course have 2 seperate triggers as well, the key is using %d inside ()'s and not anything else. Basically the trigger I'm suggesting makes your 2 triggers in one line checking if its "time" or "times" and adding the number amount to counter.
You have to use (%d) in the trigger pattern when you want to grab a number.
Prog |
|
_________________ The Proud new owner of CMud.
--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
-------------------------------- |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sun Nov 11, 2007 10:15 pm |
His script, however, doesn't appear to be grabbing a number, so it should just be:
Code: |
#TRIGGER {^The Great Bell of Hillsborough rings %d time{s|}.} {#ad tcounter 1} |
However, like Prog said, if you were going to use the number of times it rang for any reason (such as putting it into a variable) then you'd put parentheses around the %d.
Charneus |
|
|
|
Alexiel Novice
Joined: 05 Mar 2007 Posts: 33 Location: Paulsboro,NJ
|
Posted: Mon Nov 12, 2007 2:57 am |
Would I use the same format for the rest of the triggers as well?
|
|
|
|
Progonoi Magician
Joined: 28 Jan 2007 Posts: 430
|
Posted: Mon Nov 12, 2007 3:41 am |
Those 2 triggers...
Code: |
#TRIGGER {^You receive your reward for the kill, (%d)} {#ad xps %1;#ad kcount 1}
#TRIGGER {^gold coins, and you receive (%d).} {#ad gld %1}
|
I'm taking a wild guess here, but maybe they're supposed to be one line of info instead?
Code: |
#TRIGGER {^You receive your reward for the kill, (%d) gold coins, and you receive (%d).} {#ad gld %1;#add xps %2;#ad kcount 1}
|
Got the idea because generally msgs from Mud don't start with lower casing and if its part of another line, ie "gold coins" line is present in the middle or within another line, using "^" won't work because its a line start anchor.
I'm sorry if I'm completely off though, its late.
Prog |
|
_________________ The Proud new owner of CMud.
--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
-------------------------------- |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Mon Nov 12, 2007 4:18 am |
The rest of your script looks ok, however, I would do as Prog suggested. That was an oversight on both of our parts. ;)
Prog is right: if your mud puts the whole reward thing on one line, but your window wraps it to two lines, then that reward trigger will not work. Overall, this is what your script will look like if you make the corrections we've pointed out (or more specifically, Prog pointed out, I just reiterated)
Code: |
#alias {xp} {gt -=In @tcounter ticks we have slayed @kcount mobs and I have gotten @xps Xps and @gld gold.=-}
#VAR {tcounter} {0}
#VAR {xps} {0}
#VAR {gld} {0}
#VAR {kcount} {0}
#TRIGGER {^The Great Bell of Hillsborough rings %d time{s|}.} {#ad tcounter 1}
#TRIGGER {^You receive your reward for the kill, (%d) gold coins, and you receive (%d).}} {#ad xps %2;#ad gld %1;#ad kcount 1}
#ALIAS {reset} {#var tcounter 0;#var xps 0;#var gld 0;#var kcount 0;#var sanc 0} |
Of course, I'm assuming that the line for reward would read this:
Code: |
You receive your reward for the kill, 100 gold coins, and you receive 100. |
I'll admit that ending it on a number after "you receive" doesn't make much sense. Perhaps it says xp after it? If it does, then you'll want to change that line to
[code]#TRIGGER {^You receive your reward for the kill, (%d) gold coins, and you receive (%d) xp.} {#ad gld %1;#ad xps %2;#ad kcount 1}[code]
Perhaps if you favored us with some output from your MUD, we could better discern how to solve the issue. :P
Charneus |
|
|
|
Alexiel Novice
Joined: 05 Mar 2007 Posts: 33 Location: Paulsboro,NJ
|
Posted: Mon Nov 12, 2007 6:09 pm |
This is how my mud reads when something is killed:
A large gilded chest is dead! R.I.P.
You receive your reward for the kill, 993464 experience points.
Your blood freezes as you hear a large gilded chest's death cry.
Kelric gets an absolutely colossal mountain of gold coins from the corpse of a large gilded chest.
Kelric splits 2172941 gold coins, and you receive 271617.
Its alot different from the muds I used to play.
Edit: I loaded up the triggers, but they are not updating so when I grouptell its showing all 0's...this trigger set being in a folder shouldn't effect the maths right? |
|
|
|
|
|
|
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
|
|