[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Mprog ifcheck, check act flags
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Mprog ifcheck, check act flags

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


Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Tue 29 Mar 2005 12:44 AM (UTC)
Message
Is there a way for a prog ifcheck to check if a act flag is set on a player? Like I'd like it to be done like this:
if is_set($n) == boughtpet


This would save me a lot of time adding an ifcheck for each different flag.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Greven   Canada  (835 posts)  [Biography] bio
Date Reply #1 on Tue 29 Mar 2005 05:19 AM (UTC)
Message
There's not one that I know of, but its a fairly straight forward process to make it, loop through the names, str_cmp, stop at the right one, check that number against set flags.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #2 on Tue 29 Mar 2005 03:28 PM (UTC)
Message
Well I have the basic concept down, but what do you mean loop through the names? Act flags are EXT_BV, so you can't strcmp a BV.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Nick Cash   USA  (626 posts)  [Biography] bio
Date Reply #3 on Tue 29 Mar 2005 07:14 PM (UTC)
Message
I think he meant the name of the flag, which is then used to look up the BV. Anyways, I have one (an is_set mprog function) and it wasn't hard to make.

~Nick Cash
http://www.nick-cash.com
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio
Date Reply #4 on Mon 20 Jun 2005 09:41 PM (UTC)

Amended on Mon 20 Jun 2005 10:06 PM (UTC) by Zeno

Message
Finally got to doing it.
        if ( !str_cmp(chck, "issetact") )
        {
            int value = IS_NPC( chkchar ) ? get_actflag( rval ) : get_plrflag( rval );

            if ( value < 0 || value > MAX_BITS )
            {
                progbug("Unknown act flag being checked", mob);
                return BERR;
             }

             return xIS_SET(chkchar->act, value) ? TRUE : FALSE;
        }


Feel free to use it or let me know if anything should be changed.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] 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.


3,697 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]