|
Rousey Newbie
Joined: 14 Jan 2002 Posts: 3 Location: Australia
|
Posted: Mon Jan 14, 2002 9:00 am
converting a triggerset trouble |
This is going to be messy and complicated...
A while back, I made a set of triggers using 4.62 to time how long it took me to complete a quest on my fave MUD..
The trigger works beautifully on 4.62, then someone said I should get 6.16 and make it through that.. I've tried, but always there are errors in conversion.. I'll display the triggers that I use here, and hopefully some smart coder out there can help me out :)
---trigger 1 (this part gets the quest mob
name and stores it as a variable)
#TRIGGER {An elder dragon tells you 'Aardwolf's most heinous criminal, (*),'} {#variable qmob {%1}}
---trigger 2 (this part gets the quest area, stores it, and also starts the timer by storing the time converted to seconds in the qsec variable)
#TRIGGER {An elder dragon tells you 'of (*).'} {#variable qarea {%1};#math qmin1 %rightback(%time(hhmm),2)*60;#math qsec1 %time(ss);#math qhour1 %time(hh)*3600;#math qsec @qhour1+@qmin1+@qsec1}
---trigger 3 (this gets the quest points and gold out as variables, calculates the time in seconds again and works out how long the quest has taken. then it outputs it to the ftalk channel)
#TRIGGER {An elder dragon tells you 'As a reward, I am giving you (%d) quest points and (%d) gold.'} {#variable qpoint {%1};#variable qgold {%2};#math qhour2 %time(hh)*3600;#math qmin2 %rightback(%time(hhmm),2)*60;#math qsec2 %time(ssss);#math qsece @qhour2+@qmin2+@qsec2;#if (@qsec>@qsece) {#math qsece @qsece+86400};#math qtime @qsece-@qsec;#math qmin3 @qtime/60;#math qsec3 @qtime60;ftalk :just annihilated @qmob@C in @qarea in a time of @qmin3 minute(s) and @qsec3 second(s) and received @qpoint quest points for his efforts.}
Sorry if its too hard to understand, but It's the best I can do to copy it to here.
All my math worked in 4.62, but not in 6.16
------
Thank you all for your help :)
------
Rousey - 'We Went in Mad .. We Came Out INSANE!' |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Mon Jan 14, 2002 2:10 pm |
Try using the %secs pre-defined variable instead which returns the amount of milliseconds since midnight. You just need to record its value when you start and substract it from its value when you finish.
I'm not too sure since I don't have zMUD in front of me right now, but I think the format returned by %time has changed since 4.62
Kjata |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Jan 14, 2002 8:54 pm |
I suspect your problem is that you are trying to use existing variables in the same command (#TR) which updates them. My experience indicates that zMUD will use the existing value rather than the updated one in this case.
Suggested alterations:
#TRIGGER {An elder dragon tells you 'Aardwolf's most heinous criminal, (*),'} {#variable qmob {%1}}
#TRIGGER {An elder dragon tells you 'of (*).'} {#variable qarea {%1};#MATH qsec ((3600 * time(h)) + (60 * time(n)) + time(s))}
#TRIGGER {An elder dragon tells you 'As a reward, I am giving you (%d) quest points and (%d) gold.'} {#variable qpoint {%1};#variable qgold {%2}; #MATH qsece ((3600 * time(h)) + (60 * time(n)) + time(s));qtime}
#AL qtime {#IF (@qsec>@qsece) {#MATH qmin3 (@qsece + 86400 - @qsec)/60;#MATH qsec3 (@qsece + 86400 - @qsec}60} {#MATH qmin3 (@qsece - @qsec)/60;#MATH qsec3 (@qsece - @qsec)60};qreport}
#AL qreport {ftalk :just annihilated @qmob@C in @qarea in a time of @qmin3 minute(s) and @qsec3 second(s) and received @qpoint quest points for his efforts.}
I don't know what @C is, but you had it in your script
LightBulb
All scripts untested unless otherwise noted |
|
|
|
Rousey Newbie
Joined: 14 Jan 2002 Posts: 3 Location: Australia
|
Posted: Tue Jan 15, 2002 4:34 am |
ah, that @C wasnt actually meant to be left there, the mud I play uses @ for colouring with @C for bright cyan, I actually use `(key above tab) as my variable symbol, but thought I would try to write it here with the standard symbols and strip all colour codes..
Thank You both for all your help, it is very much appreciated, I will be able to give your ideas a try tonight after I get home from work.
------
Rousey |
|
|
|
|
|
|
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
|
|