|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Fri Feb 11, 2005 5:11 pm
Posting Stats to channels **SOLVED** |
Trying to get a stat reporter running a little automatically.
I want to type stats have it send attr and then on the line (Use 'SCORE' and 'WHOIS' to see more details on your character) have it send the results to whatever i typed after stats (stats clan sends the report to the clan channel etc.)
The code works fine, but for SOME reason it's copying the trigger that I want it to go off of in the main class folder, so when i type attr it is sending the command regardless.
Not sure why at all.
The output of attr from the mud varies from how people might have it set up. it will either be:
Quote: |
---------------------------------------------------------------------------
Your main attributes are:
Str :[142/ 96] Int :[121/103] Wis :[ 75/ 61] Hr :[200]
Dex :[119/ 98] Con :[118/ 88] Luck:[154/100] Dr :[155]
Hp:[3287/3287] Mn:[2533/2533] Mv:[2154/2154]
Trains: [ 15] Pracs: [ 34] Saves: [ 4] AC: [ 583/ 596/ 599/ 546 ]
(Use 'SCORE' and 'WHOIS' to see more details on your character)
---------------------------------------------------------------------------
or
---------------------------------------------------------------------------
Your main attributes are:
Str :[138/ 96] Int :[121/103] Wis :[ 75/ 61] Hr :[178]
Dex :[119/ 98] Con :[118/ 88] Luck:[154/100] Dr :[153]
Hp:[3287/3287] Mn:[2533/2533] Mv:[2154/2154]
Trains: [ 15] Pracs: [ 34] Saves: [ 4] AC: [ 1517/1530/1533/1480 ]
(Use 'SCORE' and 'WHOIS' to see more details on your character)
---------------------------------------------------------------------------
|
and for some, I've just found out, wont even have the (Use 'SCORE' and 'WHOIS' to see more details on your character) part meaning that I have to change that to the Trains line. (But i'm willing to be the same problem will arise in the main class folder.
One reason I dont do the within|Param=1 set up is due to the diff in spaces.
#CLASS {Stat_Announce}
#ALIAS stats {
attr
#TRIGGER {(Use 'SCORE' and 'WHOIS' to see more details on your character)} {%1 Bunches of cute info that seem to be worth knowing to others}
}
#TRIGGER {^Str :~[%1~/%2~] * :~[%3~/%4~] *:~[%5~/%6~] *r :~[%7~]} {
#var spelled_str {%1}
#var base_str {%2}
#var spelled_int {%3}
#var base_int {%4}
#var spelled_wis {%5}
#var base_wis {%6}
#var att_hr {%7}
}
#TRIGGER {^Dex :~[%1~/%2~] * :~[%3~/%4~] *:~[%5~/%6~] *r :~[%7~]} {
#var spelled_dex {%1}
#var base_dex {%2}
#var spelled_con {%3}
#var base_con {%4}
#var spelled_luck {%5}
#var base_luck {%6}
#var att_dr {%7}
}
#CLASS 0
Used Pretty Print
Syntax Colourizer
why in the heck would a trigger inside an alias cause that trigger to be put in the main folder as well anyways?!..weird! |
|
Last edited by DeathDealer on Fri Apr 01, 2005 8:17 pm; edited 1 time in total |
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Fri Feb 11, 2005 6:10 pm |
K did some work on this and made it work, but as far as i am concerned it's ugly as hell..If someone could show me how to clean it up a little it would be great.
#CLASS {Stat_Announce}
#ALIAS stats1 {
#va stat1ann {%1 %2}
#T+ pissingmeoff
attr
}
#TRIGGER {^Str :~[%1~/%2~] * :~[%3~/%4~] *:~[%5~/%6~] *r :~[%7~]} {
#var spelled_str {%1}
#var base_str {%2}
#var spelled_int {%3}
#var base_int {%4}
#var spelled_wis {%5}
#var base_wis {%6}
#var att_hr {%7}
}
#TRIGGER {^Dex :~[%1~/%2~] * :~[%3~/%4~] *:~[%5~/%6~] *r :~[%7~]} {
#var spelled_dex {%1}
#var base_dex {%2}
#var spelled_con {%3}
#var base_con {%4}
#var spelled_luck {%5}
#var base_luck {%6}
#var att_dr {%7}
}
#TRIGGER "pissingmeoff2" {---------------------------------------------------------------------------} {
@stat1ann Bunches of cute info that seem to be worth knowing to others
#T- pissingmeoff
#T- pissingmeoff2
} "" {disable}
#TRIGGER "pissingmeoff" {Your main attributes are:} {#T+ pissingmeoff2} "" {disable}
#CLASS 0
Used Pretty Print
Syntax Colourizer |
|
_________________
|
|
|
|
Aarlot Adept
Joined: 30 Dec 2003 Posts: 226
|
Posted: Fri Feb 11, 2005 11:56 pm |
If you wanted to use the original script you had, you could have changed the "#TRIGGER {(Use score..." to #TEMP {(Use score...
Temp triggers only fire once, so you wouldn't have it reporting every time you hit stat. As for a cleaning up the second one, I would suggest looking at using conditions. |
|
_________________ Everyone is entitled to their beliefs - until they die. Then only the truth matters. |
|
|
|
Aarlot Adept
Joined: 30 Dec 2003 Posts: 226
|
Posted: Sat Feb 12, 2005 12:39 am |
Something like:
#CLASS {Stat Announce}
#ALIAS stats1 {
#VAR stat1ann {%1 %2}
#T+ statann
}
#VAR stat1ann {}
#VAR spelled_str {}
#VAR base_str {}
#VAR spelled_int {}
#VAR base_int {}
#VAR spelled_wis {}
#VAR base_wis {}
#VAR att_hr {}
#VAR spelled_dex {}
#VAR base_dex {}
#VAR spelled_con {}
#VAR base_con {}
#VAR spelled_luck {}
#VAR base_luck {}
#VAR att_dr {}
#TRIGGER "statann" {^Your main attributes are:} {}
#COND {^Str :~[(%d)~/(%d)~] * :~[(%d)~/(%d)~] *:~[(%d)~/(%d)~] *r :~[(%d)~]} {
#VAR spelled_str {%1}
#VAR base_str {%2}
#VAR spelled_int {%3}
#VAR base_int {%4}
#VAR spelled_wis {%5}
#VAR base_wis {%6}
#VAR att_hr {%7}
}
#COND {^Dex :~[(%d)~/(%d)~] * :~[(%d)~/(%d)~] *:~[(%d)~/(%d)~] *r :~[(%d)~]} {
#VAR spelled_dex {%1}
#VAR base_dex {%2}
#VAR spelled_con {%3}
#VAR base_con {%4}
#VAR spelled_luck {%5}
#VAR base_luck {%6}
#VAR att_dr {%7}
}
#COND {^Trains:} {
@stat1ann Bunches of cute info that seem to be worth knowing to others
#VAR stat1ann {}
#T- statann
}
#CLASS 0 |
|
_________________ Everyone is entitled to their beliefs - until they die. Then only the truth matters. |
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Mon Feb 14, 2005 2:04 pm |
Don't #COND's need to have a within paramater?
thought they did. *grumble* |
|
_________________
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon Feb 14, 2005 10:40 pm |
no, they don't HAVE to. #CONDITION doesn't really need any parameters unless you use a specific type. As for WITHIN, that allows zmud to determine that the trigger in fact did not match and so it doesn't need to keep looking for a match.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
DeathDealer Adept
Joined: 20 Jul 2004 Posts: 268
|
Posted: Tue Feb 15, 2005 3:35 pm |
Aarlot wrote: |
If you wanted to use the original script you had, you could have changed the "#TRIGGER {(Use score..." to #TEMP {(Use score...
Temp triggers only fire once, so you wouldn't have it reporting every time you hit stat. As for a cleaning up the second one, I would suggest looking at using conditions. |
Thanks for that bit of info.
rather use that #temp than turning on and off triggers for nothing :-) seems like a wasted step.
|
|
|
|
|
|