[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]  Bug reports
. . -> [Subject]  "Omit from output" omits output from script
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

"Omit from output" omits output from script

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


Posted by Faux   United Kingdom  (77 posts)  [Biography] bio
Date Sat 15 Jan 2005 12:25 PM (UTC)

Amended on Sat 15 Jan 2005 12:26 PM (UTC) by Faux

Message
Please don't say "DUH!".. :p

I effectively want to re-write lines as they come in from the mud.

With "Omit from output", using Send-to-output (ie.
<triggers>
  <trigger
   enabled="y"
   match="^([A-Za-z]+ wisps.*)$"
   omit_from_output="y"
   regexp="y"
   send_to="2"
   sequence="100"
  >
  <send>(One) %1</send>
  </trigger>
</triggers>

) works nicely, but using send-to-script (ie.

<triggers>
  <trigger
   enabled="y"
   omit_from_output="y"
   match="^Hp: ([-0-9]+)\(([-0-9]+)\)  Gp: ([-0-9]+)\(([-0-9]+)\)  Xp: ([-0-9]+)"
   regexp="y"
   send_to="12"
   sequence="96"
  >
  <send>
function numtobar(p,w)
 p=string.format("%i",p/10)
 r=string.rep("#",p)
 r=r..string.rep("-",w-p)
 return r
end

a=GetVariable("nextlev")


ss = "Hp: [" .. numtobar((%1/%2)*100,10) .. "]  Gp: [" .. numtobar((%3/%4)*100,10) .. "]  "

if (a ~= nil) then
 ss=ss .. "Xp: [" .. numtobar((%5/GetVariable("nextlev"))*100,20) .. "]"
else
 ss=ss .. "Xp: %5"
end
Note(ss)</send>
  </trigger>
</triggers>
(note that the only important line in that is the "Note (ss)" bit)) produces no output.


Bug, or am I missing something?

Faux, from Discworld. Feel free to come talk to me =)

http://faux.servebeer.com/
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] bio
Date Reply #1 on Sat 15 Jan 2005 03:53 PM (UTC)
Message
That's an old thing. Nick said that it's not really a bug, though I still don't see why omitting the matched line from output should result in your own text or script being omitted as well. Especially if it's still possible to send from a gagging trigger, just not to script.

And while I am at it, the thingy with script execution order, where if a trigger is set to keep evaluating and sends to script, the script will be executed only after all triggers finish matching on the line, also doesn't make too much sense. Perhaps it would be possible to change these two? Personally I've never seen those types of behavior be useful, while they often complicate things. For example, I prefer to use class instances in my scripts, instead of functions, and the only way to call those is through the "Send to script" option, but the behavior of "keep evaluating" and omitting triggers in relation to immediate scripting breaks the otherwise flawless and uniform scheme, necessitating special care to be taken whenever you want to gag something or cram a trigger into an existing sequence without disrupting it.
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #2 on Sat 15 Jan 2005 04:53 PM (UTC)
Message
You can put it in a script file (and call via a script routine).

http://www.gammon.com.au/forum/?bbsubject_id=4161
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=4832


~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Faux   United Kingdom  (77 posts)  [Biography] bio
Date Reply #3 on Sat 15 Jan 2005 09:01 PM (UTC)
Message
Oops, sorry Flannel. I did search, but apparently..

And, to quote Nick, "..known feature.." means it isn't going to be (can't be) fixed?


I prefer to put everything in a trigger if the code isn't going to be duplicated.. it makes sending it to other people a hell of a lot easier (no matter how easy the plugin wizard is it isn't going to get under 1 click at my end and 1 at their's).

Sorry for duplicating the old threads, btw.

Faux, from Discworld. Feel free to come talk to me =)

http://faux.servebeer.com/
[Go to top] top

Posted by Nick Gammon   Australia  (21,378 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Sat 15 Jan 2005 10:06 PM (UTC)
Message
It is hard to fix, so probably not for a while.

- Nick Gammon

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

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #5 on Sat 15 Jan 2005 10:21 PM (UTC)
Message
I wasnt implying you werent searching, it just saves me time retyping regurgitated information (just the details of why it doesnt work, etc) and makes it less likely that I'd miss something.

But yeah, putting it in a script file will work for now, especially if it's going to be in a plugin. Well, assuming you designed it to be in a plugin, you'd do other things differently anyway.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[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.


4,437 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]