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 ➜ General ➜ disable all scripts temporarily

disable all scripts temporarily

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


Pages: 1  2 3  

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #15 on Wed 30 Jul 2008 11:34 PM (UTC)

Amended on Wed 30 Jul 2008 11:42 PM (UTC) by Fiendish

Message
Quote:
Let me ask this question: can you provide a precise use case where information is being thrown away, that you wanted to see, and then justify why the plug-in as-is is properly behaved -- and why the situation cannot be fixed by simply disabling or flipping a flag for that plug-in? (i.e. what undesirable consequences does that have?)
Yes. Here's one example:
Aardwolf has an overhead map. It also has something called "MAPTAGS" that display start and end tags around the map. It also has tags for "MAPNAMES" and "MAPEXITS" that cause the room name and a short form of available exits to display inside the begin and end tags for the map so that they can be easily captured to a floating window. Also, mapnames and mapexits only display when maptags is enabled, because there's no reason to show them when the map is not being captured to another window, because that information is otherwise already on the screen.

Now...
There's a plugin written by Nick that captures the map to another window. When the plugin is enabled, it turns on the necessary tags, because they are required for the plugin to work. And when the plugin gets disabled it turns off all the tags, because there's not a common use reason to have the tags showing if you're not capturing the map, and it would get old after a while if people kept asking "I just disabled the map capture. Why do I have garbage on my screen now?" So you see? There is a legitimate reason to have the OnDisable function.

However...

Yesterday I needed to check to see if there was a blank line being displayed between the "map" instruction as entered by the player and the MAPSTART tag. But you can't see the tags when the plugin is enabled, so I couldn't tell. And rather than just hitting "Ctrl-T" (a macro I made which calls #ignore) to just disable trigger firing like I would in zMUD, I had to do the following steps:

1) Move hand off the keyboard to mouse.
2) Mouse to the File menu.
3) Click and mouse down to "Plugins...".
4) Then spend several seconds searching through the list of plugins to find the one that captures the automap, because I sure as hell don't remember what the name of the plugin is to be able to do it from the command line.
5) Finally click on the right plugin, then mouse to "Disable" and click.
6) Mouse over to "Close" and click that too.
7) Mouse over and click in the input bar.

Only, now the tags are disabled.
So I have to keep going...
8) Move hand back to keyboard.
9) Type "maptags".
And then god forbid I'd need to also need mapnames or mapexits turned on, because then I'd then have to
10) type "tags map(names/exits) on".

Oh, but I wasn't done yet. Then I was stuck with the plugin turned off. I only needed to see the information for a second. So now I'd seen it and wanted to turn the plugin back on. So I needed to...

11) Move hand back to mouse.
12) Mouse over to file menu.
13) Click and mouse to "Plugins...".
14) Spend several more seconds finding that damned plugin again.
15) Click on the right plugin.
16) Mouse over and click on "Enable".
17) Mouse over and click on "Close".
18) Mouse over and click back in the input box.

You might say, "Why all that mousing?" And I'll grant you I can do SHIFT-CTRL-P to get to the plugins window. However, including and after that point, the process is still particularly onerous because it still has the user searching all over the screen for information across several context switches.

Now you should be able to see that the plugin both behaves properly and at the same time is a burden.

Quote:
and why the situation cannot be fixed by simply disabling or flipping a flag for that plug-in? (i.e. what undesirable consequences does that have?)
Are you seriously suggesting that forcing every user to choose between the ridiculousness above and having to change every single script that they ever might want to use that omits output is a better solution than adding 5 words to the source for the program once?

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #16 on Wed 30 Jul 2008 11:40 PM (UTC)

Amended on Wed 30 Jul 2008 11:41 PM (UTC) by Nick Gammon

Message
Right, you want to see this sort of stuff:


{stats}22/20,24/18,23/23,29/26,30/23,25/25,100,100,100,31,26,You are Standing.,9999,3320/3320,3979/3979,3681/3681,711,100999,0,76,1000,201,5
{spellheaders}
3,acid blast,1,0,0,-1,1
317,absorb,2,0,100,-1,1
404,abomination,1,0,0,-1,1
258,accelerate,3,0,0,-1,1
320,acid stream,1,0,100,-1,1
83,acid wave,1,0,100,-1,1
200,acidic touch,1,0,0,-1,1
249,acidproof,2,0,100,-1,1
97,adrenaline control,3,0,0,-1,1
496,aggrandize,0,0,0,-1,2
98,agitation,1,0,0,-1,1
155,aid,2,0,0,-1,1


