Register forum user name Search FAQ

Gammon Forum

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 ➜ Plugins ➜ Druid Potion Plugin

Druid Potion Plugin

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Shadowfyr   USA  (1,790 posts)  Bio
Date Sat 10 Aug 2002 11:40 PM (UTC)
Message
There is now a plugin for Ages of Despair posted at Magnum's website:
http://www.magnumsworld.com/muds

This is version 1.00. While I think I have fixed all problems it had, there may be a few hiding in it. It works by watching while you forage and learning the herbs. The later, when you create a potion, it also adds that to its lists. By typing 'potions:' it will give you a list of all known potions it has learned and how many you can make with the herbs you are carrying. Right now, if you have given it information about a potion, but it does not yet know of the herbs used in it, the plugin will not recognize them in you inventory.

While this problem was intentional (it shouldn't know something you don't) it is also the most likely source for any existing bugs. For this reason I plan to change this, so that version 2.00 will have the herbs hard coded into the plugin. However, the current version is functional. ;)

If you anyone plans to adapt this to another mud.. Good luck. It won't be easy and will void your warrenty. ;) lol
Top

Posted by Shadowfyr   USA  (1,790 posts)  Bio
Date Reply #1 on Sun 11 Aug 2002 06:50 PM (UTC)

Amended on Sun 11 Aug 2002 06:53 PM (UTC) by Shadowfyr

Message
Hmm.. Did I mention how I use a hard coded version of this and used my Phantom program to test it... Sigh...

I am running a 'real' test on version 2 today and should have it posted soon. I hard codes some things that where making the code too complex and testing difficult. It also fixes the output from different subs, so that all of them should now use the plugins color settings and you can now set the error color (which you couldn't before).

One feature that is not likely to happen is that in my completely hard coded version, the script can keep track of potions that share common components and list the number that can be made, if you made the same number of each one. There is no easy way to do this, so unless I put out a version 3.0, it won't be available in the plugin.

Looks like a missed a few things in version 1.0. :p

Known bugs -

1. Half a dozen debug tags didn't get removed.
3. In the Calc_Potions sub the groupings should be
   4 or 5
   1 or 3 or 5
   2 or 3 or 5  <- this last one is wrong and may glitch even if fixed. :p

Which brings up another interesting problem... Seems the 'Not' operator in vbscript won't work at all. Something like:

fnd = TRUE
fnd2 = TRUE
test = not fnd and fnd2
world.note test

will produce -2, when it should be FALSE. It also produces -2 if both conditions are TRUE. :p

To fix it you can use:

fnd = TRUE
test = (abs(fnd) xor 1) and fnd2
world.note test

This has essencially the same effect as 'Not' was supposed to have, however it likely wouldn't work if fnd is anything other than 0, 1 or -1.

If anyone can figure out why 'Not' won't work, please tell me.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #2 on Sun 11 Aug 2002 09:34 PM (UTC)
Message
Quote:

fnd = TRUE
fnd2 = TRUE
test = not fnd and fnd2
world.note test

will produce -2, when it should be FALSE. It also produces -2 if both conditions are TRUE. :p


First, both conditions *are* true, second I cannot reproduce that.

This script in the immediate window prints "0":

dim fnd, fnd2, test
fnd = TRUE
fnd2 = TRUE
test = not fnd and fnd2
world.note test


Your problem - whatever it is exactly - might be operator precedence. Do you mean:

test = not (fnd and fnd2)

or

test = (not fnd) and fnd2

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Shadowfyr   USA  (1,790 posts)  Bio
Date Reply #3 on Sun 11 Aug 2002 10:06 PM (UTC)
Message
test = (not fnd) and fnd2

It just does not work. It seems to be treating not as a variable instead. Or maybe because the values where integer instead of simply TRUE and FALSE. Sigh.. I just couldn't seem to find any way to get it to work.

Biggest problem with vbscript is since everything is type Variant, vbscript commands need to constantly guess whether you are looking at a value, true/false, string, etc. and half the time it gets it wrong. In the case of not my problem was that the value being checked was from an InStr command. I had to change that to set a variable to 0 or 1. So (if fnd) when fnd = 6 will be TRUE, but (not fnd) bugs and returns -2. Worse.. my fix of using (fnd xor 1) would return 6. :p

It is a major pain in the rear.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #4 on Sun 11 Aug 2002 10:26 PM (UTC)
Message
test = (not CBool (fnd)) and CBool (fnd2)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Shadowfyr   USA  (1,790 posts)  Bio
Date Reply #5 on Sun 11 Aug 2002 10:51 PM (UTC)
Message
Oh... Duh. Of course it would be something obvious like that. lol

Of course now I don't need it... But thanks. ;)
Top

Posted by Magnum   Canada  (580 posts)  Bio
Date Reply #6 on Mon 12 Aug 2002 12:12 AM (UTC)
Message
Could you use the functions "World.Base64Encode" and "World.Base64Decode" to hide certain data within the plugin? (The data that would provide illegal info sharing according to mud law).

It might be easier to use such functions rather than build a complex, self learning script.

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #7 on Mon 12 Aug 2002 02:21 AM (UTC)
Message
You could use them but it would only be a rudimentary form of data hiding. Anyone could use the built-in notepad to get the data back.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


22,015 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.