View unanswered posts | View active topics It is currently 19 Aug 2018 22:02

Forum rules


- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.



Reply to topic  [ 5 posts ] 
Gag Trigger 
Author Message
Wizard
User avatar

Joined: 03 Mar 2014 13:03
Posts: 139
Location: US West
I've been searching the forums over and over using different terms, but I can't see to find what I am looking for. Ultimately, I have two questions:

  • Is there a library of commands that work for GMCP trigger inputs or javascript outputs? I only know how to kind of use regexp and would love to find a list of commands that I can work with.
  • I am trying to write a simple trigger to gag certain lines that are just spam. Specifically, I am trying to block the shouts of the orcs at Sarn Ford.

For the second piece, I have gotten close. I have been able to use
Code:
gwc.output.replace (/.*/,"")
to make each line go blank, but the blank line still prints and it still spams up my conversation window. Is there a way to completely stop the printing of a line in my main game window and/or the conversation window?


04 Jun 2017 21:30
Profile
Veteran

Joined: 21 Mar 2016 09:17
Posts: 206
Shanoga wrote:
Is there a library of commands that work for GMCP trigger inputs or javascript outputs? I only know how to kind of use regexp and would love to find a list of commands that I can work with.


I don't believe so, but if there was one that would be AWESOME!! And immensely helpful.

_________________
Alea iacta est. Serius regredi est.


06 Jun 2017 18:33
Profile
Myth
User avatar

Joined: 09 Mar 2010 20:33
Posts: 1331
Location: UK
U mean like the sticky post here?
viewtopic.php?f=37&t=2947
Tell u all the possible gmcp cmds

And the gwc help files here
https://genesismud.org/play/help/scripts.html
Tells u the gwc commands u can use. And links to similar gmcp documentation.


So can't see anything to gag, apart from u could black it out, not as useful I know. And u already could do that with replace.
Think it would take the admin adding a new command to the gwc for a fully functioning gag

Or maybe some JavaScript genius to tell u a way of modifying the HTML via JavaScript
More than likely that is possible but you'd need to know how things work under the hood.
Probably a totally irrelevant example here
https://www.w3schools.com/code/tryit.as ... D9T6WMHKQI

_________________
http://genesisquests.pbworks.com/
Join up and help each other with Quests :)


07 Jun 2017 21:05
Profile
Wizard
User avatar

Joined: 03 Mar 2014 13:03
Posts: 139
Location: US West
Tarax the Terrible wrote:
U mean like the sticky post here?
viewtopic.php?f=37&t=2947
Tell u all the possible gmcp cmds

And the gwc help files here
https://genesismud.org/play/help/scripts.html
Tells u the gwc commands u can use. And links to similar gmcp documentation.


So can't see anything to gag, apart from u could black it out, not as useful I know. And u already could do that with replace.
Think it would take the admin adding a new command to the gwc for a fully functioning gag

Or maybe some JavaScript genius to tell u a way of modifying the HTML via JavaScript
More than likely that is possible but you'd need to know how things work under the hood.
Probably a totally irrelevant example here
https://www.w3schools.com/code/tryit.as ... D9T6WMHKQI

I definitely looked at the sticky and the website help file first, but the library of commands was pretty small, so I figured there were more that I didn't know about. Then again, the commands are basically exclusive to Genesis and what has been produced by the wizards so I shouldn't have expected more. I'm thankful for what we do have.

I'll check out the w3schools link and see if I can frankenstein something together in lieu of using replace. I've been using javascript for a few things here and there.


08 Jun 2017 01:13
Profile
Wizard
User avatar

Joined: 03 Mar 2014 13:03
Posts: 139
Location: US West
So...I was messing around in the client a bit and trying to be more informed about how JavaScript works, specifically in the webclient. In digging around, I found a command that does exactly what I want, or close enough at least. There is a built-in function:
Code:
gwc.output.replace(t,e,n)

The argument t is the text that you want to match, then argument e is the text you would like to put in its place.

For example, if I wanted to replace "You jump unexpectedly." with a blank, I would have a trigger that matches the text "You jump unexpectedly." and has the following JavaScript:
Code:
gwc.output.replace("You jump unexpectedly.","");


This will make it so that if you type the command <jump> then instead of printing the standard response, you will simply get a blank line. I haven't found a way to completely eliminate the line yet...and this may not be possible. But at least SOME of the spam can be eliminated (or changed, if you'd like) using the command above. Cheers!

P.S. Oh, and as far as I can tell, the third argument is to change the color of the line. I haven't messed with it, though.


14 Jul 2018 05:46
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.