|
Duindain Novice
Joined: 14 Feb 2003 Posts: 31 Location: Perth, Australia
|
Posted: Mon Feb 17, 2003 3:06 am
Just a quick question |
#trigger {Affects: HITROLL By (%d)} {#ADDITEM affectid %1}
i have lots of these in a equip database trig just wondering why it wont pick up the varible at all it adds the string HITROLL By to the list but of the varible theres no sign |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Mon Feb 17, 2003 4:19 am |
What real mud output are you trying to match?
If it is like:
Affects: HITROLL By +3
Affects: HITROLL By -2
You'll need (%n) and not (%d).
Ton Diening |
|
|
|
Duindain Novice
Joined: 14 Feb 2003 Posts: 31 Location: Perth, Australia
|
Posted: Mon Feb 17, 2003 5:11 am |
no its not is affects hitroll by 3 n stuff no plus or negs
|
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Mon Feb 17, 2003 5:19 am |
Post an example of what the mud actually shows (perhaps a few examples) and we'll take a look at it.
Ton Diening |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Feb 17, 2003 5:25 am |
If it adds "HITROLL By" to the list then zMUD is picking that phrase up as %1. That indicates the pattern you posted isn't the one you're actually using. The pattern you're actually using probably has a wildcard enclosed in parentheses (*), but might have a database-variable indicator such as &AffectID. In either case, the number would then be %2.
LightBulb
Advanced Member |
|
|
|
Duindain Novice
Joined: 14 Feb 2003 Posts: 31 Location: Perth, Australia
|
Posted: Mon Feb 17, 2003 6:08 am |
i forgot to mention im making the hitrol by appear with a
#ADDITEM affectid Hitroll by
before each one of these
#trigger {Affects: HITROLL By (%n)} {#ADDITEM affectid %1} the mud out put is not important i just need help making the second statement work because the additem is not picking up the %1 from the mud and it is the right code to trigger it of it is just not picking up the bonus from it i tried %n as u can see above as well as the original %d and i tried %2 but that didnt work at this stage is just a trigger it doesnt touch the databse itself so no database varibles |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Mon Feb 17, 2003 6:12 am |
Lightbulb hit the issue on the head.
You probably have a trigger:
#TRIGGER {Affects: (*)} {#NOOP something here}
And its that trigger that is causing the witnessed behaviour.
Ton Diening |
|
|
|
Duindain Novice
Joined: 14 Feb 2003 Posts: 31 Location: Perth, Australia
|
Posted: Mon Feb 17, 2003 7:04 am |
heh i dont know if u were posting when i wrote last reply but anyway i dont have a trigger with #noop in it i dont know what noop function does atm anyway i have a trigger which says
#trigger {Affects: HITROLL By (%n)} {#ADDITEM affectid %1}
#ADDITEM affectid Hitroll by
just some like that for each stat and like i said before thou u didnt seem to beleive me the mud output is
Affects: CON By 3
and so on for int dex hitroll damroll n all the rest |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Feb 17, 2003 7:39 am |
If you have another trigger that fires on the same line (should have mentioned it in the first place) that would account for it adding HITROLL By. In that case, chances are that there is MORE THAN ONE space after Affects: and/or MORE THAN ONE space after By. Trigger patterns have to match EXACTLY or they don't work (I can remember one MUD where I had 3 different hitpoint triggers to match spacing for combat/non-combat/regen).
#TR {Affects: (*) by%s(%n)} {#ADDI affectid {%1};#ADDITEM affectid %2}
LightBulb
Advanced Member |
|
|
|
Duindain Novice
Joined: 14 Feb 2003 Posts: 31 Location: Perth, Australia
|
Posted: Mon Feb 17, 2003 5:06 pm |
ok i kinda have it working its capturing the name of the stat going to affect and most of the velues affecting them what i neeed i think is a way to capture say 20 lines along like with the [range] option but more a (*[20]) or something is there anything like that to capture a string say from the mud 20 characters long excellent way to simplify the trigger btw lightbulb thx for that
anyway here is the what im trying to do
Can affect you as :
Affects: MAXMANA By 35
Affects: MAXHIT By 35
Affects: HITROLL By 4
Affects: DAMROLL By 5
this is a good example anyway
this is the trigger i use now
#tr {Affects: (*) (%d)} {#ADDItem affectid %1
#additem affectid %2}
this is the output i am getting
MAXMANA|35||MAXHIT|HITROLL|4|DAMROLL|5
it is not getting the maxhit for some reason also when i do other items sometimes it does not get the last stat
in this one
Can affect you as :
Affects: HITROLL By 2
Affects: DAMROLL By 2
it does or could be getting hitroll but not damroll althou it could just be damroll in the wrong place and hitroll still not being captured right it seems to change from item to item which one it doesnt get the number on anyway if theres a function to grab 20 characters long on a line then ill be set i think |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Feb 17, 2003 5:28 pm |
The #ADDITEM command doesn't add duplicates. That's why you don't get the second 35 or the second 2. One way of solving this is to use the %additem function. Another method is to switch from a list-variable to a record-variable by using #ADDKEY (recommended). Both methods illustrated below:
#TR {Affects: (*) (%d)} {#ADDI affectid {%1};#VAR affectid %additem( %2, @affectid)}
#TR {Affects: (*) (%d)} {#ADDK affectid {%1} {%2}}
Switching to a record-variable may require changing any other scripts which use this variable.
LightBulb
Advanced Member |
|
|
|
Duindain Novice
Joined: 14 Feb 2003 Posts: 31 Location: Perth, Australia
|
Posted: Mon Feb 17, 2003 5:46 pm |
kewl it works perfectly now i changed it to add spaces in so easier to read like so
#ADDK affectid {%1" "} {" "%2}
great solution thankyou Lightbulb |
|
|
|
|
|