|
blackdragon Beginner
Joined: 07 Dec 2001 Posts: 11 Location: USA
|
Posted: Fri Dec 07, 2001 8:32 am
trigger trouble |
ive been tryin to set up this trigger so when certain people(lets say friends) want to use my spells they can... ive seen this done once... ive been trying to set it up so charicter says 'add me'. and it will add them to my triggers... and they can then use my spell trigger which is char. says 'ky(spellname)'. .... this way only if they say add me. can they access triggers... my zmud would ignore you unless you did that first. heres what i been workin on... for bout 5 hrs now.. no luck...
patter: %1 says 'add me'.
command : #class (%w) {enable}
#trigger {%1 says 'ky%2'.} {c '%2' 1}
seems to work as in adding them to the class and enableing it... but when it goes to cast the spell i get c '' person.... much help is needed id love to be able to do these things... hard to grasp though. thanks
Bd |
|
|
|
undergod Wanderer
Joined: 27 Jun 2001 Posts: 82
|
Posted: Fri Dec 07, 2001 8:45 am |
What you need to do is set up a variable. Something like "friends" so that
#TR {(%w) says 'add me'} {dunno syntax here}
and then
#tr {{@friend} says 'ky(%w)'} {c %1}
one of the gurus will have to help you with exact syntax, hehe :) |
|
|
|
Castaway GURU
Joined: 10 Oct 2000 Posts: 793 Location: Swindon, England
|
Posted: Fri Dec 07, 2001 8:55 am |
#TR {(%w) says 'add me'} {#ADDITEM friends "%1"}
#tr {{@friends} says 'ky(%w)'} {c %1}
Is what you meant..
*throws the help file at undergod :)))*
Lady C. |
|
|
|
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: Fri Dec 07, 2001 9:03 am |
In zMUD, we do not use %1, %2, %3, etc, in the pattern. Yeah, it'll work sometimes, but it's bad form and ignores some of the spiffy pattern matching features that are available. Use the pattern matching symbols in the pattern; use the numbered parameters (%1 through %99) in the command/value portion.
Also, any information in a pattern that you want to capture must be enclosed in parentheses.
As Undergod suggests, it is common to create a string list of friends and compare against it for subsequent botting. Adding to a string list is accomplished with the #ADDITEM command.
#TR {(%w) says 'add me'.} {#ADDITEM Friends %1}
#TR {({@Friends}) says 'ky(*)'.} {cast '%2' %1}
In the first trigger, when someone says add me, they are added to your friends list. In the second trigger the ({@Friends}) is expanded to match any one item in the friends list. The parentheses serve to capture it and store it to %1. The (*) will capture the spellname and store it to %2.
If you wish to turn on and off the class which contains these triggers, use the #T+ and #T- commands.
Troubadour |
|
|
|
blackdragon Beginner
Joined: 07 Dec 2001 Posts: 11 Location: USA
|
Posted: Fri Dec 07, 2001 9:03 am |
k i wanted to add before too many people wacked at this and i wasted their time.. i dont have any certain friends... is there a way to get it to clear after i logg out of zmud.. what it is is the mud i play allows you to bot... so my cleric i drag along from time to time to heal/sanc whatnot... and i group with diff people from time to time... then you have the arses... who like to come along and just use yer triggers cuz they can.. this is what im tryin to stop by the add me feature... but i want it to clear when i leave the game... thanks sorry i wasnt so clear... my fault
Bd |
|
|
|
blackdragon Beginner
Joined: 07 Dec 2001 Posts: 11 Location: USA
|
Posted: Fri Dec 07, 2001 9:06 am |
on a side note what you gave me works greatly thanks for all the help... im learnin.. little by little you guys rock...
Bd |
|
|
|
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: Fri Dec 07, 2001 9:13 am |
Instead of having your friends say 'add me' you might have them say a secret word and put that word in your trigger.
To clear the friends list at disconnect, put this line in the atdisconnect alias in your System class:
#VAR Friends ""
Troubadour |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Dec 07, 2001 6:37 pm |
quote: Instead of having your friends say 'add me' you might have them say a secret word and put that word in your trigger.
It's not going to stay secret very long if you have people saying it. Use a tell instead.
LightBulb |
|
|
|
blackdragon Beginner
Joined: 07 Dec 2001 Posts: 11 Location: USA
|
Posted: Fri Dec 07, 2001 11:18 pm |
k hate to start this again but... it worked great last night... long as i only had 1 friend in the list.. .when it put more into the list it started casting example...
c 'sanc' mak|arnun|kyrin
just to restate what i got goin
#tr {(%w) says 'add me'} {#ADDITEM friends "%1"}
which works great.....
#tr {{@friends} says 'ky(%w)'} {cast '%2' %1}
this second one didnt work. the problem is starting on the command part of the trigger... this setup here whey person says
'kysanc'. it tries to cast '' sanc....
i also tried the other trigger suggested for this part it was.... #tr {{@friends} says 'ky(%w)'} {c %1}
this worked some... example person says 'kysanc'. ... you got ... c 'sanc' with no person indicated....
i tryed messign a little and changed the command line to c '%1' @friends.... which worked long as i only had 1 person in the friends variable... so i guess the question is how to make it extract the friends name that is saying 'kysanc'. and cast the trigger on that name not mak|arnun|kyrin.. hope that wasnt confusing
Bd |
|
|
|
Acaila Apprentice
Joined: 30 Aug 2001 Posts: 187 Location: Netherlands
|
Posted: Fri Dec 07, 2001 11:50 pm |
Well, you could change:
#TR {{@friends} says 'ky(%w)'} {cast '%2' %1}
Into:
#TR {(%w) says 'ky(%w)'} {#IF (%ismember(%1,@Friends)) {cast '%2' %1}}
Or, like Troubadour said:
#TR {({@friends}) says 'ky(%w)'} {cast '%2' %1}
Acaila |
|
|
|
blackdragon Beginner
Joined: 07 Dec 2001 Posts: 11 Location: USA
|
Posted: Sat Dec 08, 2001 12:03 am |
sheesh an error on my part... he said that once but i fer got the ( ) on @friends... thanks again.. ill read more carefully next time.
Bd |
|
|
|
|
|