Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
quisquous committed Dec 27, 2020
1 parent 2caffc0 commit e813774
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 22 deletions.
3 changes: 3 additions & 0 deletions eureka.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@


Options.Language = 'en';
1 change: 1 addition & 0 deletions jobs.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* non-empty */
2 changes: 1 addition & 1 deletion jobs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';


// console.log('Language set to ' + Options.Language);

Expand Down
2 changes: 1 addition & 1 deletion oopsyraidsy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';


Options.PlayerNicks = {
'Paprika Rika': 'Pap',
Expand Down
Empty file added pullcounter.js
Empty file.
45 changes: 45 additions & 0 deletions radar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@


/*
// Monsters located out of this range will be hidden in the overlay and 0 means
// never hide monsters. Note that you have to detect the monster first, which
// usually needs to be close enough to make ACT "see" the monsters at first.
Options.DetectionRange = 0;
// If true, only monsters will be detected (filter out players).
Options.OnlyMobs = true;
// If true, then text-to-speech alerts are read aloud.
Options.TTS = false;
// If true, then a pop sound alerts are read aloud (but will be overwrite by TTS).
Options.PopSoundAlert = true;
// If true, then the earliest puller of mobs will be recorded.
Options.Puller = true;
// If true, then the position of monster will be shown. (Only x and y)
Options.Position = true;
// You can add your own monster list here.
// Note: you need to turn Options.OnlyMobs off if you want to detect players.
Options.CustomMonsters = {
'smilodon': {
'name': {
'en': [
'smilodonut',
'SmilodON',
'smilodonot',
],
},
'rank': 'Custom',
},
};
// You can also add different options to different ranks.
Options.RankOptions = {
'Custom': {
'Type': 'any',
},
};
*/
68 changes: 48 additions & 20 deletions raidboss.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';


// console.log('git raidboss user file');
// Options.Debug = true;
Expand All @@ -25,15 +25,15 @@ Options.PlayerNicks = {

// Prepend emoji to all added timeline events to make them stand out.
function emojify(arr) {
let emojo = '👋';
let search = Regexes.Parse(/^\s*(\y{Float})\s+"\s*(?!-)/);
const emojo = '👋';
const search = Regexes.Parse(/^\s*(\y{Float})\s+"\s*(?!-)/);
for (let i = 0; i < arr.length; ++i)
arr[i] = arr[i].replace(search, '$1 " ' + emojo + ' ');
return arr;
}


Options.Triggers = [
Options.Triggers.push(...[
{
zoneRegex: /.*/,
filename: 'user global',
Expand Down Expand Up @@ -131,19 +131,19 @@ Options.Triggers = [
regex: /1A:\y{Name} gains the effect of Cursed Voice/,
condition: function(data) {
// In case log lines get dropped wait a little and go anyway.
return data.voices && Object.keys(data.voices).length == 3;
return data.voices && Object.keys(data.voices).length === 3;
},
infoText: function(data) {
if (!data.voices)
return;

// Never freeze.
let neverPerson = 'Paprika Rika';
const neverPerson = 'Paprika Rika';
// Always freeze first.
let priorityPerson = 'Ryythe Larke';
const priorityPerson = 'Ryythe Larke';
// Prefer not this person, unless the next best person has a short time.
let preferPerson = 'Elmindreda Far\'shaw';
let minPreferSeconds = 6;
const preferPerson = 'Elmindreda Far\'shaw';
const minPreferSeconds = 6;

delete data.voices[neverPerson];
let order = [];
Expand All @@ -153,17 +153,17 @@ Options.Triggers = [
order.push(priorityPerson);
}

let preferPersonTime = data.voices[preferPerson];
const preferPersonTime = data.voices[preferPerson];
delete data.voices[preferPerson];

let sortedVoices = Object.keys(data.voices).sort(function(a, b) {
const sortedVoices = Object.keys(data.voices).sort((a, b) => {
return data.voices[b] - data.voices[a];
});

order = order.concat(sortedVoices);
if (preferPersonTime) {
let bestTime = data.voices[order[0]];
if (bestTime < minPreferSeconds && order[0] != priorityPerson &&
const bestTime = data.voices[order[0]];
if (bestTime < minPreferSeconds && order[0] !== priorityPerson &&
preferPersonTime > bestTime)
order.unshift(preferPerson);
else
Expand All @@ -190,7 +190,7 @@ Options.Triggers = [
zoneRegex: /^Eden's Gate: Resurrection \(Savage\)$/,
filename: 'user e1s',
timeline: function(data) {
if (data.job != 'DRK')
if (data.job !== 'DRK')
return;
return emojify([
'1 "Remember Early Rampart"',
Expand All @@ -216,7 +216,7 @@ Options.Triggers = [
zoneRegex: /^Eden's Gate: Descent \(Savage\)$/,
filename: 'user e2s',
timeline: function(data) {
if (data.job != 'DRK')
if (data.job !== 'DRK')
return;
return emojify([
'26 "Reprisal"',
Expand All @@ -234,7 +234,7 @@ Options.Triggers = [
zoneRegex: /^Eden's Gate: Inundation \(Savage\)$/,
filename: 'user e3s',
timeline: function(data) {
if (data.job != 'DRK')
if (data.job !== 'DRK')
return;
return emojify([
'3 "Missionary"',
Expand Down Expand Up @@ -266,7 +266,7 @@ Options.Triggers = [
zoneRegex: /^Eden's Gate: Sepulture \(Savage\)$/,
filename: 'user e4s',
timeline: function(data) {
if (data.job != 'DRK')
if (data.job !== 'DRK')
return;
return emojify([
'10 "Living"',
Expand Down Expand Up @@ -301,17 +301,17 @@ Options.Triggers = [
]);
},
},
];
]);

// Play tts as well as the on screen text.
let playTTS = {
const playTTS = {
SpeechAlert: true,
TextAlert: true,
SoundAlert: true,
};

// Run regardless of condition.
let alwaysTrueCondition = {
const alwaysTrueCondition = {
Condition: function(data, matches) {
if (matches.source !== data.me && !data.party.inAlliance(matches.source))
return false;
Expand Down Expand Up @@ -347,6 +347,7 @@ Options.PerTriggerOptions = {
'General Walking': alwaysTrueCondition,
};


Object.assign(Options.PerTriggerOptions, {
'Test Poke': {
SpeechAlert: true,
Expand All @@ -356,3 +357,30 @@ Object.assign(Options.PerTriggerOptions, {
},
},
});

// Here's an example of a adding a custom regen trigger.
// It reminds you to use regen again when you are in Sastasha (unsynced).
Options.Triggers.push({
// The zone this should apply to.
// This should match the zoneId in the triggers file.
zoneId: ZoneId.Sastasha,
triggers: [
// A more complicated regen trigger.
{
// This is a made up id.
id: 'User Example Regen',
// This will match log lines from ACT that look like this:
// "Nacho Queen gains the effect of Regen from Taco Cat for 21.00 Seconds."
regex: Regexes.gainsEffect({ effect: 'Regen' }),
delaySeconds: function(data, matches) {
// Wait the amount of seconds regen lasts before reminding you to
// reapply it. This is not smart enough to figure out if you
// cast it twice, and is left as an exercise for the reader to
// figure out how to do so via storing variables on `data`.
return data.ParseLocaleFloat(matches.duration);
},
alertText: 'Regen',
},
],
});

19 changes: 19 additions & 0 deletions raidboss/test-override.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# I am but a wee little test timeline override
#
# This is an example of how to override your timeline.
#
# The original file is in:
# https://github.com/quisquous/cactbot/blob/main/ui/raidboss/data/00-misc/test.txt

0 "--Reset--" sync /You bid farewell to the striking dummy/ window 10000 jump 0

0 "Engage" sync /:Engage!/ window 100000,100000
0 "Start" sync /:You bow courteously to the striking dummy/ window 0,1
6 "Angry Dummy II"
10 "Long Castbar IV" duration 10
12 "If you see this"
13 "you have overridden"
14 "the test timeline"
15 "with user/raidboss.js"
25 "Final Sting X"
40 "Death"
19 changes: 19 additions & 0 deletions raidboss/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
console.log('git raidboss user/raidboss/test.js file');

Options.Triggers.push({
zoneId: ZoneId.MiddleLaNoscea,
overrideTimelineFile: true,
timelineFile: 'test-override.txt',
triggers: [
{
id: 'Test Poke',
netRegex: NetRegexes.gameNameLog({ line: 'You poke the striking dummy.*?', capture: false }),
preRun: function(data) {
data.pokes = (data.pokes || 0) + 1;
},
// Instead of printing the number of pokes with infoText like the original trigger,
// This overrides the type and text of the output.
alarmText: 'POKE (user file override)',
},
],
});

0 comments on commit e813774

Please sign in to comment.