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 ➜ mapper: remove echo for certain UID's

mapper: remove echo for certain UID's

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


Posted by Magellan   (15 posts)  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.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  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
Top

Posted by Magellan   (15 posts)  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!
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.


11,687 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.