[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]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  mapper: remove echo for certain UID's
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

mapper: remove echo for certain UID's

You need to log onto the forum to reply or create new threads.

  [Refresh] Refresh page


Posted by Magellan   (10 posts)  [Biography] bio
Date Mon 27 Nov 2017 03:35 AM (UTC)
Message
not sure if i am using the correct terminology so if i use some vocabulary that is wrong i apologize in advance. I'm pretty novice at LUA so this is all a bit overwhelming. I'm working inside the mapper plugin trying to remove the line that would look like this:



Room -99 name updated



again, specifically any number that is -1 through -99.

i appreciate the insight.

the code i believe that sends it to the mud is this:



  if (config2.show_database_mods) then
    mapper.mapprint("Room", uid, "name updated")
  end



i was thinking trying to wrap an exception in an if check to verify if the UID was -1 to-99 but don't want to break the whole thing. the mapprint is analog to a Note so my attempt to just gag it failed and I want to keep the utility of it alerting me to any other kind of room being added. the negative numbers in this mud are not mappable so it's just unnecessary spam which causes issues with VI players.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Mon 27 Nov 2017 06:01 AM (UTC)
Message
I would suggest:


  if config2.show_database_mods and
     (tonumber (uid) > -1 or 
      tonumber (uid) < -99 or
      tonumber (uid) == nil) then
    mapper.mapprint("Room", uid, "name updated")
  end


The "tonumber" function ensures that the uid is a number (not a string) and checking for nil is in case it isn't a number at all.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Magellan   (10 posts)  [Biography] bio
Date Reply #2 on Mon 27 Nov 2017 07:28 AM (UTC)
Message
much appreciation. this worked exactly as i needed it to. my version wasn't quite as clean as can be expected but i wasn't using the AND in mine and i think that's the bulk of my issue. Every day i look at this stuff its a learning experience! thanks Nick!
[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.


631 views.

You need to log onto the forum to reply or create new threads.

  [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]