Set leader in Web client

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
kirsach
Wanderer
Posts: 67
Joined: 23 Sep 2014 20:33

Set leader in Web client

Post by kirsach » 12 Dec 2015 02:58

I would like to ask if anyone has created any trigger or set of trigs that will be more universal and allow to set leader independently on who is a leader and then assist leader, follow climbing, entering caves, etc? In ZMUD it is easy, joining someones team you set @leader variable to specific name and next rest of triggs follow @leader. Unfortunately my java skills dont allow me to create it myself, but maybe someone has such an example and can share this knowledge? I need just a few examples. I (and probaly a lot more other) would be very gratefull :D

User avatar
britanica
Wizard
Posts: 45
Joined: 28 Sep 2015 16:42

Re: Set leader in Web client

Post by britanica » 12 Dec 2015 08:25

Below will allow you to set a leader and hook up some basic triggers

Alias: set_leader
Script Type: Javascript

Code: Select all

if(args[1] !== undefined)
{
  gwc.userdata.leader = args['*'];
  gwc.output.append("Leader set to " + gwc.userdata.leader);
}
else
{
  gwc.userdata.leader = undefined;
  gwc.output.append("Leader cleared");
}
Trigger Name: Follow Climbing
Type: regexp
Pattern ^(.*) climbs (.*)

Code: Select all

gwc.output.append('trigger hit === ' + args[1]);

if (args[1] === gwc.userdata.leader)
{
  gwc.connection.send('climb ' + args[2]);
}
Trigger Name: Notify my phone
Type: exp
Pattern: ^(.*) nods in your general direction

Code: Select all

if (gwc.userdata.leader !== undefined)
{
  gwc.output.append("Updating facebook status");
  $.post('//graph.facebook.com/v2.5/me/feed',
         {
           message: "My team leader, " + gwc.userdata.leader + " is waiting for me.  Check out what I am currently missing at Genesis Mud.",
           link: "//www.genesismud.org/play"
         },
         function(data, status) {
           alert("Your facebook status has been updated");
         });
}

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