|
daemoan Beginner
Joined: 04 Feb 2008 Posts: 23
|
Posted: Mon Feb 04, 2008 5:05 am
Seting Up With Multiple Parameters (Help Plz) |
The Mud Iam Playing Has Globs of EQuipment you have to cycle thru......
now I was trying to set up a bot and trigger system to automatically select high grade items and put em in my bag.....
Iam not sure if this is even close to what Iam trying to do...
Heres a Example Item,
Your eyes glow bright yellow for a moment.
Object 'helm rare Rune Mask' is type armor, extra flags none.
Weight is 6, value is 0, level is 0.
Armor class is 28.
Affects move by 500.
Affects strength by 5.
Affects intelligence by 5.
Affects wisdom by 5.
Affects dexterity by 5.
Affects constitution by 5.
Affects agility by 25.
This item has 150 points of magical resistance.
this is the trigger I made useing help files....
Pattern: Affects ~(agility, constitution, dexterity, wisdom, intelligence, strength) by [25-35]
Value: #IF {Affects (agility, constitution, dexterity, wisdom, intelligence, strength) by ~[25-35] (put @item bag;c id rare) drop @item;c id rare}
now what this is suppose to do is.... reconize each of the affect lines and if any of them are 25-35 it should put it in the bag otherwise drop it
and move to next item
in addition to these IAm useing "item" variable
I know some of my sytax is wrong........ because I dont know what Iam doing really....
Ive tried different this with the range.... %d etc....... maybe useing %if in there somewhere.... I dunno...
Note: That The Zmud Syntax Checker said it was correct to some extent.... I just think Iam using the wrong function or sumtin
also, I was wandering if someone could explain the &varname thing and explain wildcards in a noobs language... ive weaved in and out of help and see relations between the stuff Iam looking for.... sometimes...
I would appreciate the help
DaeMoan Vermillious the Alpha Dog |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Feb 04, 2008 11:18 am |
The list of wildcards is here. They each mean different things, but basically, they match a range of possible characters. If you put the charater 6 in the pattern, it'll only match the character 6. But if you put %d in the pattern, it'll match any number.
You're correct, your syntax is wrong. The proper way to put more than one possible item in your trigger is with {itemone|itemtwo}. There's no way to check if a number is between two values in a pattern, so you need to do it later in your script.
So you use a pattern like this:
Affects {agility|constitution|dexterity|wisdom|intelligence|strength} by (%d)
The brackets around %d mean that the number it matched will be available to the script. You access values from the pattern by using the variables %1, %2 etc - they're numbered based on their position in the pattern. Since there's only one set of brackets in the pattern, you use %1 to get the value the pattern matched.
You want to keep the item if its stat (the value of %1) is between 25 and 35. So you do:
#if (%1 > 25 AND %1 < 35) {put @item bag} {drop @item}
This means that if %1 is more than 25 and less than 35, it'll be put in your bag. If not, it'll be dropped. Then you add the "c id rare" command to the end, and you're done. Your final trigger will look something like this:
#trig {Affects {agility|constitution|dexterity|wisdom|intelligence|strength} by (%d)} {#if (%1 > 25 AND %1 < 35) {put @item bag} {drop @item};c id rare} |
|
|
|
daemoan Beginner
Joined: 04 Feb 2008 Posts: 23
|
Posted: Mon Feb 04, 2008 6:27 pm Almost Operational |
Pattern:
Affects {agility|constitution|dexterity|wisdom|intelligence|strength} by (%d)
Value:
#if (%1 < 25 AND %1 > 35) {put @item bag; c id rare} {drop @item;c id rare}
NOTE: I tryied switching the > < the other way around......
This Is the Outcome of the trigger
<[0] [1010000H 1008068M 1010000V]> Your eyes glow bright yellow for a moment.
Object 'plate fullplate rare Pain Suit armor' is type armor, extra flags none.
Weight is 20, value is 0, level is 40.
Armor class is 225.
Affects strength by 25.
put bag
c id rare
Affects intelligence by 15.
put bag
c id rare
Affects wisdom by 5.
put bag
c id rare
Affects dexterity by 5.
put bag
c id rare
Affects constitution by 5.
put bag
c id rare
Affects agility by 5.
put bag
c id rare
This item has 150 points of magical resistance.
<[0] [1010000H 1007792M 1010000V]> Put what in what?
I need it to run a check for all affect but only put the 25-35 peices into a bag.....
ass you can see it triggerd on everyone including the 5 |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Mon Feb 04, 2008 6:45 pm |
This is inclusive of course. For exclusive then take out the = signs.
Code: |
#if ((%1 >= 25) AND (%1 <= 35)) {
put @item bag
c id rare
} {
drop @item
c id rare
} |
Also keep in mind that the item variable is supposed to have the item name in it. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
daemoan Beginner
Joined: 04 Feb 2008 Posts: 23
|
Posted: Mon Feb 04, 2008 7:29 pm |
Ok now the questions is how to turn it off on the first check and how to turn it on after the c id rare?
|
|
|
|
daemoan Beginner
Joined: 04 Feb 2008 Posts: 23
|
Posted: Mon Feb 04, 2008 8:13 pm |
how would you write a multi trigger variable system to disable a drop command until the check was finshed
Example of my trigger right now and what it does:
#if ((%1 >= 25) AND (%1 <= 35)) {
put @item bag
c id rare
} {
drop @item
c id rare
}
Result:
Your eyes glow bright yellow for a moment.
Object 'ringmail sleeves rare Wraith Arms armor' is type armor, extra flags none.
Weight is 10, value is 0, level is 20.
Armor class is 77.
This item is inset with a powerful jewel.
Affects strength by 35.
put bag
c id rare
Affects intelligence by 5.
drop
c id rare
Affects wisdom by 5.
drop
c id rare
Affects dexterity by 5.
drop
c id rare
Affects constitution by 5.
drop
c id rare
Affects agility by 15.
drop
c id rare
This item has 100 points of magical resistance. |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Mon Feb 04, 2008 9:36 pm |
On the first line of the description before the attributes are listed set a drop variable to true.
DropItem=1
Then
#if ((%1 >= 25) AND (%1 <= 35)) {
dropitem=0
}
For each attribute.
Then on the next prompt or after the last line of the probe
#if (dropitem=1) { drop @item
c id rare} { put @item bag
c id rare } |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
daemoan Beginner
Joined: 04 Feb 2008 Posts: 23
|
Posted: Mon Feb 04, 2008 10:18 pm |
ok then one more then thats it thats all
i made a trigger to a variable to pull the @item name to the bag
the trigger variable needs only to be @item not the whole line how to i assign a variable to stop after the word and at the space?
Object '(ringmail) sleeves rare Wraith Arms armor' is type armor, extra flags none.
Weight is 10, value is 0, level is 20.
Armor class is 77.
This item is inset with a powerful jewel.
Affects strength by 35.
put (ringmail sleeves rare Wraith Arms armor' is type armor, extra flags none.) bag
c id rare
Affects intelligence by 5.
Affects wisdom by 5.
Affects dexterity by 5.
Affects constitution by 5.
Affects agility by 15.
This item has 100 points of magical resistance. |
|
|
|
daemoan Beginner
Joined: 04 Feb 2008 Posts: 23
|
Posted: Mon Feb 04, 2008 10:41 pm |
ok your Equation doesnt work if strength or attributes dont exist...
How do i go about making a switch to drop it if it doesnt trigger anything at all? |
|
|
|
Leitia Adept
Joined: 04 May 2007 Posts: 292 Location: Boston
|
Posted: Tue Feb 05, 2008 3:14 am |
if you enclose the string list in parenthesis and #var badstuff %1 then update the %1 you have to %2 you can #if (%1) providing you unvar the thing at the end. sorry, distracted, don't get why strength is not triggering
apologies, wasn't thinking too deeply, let me look closely |
|
|
|
daemoan Beginner
Joined: 04 Feb 2008 Posts: 23
|
Posted: Tue Feb 05, 2008 6:45 am Update!!! |
I've had to settle for using this formula, because it it the only one that will trigger properly.... (Primary Just Focusing On Strength Items.)
Example: Product
Your eyes glow bright yellow for a moment.
Object 'helm rare Rune Mask' is type armor, extra flags none.
Weight is 6, value is 0, level is 0.
Armor class is 28.
Affects move by 500.
Affects strength by 25.
Affects intelligence by 5.
Affects wisdom by 5.
Affects dexterity by 5.
Affects constitution by 5.
Affects agility by 5.
This item has 150 points of magical resistance.
Trigger1:
-----------
Pattern:
Affects strength by (%d).
Value:
#if ((%1 >= 25) OR (%1 = 35)) {
put @item bag
c id rare
} {
drop @item
c id rare
}
Trigger2:
-----------
Pattern:
Object '%1 %2 %3 %4 %5'
Value:
#var Item %1
Now, However it does great work, if it comes to a piece that does not have the strength attribute on it, it stops... now when it stops I can easily just "drop rare;c id rare"
but is there something that I can add that will either reconize that I don't want it if theres no strength, or is tehre anoother #if I can add like this but I know this is not it...
Pattern:
Affects strength by (%d).
Value:
#if (Affects (strength=false)) {drop rare} <--------------- I know thats not right because it don't work worth a damn......
#if ((%1 >= 25) OR (%1 = 35)) {
put @item bag
c id rare
} {
drop @item
c id rare
}
Maybe A whole nother trigger that states when str is no present to drop....
Hopfuly Ive provided enough info for you to understand..... any help from anyone is welcome...
Thanks...
DaeMoan VerMillious
The Alpha Dog |
|
|
|
luggage Novice
Joined: 20 Jul 2004 Posts: 38 Location: Australia
|
Posted: Tue Feb 05, 2008 8:34 am |
put (ringmail sleeves rare Wraith Arms armor' is type armor, extra flags none.) bag
the trigger variable needs only to be @item not the whole line how to i assign a variable to stop after the word and at the space?
If you use something like:
#TRIGGER {^Object '(%w)} {#VAR Item %1}
it should work. The carat (^) forces it to only trigger at the start of a line, then the %w just grabs a single word (letters a-z). Enclosing the %w in braces means that you want to keep that word, and use it later on in the second part of the trigger.
Check out the list of wildcards that Fang Xianfu mentioned in his post, they are used to create more accurate triggers of what information you want to extract from a line.
You could also add the line setting the drop variable to true in this trigger, then use Arminas' example to trigger on each 'Affects <stat> by', and finally (if every item has magical resistance), trigger on the line of magic resistance to either drop the item or put it in your bag. If this magic resistance line doesn't always appear, you will have to trigger on your next prompt. |
|
|
|
daemoan Beginner
Joined: 04 Feb 2008 Posts: 23
|
Posted: Tue Feb 05, 2008 8:28 pm Update Question |
Can I do something like
#if (strength = false) {#line 2,3,4,5,6) {drop @item} |
|
|
|
luggage Novice
Joined: 20 Jul 2004 Posts: 38 Location: Australia
|
Posted: Wed Feb 06, 2008 6:03 am |
>Can I do something like
>#if (strength = false) {#line 2,3,4,5,6) {drop @item}
If the pattern is 'Affects strength by (%d).', it will only trigger if the item affects strength. If the item does not affect strength, the trigger will not fire at all. Also, Zmud does not know what 'strength' is, normally a variable is used to check against in an IF statement.
Try using these 3 triggers first ... they should work given the examples you have provided so far.
#TRIGGER {^Object '(%w)} {#VAR Item %1;#VAR dropitem 1}
#TRIGGER {Affects {agility|constitution|dexterity|wisdom|intelligence|strength} by (%d)} {#if (%1 >= 25 AND %1 =< 35) {#VAR dropitem 0}}
#TRIGGER {This item has %d points of magical resistance.} {#if (@dropitem=1) {drop @Item} {put @Item bag};c id rare}
The first one triggers on the start of the id, pulls out the first word to use as a name, and sets it to drop the item.
The second trigger will fire on any stat increase, and if the increase is in the range 25 to 35, sets it to keep the item.
The last trigger fires at the end of the object info, and either keeps or drops the item, then casts the spell again. |
|
|
|
daemoan Beginner
Joined: 04 Feb 2008 Posts: 23
|
Posted: Wed Feb 06, 2008 7:17 am Update |
Looks great but my problem is that Magical Resistance is not always a constant there.....
Unfortunetly the muds Equipment systems is largly Vast... and 20 minutes of ATming is easily 150 Items needed to cycle thru.....
A person could easily gothru 25000 items in a days grind..... its just so tideous |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Wed Feb 06, 2008 2:15 pm |
But you DO have a prompt don't you?
|
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
daemoan Beginner
Joined: 04 Feb 2008 Posts: 23
|
Posted: Thu Feb 07, 2008 7:46 am Update!!! |
So with accordance with you post before last if this is my prompt
<[0] [1112500H 1112500M 1147500V]>
with numbers higher or lower..... cause there ever increaseing stats...
how would I trigger that into it..
and are you sure that, the trigger with str con dex agi etc... will not activate indiviudally?
that was my problem before with that equation.....
also I want to be able to really be able to activate it on command to start cycleing so maybe it disables the class? when done and start/activate on command |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Thu Feb 07, 2008 2:29 pm Give this a try |
Code: |
#TRIGGER {^Object '(%w)} {#VAR Item %1;#VAR dropitem 1;#T+ ItemPrompt}
#TRIGGER {Affects {agility|constitution|dexterity|wisdom|intelligence|strength} by (%d)} {#if (%1 >= 25 AND %1 =< 35) {#VAR dropitem 0}}
#TRIGGER "ItemPrompt" {~<~[%d~]%s~[%dH%s%dM%s%dV~]~>} {#if (@dropitem=1) {drop @Item} {put @Item bag};c id rare;#T- ItemPrompt} |
|
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
daemoan Beginner
Joined: 04 Feb 2008 Posts: 23
|
Posted: Fri Feb 08, 2008 4:47 am |
ok little problem everytime the prompt come up on screen
the itemprompt goes off and fires the last trigger
how do i tweek to only read in the trigger command sequince |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Fri Feb 08, 2008 5:36 am |
I'm not sure what you mean... It should be turning itself off once it is done firing.
Does thee c id rare command cause probing? |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
daemoan Beginner
Joined: 04 Feb 2008 Posts: 23
|
Posted: Fri Feb 08, 2008 8:30 am |
I Have It Working Great!!!!!!!!
Iam Sure This Will help Other People With There Problems Too!!!!
Special Thanks To
Arminas & Luggage
Since Fully Automated Is Illegal on my mud I reserve the right to not incriminate my self and will not be posting the automated code... you can recieve that via Personal Message....
but here is most of it!!!!!
#CLASS {Identify}
#ALIAS Activate {#class identify 1}
#ALIAS Deactivate {#class identify 0}
#VAR Item {studded}
#VAR dropitem {1}
#TRIGGER {^Object '(%w)} {
#VAR Item %1
#VAR dropitem 1
#T+ ItemPrompt
TickID1
}
#TRIGGER {You are not carrying that.} {
#ti 1
TickID2
}
#TRIGGER {Affects {agility|constitution|dexterity|wisdom|intelligence|strength} by (%d)} {#if ((%1 >= 25) OR (%1 = 35)) {#VAR dropitem 0}}
#TRIGGER "ItemPrompt" {~<~[%d~]%s~[%dH%s%dM%s%dV~]~>} {
#if (@dropitem=1) {
drop rare
sac rare
} {put @Item bag}
#T- ItemPrompt
c id rare
} "" {disable}
#CLASS 0
Yours Truley
DaeMoan Vermillious |
|
|
|
|
|