But this is not for any scripting or debugging purpose?

Why?

The plugins were deliberately designed to automatically supress that stuff, if you disabled the plugin, I can't see a fabulously good reason "just wanting to see it".

We have offered a number of ways you could see this "for interest":


  • Packet debug
  • The plugin I wrote to show all output in another window
  • The suggestion that for Aardwolf at least, you write your own trigger that captures {* lines and displays them regardless.


Also you can do what I did just then to capture that stuff, just disable all plugins (select all, hit Disable), and then just type "tags <whatever>" to turn the tags back on. You could make an alias to do that.

Quote:

And if it were a script command like "/omgFiendishIsSuchAJerkWhoWouldEverWantACommandLikeThis!?" I highly doubt that any player would accidentally toggle it.


You said you wanted a convenient way, that doesn't look convenient, to type that.

Also, once you have disabled scripting, how will you get it back? That is a script command/alias, and you have disabled scripting, aliases etc.

Honestly, in the 15 years of supporting this client, no-one has wanted that, and we have lots of people who script and write plugins.

I don't want to start adding features "that zMUD has" just for the sake of it.

A little while ago you wanted cursor addressing, "like zMUD has" so you could do a big map. I showed it could be done without the cursor addressing. So what you really wanted, was a way to do a nice map - the cursor addressing was just one possible way of achieving it.



- Nick Gammon

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

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #17 on Wed 30 Jul 2008 11:54 PM (UTC)

Amended on Wed 30 Jul 2008 11:58 PM (UTC) by Fiendish

Message
Quote:
Fiendish, it should be really simple to write the functionality you are looking (showing stuff marked to gag instead) for yourself inside a plugin. Maybe I'll go write it after I've had breakfast. ^^
Really? If you have a way to do it that doesn't require altering every other script I might come in contact with I'd be grateful.

Quote:
You said you wanted a convenient way, that doesn't look convenient, to type that.
I'd make an accelerator, of course.

Quote:
Also, once you have disabled scripting, how will you get it back?
It's just one of those things that doesn't itself get disabled, you know? In any case, we can probably safely ignore the part about actually halting all processing for now and just focus on temporarily disabling gags.

Quote:
A little while ago you wanted cursor addressing, "like zMUD has" so you could do a big map. I showed it could be done without the cursor addressing.
After you changed the program to accomodate a different draw routine, right? Besides, mine still updates more smoothly because (possibly) of what we talked about the other day, and my goal has always been smooth redraw. So I'm not quite sure that it's done just yet.

Quote:
So what you really wanted, was a way to do a nice map - the cursor addressing was just one possible way of achieving it.
I'm not saying it can't be a plugin. A plugin is fine too. It's that so far I'm being told that what I want to do isn't possible. And not only is it not possible, I'm wrong for wanting it because somehow having to change every script I might come in contact with is a better option.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #18 on Thu 31 Jul 2008 12:02 AM (UTC)
Message
Quote:
Yesterday I needed to check to see if there was a blank line being displayed between the "map" instruction as entered by the player and the MAPSTART tag.

This sounds an awful lot like debugging to me, yet you have claimed several time that this is something you do often enough and isn't for debugging. Why were you trying to see if this was happening? My point is not that you were doing something useless, but that you were doing something very specialized and relatively infrequent. Can you provide a use case that actually occurs often and for average users? And there's no need to go into so much detail on what you had to do -- it suffices to say that it was a lot. ;)

Quote:
Are you seriously suggesting that forcing every user to choose between the ridiculousness above and having to change every single script that they ever might want to use that omits output is a better solution than adding 5 words to the source for the program once?

Maybe. You don't seem to realize or acknowledge that even a simple-seeming change can create burden in the long-term due to having to maintain that change. You are the only person who has ever asked for this feature, so it seems like the overall expected gain is not commensurate with the expected loss of having to deal with this potential source of trouble from now on.

Quote:
I'm wrong for wanting it because somehow having to change every script I might come in contact with is a better option.

You're asking Nick to introduce a hackish back door into the program's scripting because scripts are broken. I'm not sure that you are "wrong" to ask for it, but certainly you understand why everybody else is so hesitant to consider this?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #19 on Thu 31 Jul 2008 12:03 AM (UTC)
Message

