Paths and multi-pattern triggers

General discussion about the Genesis Web Client located at https://www.genesismud.org/play/

Moderator: Eowul

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.
Post Reply
User avatar
Cherek
Site Admin
Posts: 2814
Joined: 04 Mar 2010 04:36

Paths and multi-pattern triggers

Post by Cherek » 25 Sep 2014 18:16

Anyone know how to create these with the client?

Apparently Yanus has decided to for some reason remove all his information he provided previous in this thread, replacing all his posts with ".". And Eowul is also currently inactive.

I am doing a small guide on how to use the client for the new and improved webpage, and this is two things that would be good to include I think.

With multi-pattern triggers I mean for example having ONE single coloring trigger that fires on both "obvious exits" and "obvious exit", and similar, instead of having to do multiple triggers.

Keltar
Wanderer
Posts: 59
Joined: 20 Apr 2010 18:54

Re: Paths and multi-pattern triggers

Post by Keltar » 26 Sep 2014 12:05

Cherek wrote:Anyone know how to create these with the client?

With multi-pattern triggers I mean for example having ONE single coloring trigger that fires on both "obvious exits" and "obvious exit", and similar, instead of having to do multiple triggers.
example multi-pattern:
trigger
type regexp
pattern: obvious (?:exit|exits)
script: gwc.output.color("green");
select javascript
save

example path:
alias
pattern: <alias name of your choice>
script:
var path = ['e','s','s','n','n','w', 'enter', 'out'];

path.forEach(function(step) {
gwc.connection.send(step);
});

select javascript below the script textbox
save

User avatar
Cherek
Site Admin
Posts: 2814
Joined: 04 Mar 2010 04:36

Re: Paths and multi-pattern triggers

Post by Cherek » 26 Sep 2014 13:36

Thank you Keltar! And thank you again for the other stuff you sent me previously!

User avatar
Cherek
Site Admin
Posts: 2814
Joined: 04 Mar 2010 04:36

Re: Paths and multi-pattern triggers

Post by Cherek » 27 Sep 2014 00:09

How about reversing a path? Doable, or do you have to type it in manually in reverse?

Keltar
Wanderer
Posts: 59
Joined: 20 Apr 2010 18:54

Re: Paths and multi-pattern triggers

Post by Keltar » 27 Sep 2014 18:22

Cherek wrote:How about reversing a path? Doable, or do you have to type it in manually in reverse?
Sure it's doable, I will put it together and post here

User avatar
Cherek
Site Admin
Posts: 2814
Joined: 04 Mar 2010 04:36

Re: Paths and multi-pattern triggers

Post by Cherek » 27 Sep 2014 20:24

Keltar wrote:
Cherek wrote:How about reversing a path? Doable, or do you have to type it in manually in reverse?
Sure it's doable, I will put it together and post here
Great! Thanks.

Keltar
Wanderer
Posts: 59
Joined: 20 Apr 2010 18:54

Re: Paths and multi-pattern triggers

Post by Keltar » 27 Sep 2014 22:35

Cherek wrote:How about reversing a path? Doable, or do you have to type it in manually in reverse?
alias, note that alias name is the same as the path name, not necessary but helps
pattern: path1
script:
var p = gwc.userdata.paths;
p.go(p.path1);

select javascript
save

alias to reverse the path
pattern: path1back
script:
var p = gwc.userdata.paths;
p.go_back(p.path1);

select javascript
save

alias so that paths are refreshed when you run the alias, you can add as many paths as you like, path1 and path2 are added already:
Pattern: <whatever you like>
script:
gwc.userdata.paths = {

path1:['e','s','s'],
path2:['e','e','d','d'],

reverse : {
'n':'s', 's':'n', 'e':'w', 'w':'e',
'nw':'se', 'ne':'sw', 'sw':'ne', 'se':'nw',
'u':'d', 'd':'u', 'in':'out', 'out':'in'
},

go:function(path) {
path.forEach(function(step) {
gwc.connection.send(step);
});
},
go_back:function(path) {
path.reverse();
path.forEach(function(step) {
step = gwc.userdata.paths.reverse[step];
gwc.connection.send(step);
});
}
};

select javascript
save

User avatar
Cherek
Site Admin
Posts: 2814
Joined: 04 Mar 2010 04:36

Re: Paths and multi-pattern triggers

Post by Cherek » 29 Sep 2014 04:07

Great work Keltar. Very useful!

Post Reply
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/