|
Oogabooga Newbie
Joined: 27 Sep 2011 Posts: 5
|
Posted: Tue Sep 27, 2011 11:48 am
prompt trigger/autosipper |
I am completely new to Cmud, and honestly have no idea which expressions/wildcards and whatnot to use. But I am trying to make an autosipper for a prompt that looks like this:
5800h, 4500m, 4800e, 10p, 26400en, 20400w elrxd-
I'd like it to sip health when it hits below 90% maxhealth and the same with mana.... I know there is a way to do this but I am completely stumped...
Can anyone point me in the right direction? Or tell me which help file I should be looking under?
Thanks so much in advance! |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
|
_________________ Taz :) |
|
|
|
Stowslee Wanderer
Joined: 20 Apr 2008 Posts: 69 Location: Watervliet, NY
|
Posted: Fri Sep 30, 2011 10:53 am |
The first thing you want to do is create a trigger based off that prompt. Considering that your prompt is going to change as your health, mana, etc.. change you are going to need to use wildcards.
So your trigger should end up looking something like this:
Code: |
(%d)h, (%d)m, (%d)e, (%d)p, (%d)en, (%d)w *-
|
The %d in place of each of the numbers tells the trigger to look for ANY number. Then the () around each tells the system to store that information. As I assume the elrxd changes based on certain aspects of the game I used the * wildcard with accepts any characters (numbers, whitespace, etc...)
Once done with your trigger you need to tell that trigger what to do with the information it just stored. In order to do that you want to utilize variables. So the script section of your trigger will look like this:
Code: |
#var MyHealth %1
#var MyMana %2
#var MyEnergy %3
|
I am unsure as to what each number stands for but you should get the idea as to how to identify your variables. The first line tells the script to assign the value of the first stored wildcard {The 1st (%d) in this case} to the variable called MyHealth. You can do this for as many of those values you want, and store the information in the same manner.
The final part is the actual execution of what you want the script to do. So after you are done declaring your variables above, you want to tell the script to call an alias:
Code: |
#var MyHealth %1
#var MyMana %2
#var MyEnergy %3
AutoSip
|
The last line that was added there is the alias, it tells the script that after it assigns the variables you want it to perform the actions listed in the AutoSip alias. Create the alias (Named Auto-Sip) and then your actual script inside should look like this. (I don't know the equation to convert to percent so I went with a specific health level)
Code: |
#if (@MyHealth < 5000) {Sip Health}
#if (@MyMana < 4000) {Sip Mana}
|
What this does is each time your prompt runs it will check and see IF the value of the variable MyHealth is less than 5000. If so it will send the command Sip Health to the MUD (change this to whatever it is your game requires). It does the same thing for the variable MyMana.
I know its a bit long winded, and might not be the prettiest way. But essentially that is how I handle my auto-sipper. If you have any questions let me know.[/quote] |
|
|
|
Stowslee Wanderer
Joined: 20 Apr 2008 Posts: 69 Location: Watervliet, NY
|
Posted: Fri Sep 30, 2011 10:53 am |
-Double Posted-
|
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|