/AcceleratorTo ("Ctrl+T", 'SetOption ("enable_triggers", 0)', sendto.script)


Now type Ctrl+T

Now walk around:


<MAPSTART>
Near Thalos and Dragon Roads
 
 
                            
     , ` , ` , ` , ` [ ]  
                             
 , ` , ` , ` [ ] [ ] [ ] [ ] 
                             
 [ ] [ ] [ ] [ ] , ` , ` , ` 
                             
 , ` , ` ,|` ,#` , ` [?]  
                             
 . ^ , ` ,|` , ` , ` , ` , ` 
                             
 , ` , ` ,|` , ` , ` . ^ , ` 
                             
     , ` ,|` , ` ~ ~ , `  
                             
 
[ Exits: N E S W ]
<MAPEND>
[Exits: north east south west]


{stats}22/20,24/18,23/23,29/26,30/23,25/25,100,98,99,31,26,You are Standing.,9999,3320/3320,3934/3979,3678/3681,711,100999,0,76,1000,201,5


Now that wasn't too hard was it?

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #20 on Thu 31 Jul 2008 12:05 AM (UTC)
Message
Quote:

11) Move hand back to mouse.
12) Mouse over to file menu.
13) Click and mouse to "Plugins...".
14) Spend several more seconds finding that damned plugin again.
15) Click on the right plugin.
16) Mouse over and click on "Enable".
17) Mouse over and click on "Close".
18) Mouse over and click back in the input box.


If I recorded every hand and mouse movement it took to reply to your earlier posts, it would get quite tedious.

- Nick Gammon

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

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #21 on Thu 31 Jul 2008 12:55 AM (UTC)

Amended on Thu 31 Jul 2008 12:59 AM (UTC) by Fiendish

Message
Quote:
This sounds an awful lot like debugging to me

Not trying to find any bug = not debugging, no? I'm just trying to get information. I like having information, you see.

Quote:
/AcceleratorTo ("Ctrl+T", 'SetOption ("enable_triggers", 0)', sendto.script)
See, this is why I came and asked here. You know all sorts of things about the program that I don't. You said it wouldn't work at the beginning of the thread, so I didn't try it. Had I tried it, I'd probably have seen that the result was satisfactory for current purposes.

But I have another question.

If
/AcceleratorTo ("Ctrl+T", 'SetOption ("enable_triggers", 0)', sendto.script)
and
/AcceleratorTo ("Ctrl+T", 'SetOption ("enable_triggers", 1)', sendto.script)

both work, why don't either of these work?

/AcceleratorTo ("Ctrl+T", 'if GetOption("enable_triggers") then SetOption("enable_triggers", 0) else SetOption("enable_triggers", 1) end', sendto.script)

/AcceleratorTo ("Ctrl+T", 'SetOption("enable_triggers", (not GetOption("enable_triggers") and 1 or 0))', sendto.script)



Quote:
You're asking Nick to introduce a hackish back door into the program's scripting because scripts are broken. I'm not sure that you are "wrong" to ask for it, but certainly you understand why everybody else is so hesitant to consider this?
Of course. Feel free to say "no" to any of my requests at any time. That won't stop me from trying to convince you otherwise. ;)

Quote:
If I recorded every hand and mouse movement it took to reply to your earlier posts, it would get quite tedious.
Maybe you need to redesign the forum too. *srun*

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #22 on Thu 31 Jul 2008 01:03 AM (UTC)
Message
Quote:
Not trying to find any bug = not debugging, no? I'm just trying to get information. I like having information, you see.

I am not sure if you are trying to be facetious or not. In any case, it would be more helpful if you said why you are trying to do this, because it looks awfully like something rather particular, i.e. something that few people would want, and only relatively rarely (if even more than once).

Quote:
You said it wouldn't work at the beginning of the thread, so I didn't try it.

Well, actually :-) he said that disabling all plugins without having the message being sent wouldn't be possible. The solution we have ended up with is to disable only triggers, which is rather different.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #23 on Thu 31 Jul 2008 01:08 AM (UTC)
Message
Quote:
I am not sure if you are trying to be facetious or not.
I assure you I'm not being facetious. Oh. Uh...we could get into a loop here, so you're going to need to believe me. :D

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Worstje   Netherlands  (899 posts)  Bio
Date Reply #24 on Thu 31 Jul 2008 02:29 AM (UTC)
Message
I can't help but reply after rereading most of this thread...

1) If you are not trying the suggestions we are giving you before shooting them down, what is the point?

2) Apparently my wrong assumption of what you wanted ended up being precisely what you needed, although attached to a hotkey. Yet others thought you were talking about other things again entirely. I really think that being less vague and more defined in what you wanted originally could have saved a lot of confusion.

Anyhow, I don't want to make this be a flame (the above comments are more for constructive criticism concerning forum debates), so I'll add one more point just to get out of that gray area.

If you wanted, it would not be difficult to write a plugin that essentially adjusts all triggers with omit_from_output="y" to omit_from_output="n" in memory. Another call would restore those triggers to their former state. That way, you wouldn't necessarily lose the functionality of your triggers (if all you wanted to do was prevent gagging). Mind you, it wouldn't protect against world.DeleteLines(), but I tend to avoid using that function alltogether because it tends to feel a bit jumpy when using that with a lot of incoming text. I could write it some time when I have time, if you'd like.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #25 on Thu 31 Jul 2008 02:53 AM (UTC)
Message
Quote:

why don't either of these work?

/AcceleratorTo ("Ctrl+T", 'if GetOption("enable_triggers") then SetOption("enable_triggers", 0) else SetOption("enable_triggers", 1) end', sendto.script)


Try this:


/print (GetOption("enable_triggers") )  --> either prints 0 or 1


Now in Lua, "if 0 then ..." will evaluate to true. This is basic Lua coding. The only things that are false in Lua are nil and the boolean value false.

- Nick Gammon

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

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #26 on Thu 31 Jul 2008 02:55 AM (UTC)

Amended on Thu 31 Jul 2008 03:01 AM (UTC) by Fiendish

Message
Quote:
If you are not trying the suggestions we are giving you before shooting them down, what is the point?
I didn't. I thought Nick did. Clearly I was mistaken.

Quote:
I could write it some time when I have time, if you'd like.
I am interested.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #27 on Thu 31 Jul 2008 03:03 AM (UTC)

Amended on Thu 31 Jul 2008 03:25 AM (UTC) by Fiendish

Message
Quote:
/print (GetOption("enable_triggers") ) --> either prints 0 or 1
Yeah, I got that far. On the first one, I guess I'm just too used to the C/C++ equivalence of bools and ints.

What about the second one, though?
/Note (not GetOption("enable_triggers") and 1 or 0) shows 1 or 0

It seems like the "(not GetOption("enable_triggers") and 1 or 0)" part of
/AcceleratorTo ("Ctrl+T", 'SetOption("enable_triggers", (not GetOption("enable_triggers") and 1 or 0))', sendto.script)

is getting processed as I create the accelerator instead of when I use it. I don't understand why, since obviously the "SetOption" part doesn't happen until it's used. Is there a way around that?

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #28 on Thu 31 Jul 2008 04:36 AM (UTC)
Message
Quote:

/Note (not GetOption("enable_triggers") and 1 or 0) shows 1 or 0


No, it doesn't. It always shows 0.

Look, GetOption("enable_triggers") returns type number, so that will *always* be considered true. So you effectively have:

not true and 1 or 0

not true is false, so it becomes:

false and 1 or 0

These are boolean opereations (and and or) so this now becomes:

false and true or 0

It will always return zero.

You don't think this is a tad complicated do you?

GetOption returns a number, how about testing that number?



/AcceleratorTo ("Ctrl+T", [[
if GetOption("enable_triggers") == 1 then
  SetOption("enable_triggers", 0)
  Note "Triggers disabled!"
else
  SetOption("enable_triggers", 1)
  Note "Triggers enabled!"
end -- if
]], sendto.script)

- Nick Gammon

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

Posted by Fiendish   USA  (2,534 posts)  Bio   Global Moderator
Date Reply #29 on Thu 31 Jul 2008 08:28 AM (UTC)
Message
I guess my mind has been playing tricks on me. After sleeping and waking up now it only displays 0. Oh well. Off to check the number.

https://github.com/fiendish/aardwolfclientpackage
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.


85,045 views.

This is page 2, subject is 3 pages long:  [Previous page]  1  2 3  [Next page]

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.