Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Tips and tricks
➜ Capturing number of certain vials and sending a world.note
Capturing number of certain vials and sending a world.note
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Natasi
(79 posts) Bio
|
Date
| Sun 20 Feb 2005 03:30 AM (UTC) Amended on Sat 26 Feb 2005 09:17 PM (UTC) by Nick Gammon
|
Message
| Ok, trying to set it so when I check my vial list I receive a world.note telling me how many of each vial type I have....for example...I type POTIONLIST and I would see this...
*******************************************************************************
Id Vial Potion Sips Months
-------------------------------------------------------------------------------
9402 a sapphire vial a melancholic purgat 9 51
10969 a coral vial a sanguine purgative 30 22
11582 a ruby vial a potion of allheale 55 81
14275 a ruby vial a potion of allheale 60 81
18626 a coral vial a sanguine purgative 50 22
20883 a vial a potion of frost 5 30
61868 a ruby vial a potion of healing 60 56
Type MORE to continue reading. (97% shown)
more
3583h, 2793m, 2779e, 10p ex-
54854 a ruby vial a potion of healing 60 61
*******************************************************************************
Total Vials: 8
and I want a world.note that shows something like this, which would also catch vials I'm missing....
Healing 2
Melancholic 1
Sanguine 2
Allheale 2
Frost 1
Quicksilver 0
Mana 0 | Top |
|
Posted by
| Natasi
(79 posts) Bio
|
Date
| Reply #1 on Sun 20 Feb 2005 03:31 AM (UTC) |
Message
| hmmm, it kinda crunched those together...it' usually spaced out pretty well in the Mud | Top |
|
Posted by
| Meerclar
USA (733 posts) Bio
|
Date
| Reply #2 on Sun 20 Feb 2005 05:33 AM (UTC) Amended on Sun 20 Feb 2005 05:34 AM (UTC) by Meerclar
|
Message
| Need a [code] tag if you want to keep proper spacing, the forum is designed to strip whitespace otherwise. |
Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org | Top |
|
Posted by
| Natasi
(79 posts) Bio
|
Date
| Reply #3 on Mon 21 Feb 2005 02:35 PM (UTC) |
Message
| Ok, I rememebr working in OLC and it seemed alot like VBscript. There was a way there to set up a capture that would have a variable it would update everytime another number was added....so when it sees the first vial, it sends a 1 to the variable, when it sees the second vial, it sends another 1, which is added to the 1 already there making it a two...so a counter. you know, I just confused myself... | Top |
|
Posted by
| Ked
Russia (524 posts) Bio
|
Date
| Reply #4 on Tue 22 Feb 2005 02:36 PM (UTC) |
Message
| You'd need two triggers: one for capturing the vial info, and the second one to match on the prompt and disable both itself and the vial trigger. Place them in one group, named "PotionList" for example. Then add an alias to match on "potionlist" or whatever command you want to use for that skill. Have the potionlist alias send the following to script (if you use vbscript):
EnableTriggerGroup "PotionList", 1
Send "config pagelength 250"
Send "potionlist"
Then have the prompt trigger send to script also:
EnableTriggerGroup "PotionList", 0
Send "config pagelength 25"
EndVials
"config pagelength" commands will allow you to avoid the MORE's unless you have more than 250 vials. The following script keeps track of how many vials with each type of potion you have and how many total sips you have of each potion:
dim vails, sips
Set vials = CreateObject("Scripting.Dictionary")
Set sips = CreateObject("Scripting.Dictionary")
sub GotVial(name, output, wildcs)
dim potion_name, sips_num
potion_name = wildcs(1)
sips_num = wildcs(2)
if vials.Exists(potion_name) then
vials.Item(potion_name) = vials.Item(potion_name) + 1
else
vials.Item(potion_name) = 1
end if
if sips.Exists(potion_name) then
sips.Item(potion_name) = sips.Item(potion_name) + cint(sips_num)
else
sips.Item(potion_name) = cint(sips_num)
end if
end sub
sub EndVials
ReportVials
vials.RemoveAll
sips.RemoveAll
end sub
sub ReportVials
dim report
report = ""
for each key in vials.Keys
report = report & key & ": vials=" & vials.Item(key) & ", sips=" & sips.Item(key) & vbCRLF
next
Note report
end sub
The most import part is the trigger that matches on the lines containing the vial info. That trigger should capture exactly 2 wildcards: the first one should contain the potion name, and the second - amount of sips left. The trigger match should be something like:
"^\d+\s+[a-z]+?(melancholic|sanguine|allheale|frost|healing|mana)[a-z]*?\s+(\d{1,3})\s+\d+$"
The first parenthesized group contains all the potion names as they appear on potionlist and that will be used inside the script. I'd put this into a plugin, but as I don't have POTIONLIST yet myself, testing it would be somewhat problematic. | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
20,045 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top