Unknown2006-08-27 03:47:58
Okay. I'm switching clients (again. I know, don't shoot me) from ALC to MUSH. I've read through some of MUSH's help files, and I notice that the programmers make themselves seem smarter by using overly huge words... could someone either tell me how to get started with making my own system (cause Ethelon's is too outdated) and make the basic triggers, variables, timers, alias', all that good stuff. Please? You'll be like... a God to some people!
Unknown2006-08-27 15:34:40
QUOTE(Ysuran @ Aug 27 2006, 04:47 AM) 324650
could someone either tell me how to get started with making my own system (cause Ethelon's is too outdated)
You know, I've never understood that attitude. Outdated is better than starting from scratch, even if only because you don't have to create over a thousand triggers yourself. Download Ethelon's and study it. It's a pretty good model of the approach and syntax you'll need if you're planning on working in VBscript. I answered some basic questions, especially about gagging and echoing, in this thread:
http://lusternia.ire-community.com/index.php?showtopic=8666
Triggers
Go to Game > Configure > Triggers. Click Add... Enter the text you want to match in the Trigger: box. Use * as a wildcard if you're not sure of a portion of the text. For instance, if something could read "PersonX stands up and stretches his/her arms wide", you can match that most easily with: "* stands up and stretches * arms wide." (That's not how I recommend doing it, by the way. Just an example.)
Enter what you want the trigger to do in the Send: box. If you select Send to: World from that drop down list, then you can put Lusternia commands in the Send: box. If you select Send to: Script, you can put in script commands (stuff like setting variables, making echoes, setting timers), but no raw Lusternia commands. (You'd have to enter those like this: send "sip choleric") If you select Send to: Execute, you can put Lusternia commands and aliases in the Send box.
Check "Omit from output" if you want to gag the text you've just matched. (It'll omit the whole line even if it matched only a bit of it. This will also omit any echoes for that line!). Check "Keep evaluating" if you have multiple triggers that match on the same pattern. Check "Expand variables" if you use variables with an @ either in the pattern to match or in the commands to send. If you need more advanced wildcard options, to match a more complicated bit of text precisely, or to capture some part of the text as a variable, check "Regular expression", and read here for how to use those:
http://lusternia.ire-community.com/index.php?showtopic=9730
You'll also need regular expressions if you choose the "Multiline" option.
The Sequence number dictates in what order triggers get evaluated. For instance, I have the following triggers. First trigger matches "Sticky strands of webbing spray out from (.*?) to cover you." Sequence number 50. Second trigger is multiline and matches: "^Sticky strands of webbing spray out from (.*?) to cover you\\.^The webbing around you disintegrates into ash." Sequence number 40, and I don't have "Keep evaluating" checked. Because the second trigger evaluates earlier in sequence, it blocks the evaluation of the first trigger - so I don't try to writhe when I know the webbing doesn't stick. Default is 100.
If you want to colour, bold, underline text, do that from the "Change colour and style to:" box. You can also make triggers match only on text of a certain colour, from the "Match:" boxes. That can keep your affliction triggers from firing on things in tells, says, on channels...
The Label field is for the name of a single trigger (can't have two with the same label), and Group is for... a group of triggers. This is useful because you can sort triggers by group and turn triggers on and off as a group with the enabletriggergroup script function.
Aliases
Go to Game > Configure > Aliases... and click Add. The dialog box has much the same features as the one for triggers. In the Alias: field you enter the pattern the alias matches on, and you can have multiple aliases that match on the same pattern, if you check "Keep evaluating".
Variables
You'll usually make these with aliases or triggers. Take for instance a target variable. You make an alias that matches x *, set it to Send to: Script, and enter this in the Send field: setvariable "target", "%1". When you type x weevil, "weevil" gets stored in the variable "target". Now you can make an alias ff that Sends to: World the following: point cudgel @target. If you've checked "Expand variables", @target will be replaced with "weevil".
Or you can make a trigger that matches on: "Your mind wanders as you dream of riches and fame." and have it Send to: Script the following: setvariable "affliction_daydreaming", "1".
You can also use things you've matched in triggers. For instance, I've got a trigger that matches "@target begins to tumble towards the (\\w+)\\." and does this: colournote "red", "black", "TUMBLE - %1" . %1 refers to the first pattern that got matched by a wildcard. If I had a trigger with this pattern: "* whispers your name under * breath as * chants", and it matched on this: "Nirrti whispers your name under her breath as she chants", "Nirrti" would be stored as %1, "her" would be stored as %2, and "she" would be stored as %3. You can only use this information in that trigger, though, so if you want to store it more permanently, you would do something like: setvariable "target", "%1" . That makes a named variable.
To retrieve a named variable, you use getvariable. For instance:
if getvariable ("affliction_stupidity") = 1 then
send "outr pennyroyal"
send "eat pennyroyal"
end if
I know the help files are... unhelpful, but you need to try to work through them yourself and pose specific questions. And try not to give orders to people in the thread subheading?
Unknown2006-08-27 16:20:11
THANK YOU.
Alright, right now I'm trying to set up some triggers that will allow me to automatically pick up corpses while bashing. Right now I have it set to:
You have slain a *.
get %1
The problem, of course, is that I can't pick up a corpse until after I've regained balance. How would I set up a variable to track my balance and equilibrium status, and then apply it to triggers? And I guess for herb/potion/ect. balance as well.
Alright, right now I'm trying to set up some triggers that will allow me to automatically pick up corpses while bashing. Right now I have it set to:
You have slain a *.
get %1
The problem, of course, is that I can't pick up a corpse until after I've regained balance. How would I set up a variable to track my balance and equilibrium status, and then apply it to triggers? And I guess for herb/potion/ect. balance as well.
Minerva2006-08-27 16:24:04
Find the message that tells you you have gotten your equilibirum or balance back or both and put that into the trigger I dont know how to put both in without conflicting but its a start.
Unknown2006-08-27 16:31:59
QUOTE(Minerva @ Aug 27 2006, 04:24 PM) 324760
Find the message that tells you you have gotten your equilibirum or balance back or both and put that into the trigger I dont know how to put both in without conflicting but its a start.
That would cause the 'get whatever' command to fire every time I regained my balance or equilibrium.
Taika2006-08-27 16:34:37
The idea is when you get a "YOU HAVE SLAIN %1" set variable KILLED to %1.
Trigger "You have regained" (for bal or EQ) to do IF @killed != "" then do GET @killed, set killed to "".
That make any sense? I'll put in the real syntax (for lua) in a moment.
Trigger "You have regained" (for bal or EQ) to do IF @killed != "" then do GET @killed, set killed to "".
That make any sense? I'll put in the real syntax (for lua) in a moment.
Minerva2006-08-27 16:35:29
ohh yea now I remember make a trigger that is a balance keeper then in the get corpse set if =1 get corpse if =0 wait till it =1
Unknown2006-08-27 16:36:41
Does MUSH have a wait command? If so, I'd measure how long it takes for you to get balance back, wait for that long after you've slain something, and then get the corpse.
EDIT: Do'h, ninja'd.
EDIT: Do'h, ninja'd.
Taika2006-08-27 16:43:58
TRIGGER: You have slain (*)
SetVariable ("killed", "%1")
SEND TO SCRIPT
TRIGGER: You have recovered
if @killed~=500 then SendPush ("get @killed") end
SetVariable ("killed","")
SEND TO SCRIPT, Check the EXPAND VARIABLES box.
I didn't test this, and I dont use Mush a lot, so if it doesnt work tell me what it says and I'll look into it.
SetVariable ("killed", "%1")
SEND TO SCRIPT
TRIGGER: You have recovered
if @killed~=500 then SendPush ("get @killed") end
SetVariable ("killed","")
SEND TO SCRIPT, Check the EXPAND VARIABLES box.
I didn't test this, and I dont use Mush a lot, so if it doesnt work tell me what it says and I'll look into it.
Unknown2006-08-27 16:53:40
That's not going to work, because the slain message will be something like "You have slain a grumpy badger", and you want to "get badger", not "get a grumpy badger". What you want to get is whatever's stored in your target variable. So:
TRIGGER: You have slain
SetVariable "pickup", "1"
SEND TO SCRIPT
TRIGGER: You have recovered
if getvariable ("pickup") = "1" then
send "get @target"
setvariable "pickup", "0"
end if
SEND TO SCRIPT, Check the EXPAND VARIABLES box.
TRIGGER: You have slain
SetVariable "pickup", "1"
SEND TO SCRIPT
TRIGGER: You have recovered
if getvariable ("pickup") = "1" then
send "get @target"
setvariable "pickup", "0"
end if
SEND TO SCRIPT, Check the EXPAND VARIABLES box.
Taika2006-08-27 17:00:45
No, actually it would work. I had this on ZMUD and it worked fine with "Get a grumpy badger"
In one case of a named mob (I forget who) it didnt work but everything else did.
That would also work, though, up to you.
In one case of a named mob (I forget who) it didnt work but everything else did.
That would also work, though, up to you.
Unknown2006-08-27 17:13:35
Yes, it works for all but named mobs, but thanks! Starting to understand this a bit.
Unknown2006-08-27 17:15:56
QUOTE(Temporary_Guido @ Aug 27 2006, 05:20 PM) 324759
How would I set up a variable to track my balance and equilibrium status, and then apply it to triggers? And I guess for herb/potion/ect. balance as well.
You can track eq and balance off the prompt. You'll want a nice regular expression to capture your prompt, something like this: ^(\\d+)h\\, (\\d+)m\\, (\\d+)e\\, (\\d+)p.* (*)\\- That'll match any prompt that starts with HMEP (you can have willpower and/or endurance in there too, so long as it comes after the power) and store information to five wildcards:
%1 - current health
%2 - current mana
%3 - current ego
%4 - current power
%5 - the string that indicates if you have eq/balance/kafe/blindness/deafness.
EDIT: Left something out of the prompt pattern above that would make it Not Work a lot of the time. Fixed now.
Then, this little snippet of code will check for eq and balance:
if instr("%5", "e") then
setvariable "eqcheck", "1"
else
setvariable "eqcheck", "0"
end if
if instr("%5", "x") then
setvariable "balcheck", "1"
else
setvariable "balcheck", "0"
end if
See: http://lusternia.ire-community.com/index.p...st&p=278408 for more things you can check off your prompt.
As for herb/potion/etc... balance, the easy part is setting it when you regain it. Just trigger things like "You may eat another herb." to setvariable "herbbalance", "0" Losing balance is trickier. The easiest thing you can do is, whenever you send a command to take a particular cure, set the balance for that cure to 0. So:
if getvariable ("affliction_stupidity") then
send "outr pennyroyal"
send "eat pennyroyal"
setvariable "herbbalance", "1"
end if
Of course, if you flag losing a balance when it hasn't actually happened (you send the command, but it gets messed up by stupidity/amnesia/aeon/sap, or else someone illusions it), you'll never see the balance regain message, so your system will keep on thinking you don't have that balance... indefinitely. That's where timers and various failsafes come in. Or at least a reset alias.
Unknown2006-08-27 17:29:24
A better method: Have the variable used in picking up the corpse be the same variable used as your targetting alias. So, if you were targetting cows, it would pick up cows after you killed one. and that would make sure it was picking up whatever you were targetting, and would have nothing to do with whatever odd name it might have to screw with your wildcard.