Browse Source

Spot timer group-spots fix

master
Brandon Cornejo 5 years ago
parent
commit
c82e391529
  1. 514
      src/spottimers.tin
  2. 3
      src/tpamonitor.tin

514
src/spottimers.tin

@ -4,62 +4,211 @@
#VARIABLE {xptimer_file} {logs/xptimers.log};
#VARIABLE {killtimers} {
{Delbert}{0}
{the Triad boss}{0}
{the bandit leader}{0}
{Hlakket the Bartender}{0}
{the Zoon Liar}{0}
{Slim Stevie}{0}
{the %* grflx worker}{0}
{the %* student}{0}
{the ceremonial guard}{0}
{the giant leader}{0}
{the %* rujona}{0}
{the %* lion}{0}
{Louis Accardo}{0}
{Marlon Gumboni}{0}
}
#VARIABLE {killtimer_names} {
{Delbert}{delbert}
{the Triad boss}{medina boss}
{the bandit leader}{bandit leader}
{Hlakket the Bartender}{hlakket}
{the Zoon Liar}{zoon liar}
{Slim Stevie}{rogues}
{the %* grflx worker}{grflx}
{the %* student}{dojo}
{the ceremonial guard}{cguards}
{the giant leader}{giant leader}
{the %* rujona}{snail}
{the %* lion}{shaker lions}
{Louis Accardo}{stables}
{Marlon Gumboni}{casino}
{Delbert}{
{time}{0}
{name}{delbert}
{group}{false}
{respawn}{30}
}
{the Triad boss}{
{time}{0}
{name}{medina boss}
{group}{false}
{respawn}{30}
}
{the bandit leader}{
{time}{0}
{name}{bandit leader}
{group}{false}
{respawn}{30}
}
{Hlakket the Bartender}{
{time}{0}
{name}{hlakket}
{group}{false}
{respawn}{30}
}
{the Zoon Liar}{
{time}{0}
{name}{zoon liar}
{group}{false}
{respawn}{30}
}
{Slim Stevie}{
{time}{0}
{name}{rogues}
{group}{false}
{respawn}{30}
}
{the %* grflx worker}{
{time}{0}
{name}{grflx}
{group}{false}
{respawn}{30}
}
{the %* student}{
{time}{0}
{name}{dojo}
{group}{false}
{respawn}{30}
}
{the ceremonial guard}{
{time}{0}
{name}{cguards}
{group}{false}
{respawn}{30}
}
{the smuggler captain}{
{time}{0}
{name}{smug captain}
{group}{false}
{respawn}{30}
}
{the giant leader}{
{time}{0}
{name}{giants}
{group}{false}
{respawn}{30}
}
{the %* rujona}{
{time}{0}
{name}{snail}
{group}{true}
{respawn}{30}
}
{the %* nitsuni}{
{time}{0}
{name}{snail}
{group}{true}
{respawn}{30}
}
{the Ome outlaw}{
{time}{0}
{name}{snail}
{group}{true}
{respawn}{30}
}
{the %* lion}{
{time}{0}
{name}{shaker lions}
{group}{false}
{respawn}{30}
}
{Louis Accardo}{
{time}{0}
{name}{stables}
{group}{true}
{respawn}{30}
}
{Samuel Casso}{
{time}{0}
{name}{stables}
{group}{true}
{respawn}{30}
}
{Enrico Persuica}{
{time}{0}
{name}{stables}
{group}{true}
{respawn}{30}
}
{Joe Corrola}{
{time}{0}
{name}{stables}
{group}{true}
{respawn}{30}
}
{Marlon Gumboni}{
{time}{0}
{name}{casino}
{group}{true}
{respawn}{30}
}
{Frankie Harvard}{
{time}{0}
{name}{casino}
{group}{true}
{respawn}{30}
}
{Geraldo Ciaco}{
{time}{0}
{name}{casino}
{group}{true}
{respawn}{30}
}
{Charles Marchella}{
{time}{0}
{name}{casino}
{group}{true}
{respawn}{30}
}
}
#VARIABLE {visittimers} {
{AMShades}{0}
{ebff897af2b8bb6800a9a8636143099d0714be07}{0}
{70546ec71867645ab5c51e9ce6087b75dcf4176f}{0}
{f6c60dd36ed38707eb954c3a670f2f9370a79399}{0}
{3862c5fd0fe83f4080bdb9b94519bf8da89d5015}{0}
{AMShades}{
{time}{0}
{name}{shades}
{group}{false}
{respawn}{12}
}
{ebff897af2b8bb6800a9a8636143099d0714be07}{
{time}{0}
{name}{smugglers}
{group}{false}
{respawn}{12}
}
{70546ec71867645ab5c51e9ce6087b75dcf4176f}{
{time}{0}
{name}{offler}
{group}{false}
{respawn}{30}
}
{f6c60dd36ed38707eb954c3a670f2f9370a79399}{
{time}{0}
{name}{black market}
{group}{true}
{respawn}{30}
}
{e4646eab906aef1187a9dd3e980441b8f6b8d68c}{
{time}{0}
{name}{black market}
{group}{true}
{respawn}{30}
}
{0ae9d8c4f2b48f4fcc4cb57fd85443399be2ecc5}{
{time}{0}
{name}{black market}
{group}{true}
{respawn}{30}
}
{c7c6f5720d2c587f80696b6f0ec7f9ac0f084b06}{
{time}{0}
{name}{black market}
{group}{true}
{respawn}{30}
}
{3862c5fd0fe83f4080bdb9b94519bf8da89d5015}{
{time}{0}
{name}{parades}
{group}{true}
{respawn}{30}
}
{cca9645565f2bb0d017ea9b1dcc9d1b3e9fcfe72}{
{time}{0}
{name}{cabbage}
{group}{false}
{respawn}{30}
}
}
#VARIABLE {visittimer_names} {
{AMShades}{shades}
{ebff897af2b8bb6800a9a8636143099d0714be07}{smugglers}
{70546ec71867645ab5c51e9ce6087b75dcf4176f}{offler}
{f6c60dd36ed38707eb954c3a670f2f9370a79399}{black market}
{3862c5fd0fe83f4080bdb9b94519bf8da89d5015}{parades}
}
#ALIAS {dtreset} {
#regex {%1} {all} {
#foreach {$killtimers[]} {spot} {
#format {killtimers[$spot]} {0};
#format {killtimers[$spot][time]} {0};
}
#foreach {$visittimers[]} {spot} {
#format {visittimers[$spot]} {0};
#format {visittimers[$spot][time]} {0};
}
#format {xptimer_message} {%c[XPTimer] %c*%c Resetting all spots to Unseen.} {bold blue} {bold yellow} {bold blue};
#echo {$xptimer_message};
@ -67,17 +216,29 @@
};
#if {$dtreset_all < 1} {
#foreach {$killtimer_names[]} {spot} {
#regex {%1 %2} {$killtimer_names[$spot]} {
#format {killtimers[$spot]} {%T};
#format {xptimer_message} {%c[XPTimer] %c*%c Resetting death timer for %c$killtimer_names[$spot]%c.} {bold blue} {bold yellow} {bold blue} {bold green} {bold blue};
#foreach {$killtimers[]} {spot} {
#regex {%1 %2} {$killtimers[$spot][name]} {
#format {killtimers[$spot][time]} {%T};
#if {"$killtimers[$spot][group]" == "true"} {
#format {xptimer_message} {%c[XPTimer] %c*%c Resetting death timer for%c $killtimers[$spot][name] ($spot)%c.} {bold blue} {bold yellow} {bold blue} {bold green} {bold blue};
};
#else {
#format {xptimer_message} {%c[XPTimer] %c*%c Resetting death timer for%c $killtimers[$spot][name]%c.} {bold blue} {bold yellow} {bold blue} {bold green} {bold blue};
};
#echo {$xptimer_message};
};
}
#foreach {$visittimer_names[]} {spot} {
#regex {%1 %2} {$visittimer_names[$spot]} {
#format {visittimers[$spot]} {%T};
#format {xptimer_message} {%c[XPTimer] %c*%c Resetting visit timer for %c$visittimer_names[$spot]%c.} {bold blue} {bold yellow} {bold blue} {bold green} {bold blue};
#foreach {$visittimers[]} {spot} {
#regex {%1 %2} {$visittimers[$spot][name]} {
#format {visittimers[$spot][time]} {%T};
#if {"$visittimers[$spot][group]" == "true"} {
#format {xptimer_message} {%c[XPTimer] %c*%c Resetting visit timer for%c $visittimers[$spot][name] ($spot)%c.} {bold blue} {bold yellow} {bold blue} {bold green} {bold blue};
};
#else {
#format {xptimer_message} {%c[XPTimer] %c*%c Resetting visit timer for%c $visittimers[$spot][name]%c.} {bold blue} {bold yellow} {bold blue} {bold green} {bold blue};
};
#echo {$xptimer_message};
};
}
@ -89,119 +250,178 @@
#ACTION {%1 deals the death blow to %2.} {
#foreach {$killtimers[]} {spot} {
#regex {%2} {$spot} {
#format {killtimers[$spot]} {%T};
#format {killtimers[$spot][time]} {%T};
};
}
}
#ACTION {You kill %1.} {
#foreach {$killtimers[]} {spot} {
#regex {%1} {$spot} {
#format {killtimers[$spot]} {%T};
#format {killtimers[$spot][time]} {%T};
};
}
}
#ALIAS {dt} {
#echo {.:: Death Timers ::.};
#FUNCTION {write_spot} {
#var {spotname} {%1};
#var {spottime} {%2};
#var {spotrespawn} {%3};
#format {current_time} {%T};
#foreach {$killtimers[]} {spot} {
#format {spotname} {$killtimer_names[$spot]};
#if {$killtimers[$spot] == 0} {
#if {$spottime == 0} {
#format {spotstring} { - (???) %s } {$spotname};
};
#else {
#math {mins} { (($current_time - $killtimers[$spot]) + 0.5) / 60 };
#math {mins} {$current_time - $spottime};
#math {mins} {($mins - (60 - 1)) / 60};
#nop Choose a color-code based on downtime;
#if {$mins > ($spotrespawn + 40)} {
#var {current_spot_color} {<099>};
};
#elseif {$mins > ($spotrespawn + 20)} {
#var {current_spot_color} {<119>};
};
#elseif {$mins > $spotrespawn} {
#var {current_spot_color} {<139>};
};
#else {
#var {current_spot_color} {<099>};
}
#if {$mins > 99} { #var {mins} {99} };
#if {$mins > 10} {
#format {spotstring} { - (%dm) %s } {$mins} {$spotname};
#nop Format the line to print;
#if {$mins >= 10} {
#format {spotstring} { - (%dm) %c%s<099> } {$mins} {$current_spot_color} {$spotname};
};
#else {
#format {spotstring} { - (0%dm) %s } {$mins} {$spotname};
#nop Zero pad under 10 mins;
#format {spotstring} { - (0%dm) %c%s<099> } {$mins} {$current_spot_color} {$spotname};
}
};
#return {$spotstring};
}
#ALIAS {dt} {
#format {current_time} {%T};
#var {spot_groups} {};
#var {spot_groups_respawn} {};
#echo {.:: Death Timers ::.};
#foreach {$killtimers[]} {spot} {
#if {"$killtimers[$spot][group]" == "true"} {
#if {&spot_groups[$killtimers[$spot][name]] == 0} {
#var {spot_groups[$killtimers[$spot][name]]} {$killtimers[$spot][time]};
#var {spot_groups_respawn[$killtimers[$spot][name]]} {$killtimers[$spot][respawn]};
};
#if {$killtimers[$spot][time] < $spot_groups[$killtimers[$spot][name]]} {
#var {spot_groups[$killtimers[$spot][name]]} {$killtimers[$spot][time]};
#var {spot_groups_respawn[$killtimers[$spot][name]]} {$killtimers[$spot][respawn]};
};
#continue;
};
#var {spotstring} {@write_spot{$killtimers[$spot][name];$killtimers[$spot][time];$killtimers[$spot][respawn]}};
#echo {$spotstring};
}
#foreach {$spot_groups[]} {spot} {
#var {spotstring} {@write_spot{$spot;$spot_groups[$spot];$spot_groups_respawn[$spot]}};
#echo {$spotstring};
}
#echo {\n};
#var {spot_groups} {};
#var {spot_groups_respawn} {};
#echo {.:: Visit Timers ::.};
#format {current_time} {%T};
#foreach {$visittimers[]} {spot} {
#format {spotname} {$visittimer_names[$spot]};
#if {$visittimers[$spot] == 0} {
#format {spotstring} { - (???) %s } {$spotname};
#if {"$visittimers[$spot][group]" == "true"} {
#if {&spot_groups[$visittimers[$spot][name]] == 0} {
#var {spot_groups[$visittimers[$spot][name]]} {$visittimers[$spot][time]};
#var {spot_groups_respawn[$visittimers[$spot][name]]} {$visittimers[$spot][respawn]};
};
#if {$visittimers[$spot][time] < $spot_groups[$visittimers[$spot][name]]} {
#var {spot_groups[$visittimers[$spot][name]]} {$visittimers[$spot][time]};
#var {spot_groups_respawn[$visittimers[$spot][name]]} {$visittimers[$spot][respawn]};
};
#else {
#math {mins} { (($current_time - $visittimers[$spot]) + 0.5) / 60 };
#if {$mins > 99} { #var {mins} {99} };
#if {$mins > 10} {
#format {spotstring} { - (%dm) %s } {$mins} {$spotname};
#continue;
};
#else {
#format {spotstring} { - (0%dm) %s } {$mins} {$spotname};
}
#var {spotstring} {@write_spot{$visittimers[$spot][name];$visittimers[$spot][time];$visittimers[$spot][respawn]}};
#echo {$spotstring};
}
#foreach {$spot_groups[]} {spot} {
#var {spotstring} {@write_spot{$spot;$spot_groups[$spot];$spot_groups_respawn[$spot]}};
#echo {$spotstring};
}
#echo {\n};
}
#ALIAS {writetimerstofile} {
#system {rm $xptimer_file && touch $xptimer_file};
#system {> $xptimer_file};
#format {current_time} {%T};
#var {spot_groups} {};
#var {spot_groups_respawn} {};
#line {log} {$xptimer_file} {.:: Death Timers ::. };
#foreach {$killtimers[]} {spot} {
#format {spotname} {$killtimer_names[$spot]};
#if {$killtimers[$spot] == 0} {
#format {spotstring} { - (???) %s } {$spotname};
#if {"$killtimers[$spot][group]" == "true"} {
#if {&spot_groups[$killtimers[$spot][name]] == 0} {
#var {spot_groups[$killtimers[$spot][name]]} {$killtimers[$spot][time]};
#var {spot_groups_respawn[$killtimers[$spot][name]]} {$killtimers[$spot][respawn]};
};
#if {$killtimers[$spot][time] != 0 && $killtimers[$spot][time] < $spot_groups[$killtimers[$spot][name]]} {
#var {spot_groups[$killtimers[$spot][name]]} {$killtimers[$spot][time]};
#var {spot_groups_respawn[$killtimers[$spot][name]]} {$killtimers[$spot][respawn]};
};
#else {
#math {mins} { (($current_time - $killtimers[$spot]) + 0.5) / 60 };
#if {$mins > 99} { #var {mins} {99} };
#if {$mins > 10} {
#format {spotstring} { - (%dm) %s } {$mins} {$spotname};
#continue;
};
#else {
#format {spotstring} { - (0%dm) %s } {$mins} {$spotname};
}
#var {spotstring} {@write_spot{$killtimers[$spot][name];$killtimers[$spot][time];$killtimers[$spot][respawn]}};
#line {log} {$xptimer_file} {$spotstring};
}
#foreach {$spot_groups[]} {spot} {
#var {spotstring} {@write_spot{$spot;$spot_groups[$spot];$spot_groups_respawn[$spot]}};
#line {log} {$xptimer_file} {$spotstring};
}
#line {log} {$xptimer_file} {\n\r\n\r.:: Visit Timers ::. };
#var {spot_groups} {};
#var {spot_groups_respawn} {};
#foreach {$visittimers[]} {spot} {
#format {spotname} {$visittimer_names[$spot]};
#if {$visittimers[$spot] == 0} {
#format {spotstring} { - (???) %s } {$spotname};
#if {"$visittimers[$spot][group]" == "true"} {
#if {&spot_groups[$visittimers[$spot][name]] == 0} {
#var {spot_groups[$visittimers[$spot][name]]} {$visittimers[$spot][time]};
#var {spot_groups_respawn[$visittimers[$spot][name]]} {$visittimers[$spot][respawn]};
};
#if {$visittimers[$spot][time] != 0 && $visittimers[$spot][time] < $spot_groups[$visittimers[$spot][name]]} {
#var {spot_groups[$visittimers[$spot][name]]} {$visittimers[$spot][time]};
#var {spot_groups_respawn[$visittimers[$spot][name]]} {$visittimers[$spot][respawn]};
};
#else {
#math {mins} { (($current_time - $visittimers[$spot]) + 0.5) / 60 };
#if {$mins > 99} { #var {mins} {99} };
#if {$mins > 10} {
#format {spotstring} { - (%dm) %s } {$mins} {$spotname};
#continue;
};
#else {
#format {spotstring} { - (0%dm) %s } {$mins} {$spotname};
}
#var {spotstring} {@write_spot{$visittimers[$spot][name];$visittimers[$spot][time];$visittimers[spot][respawn]}};
#line {log} {$xptimer_file} {$spotstring};
}
#foreach {$spot_groups[]} {spot} {
#var {spotstring} {@write_spot{$spot;$spot_groups[$spot];$spot_groups_respawn[$spot]}};
#line {log} {$xptimer_file} {$spotstring};
}
}
@ -231,14 +451,12 @@
#var {syncname} {$syncitem[1]};
#var {synctime} {$syncitem[2]};
#foreach {$killtimer_names[]} {spotident} {
#var {spotname} {$killtimer_names[$spotident]};
#foreach {$killtimers[]} {spotident} {
#var {spotname} {$killtimers[$spotident][name]};
#if {"$spotname" == "$syncname"} {
#if {$killtimers[$spotident] < $synctime} {
#var {killtimers[$spotident]} {$synctime};
#var {killtimers[$spotident][time]} {$synctime};
#math {synccount} {$synccount + 1};
};
};
}
}
@ -247,14 +465,12 @@
#var {syncname} {$syncitem[1]};
#var {synctime} {$syncitem[2]};
#foreach {$visittimer_names[]} {spotident} {
#var {spotname} {$visittimer_names[$spotident]};
#foreach {$visittimers[]} {spotident} {
#var {spotname} {$killtimers[$spotident][name]};
#if {"$spotname" == "$syncname"} {
#if {$visittimers[$spotident] < $synctime} {
#var {visittimers[$spotident]} {$synctime};
#var {visittimers[$spotident][time]} {$synctime};
#math {synccount} {$synccount + 1};
};
};
}
}
@ -266,16 +482,16 @@
#var {dtsync_msg} {};
#var {vtsync_msg} {};
#foreach {$killtimer_names[]} {spotident} {
#if {$killtimers[$spotident] > 0} {
#format {dtsync_msg} {%s,%s=%d} {$dtsync_msg}{$killtimer_names[$spotident]}{$killtimers[$spotident]};
#foreach {$killtimers[]} {spotident} {
#if {$killtimers[$spotident][time] > 0} {
#format {dtsync_msg} {%s,%s=%d} {$dtsync_msg}{$killtimers[$spotident][name]}{$killtimers[$spotident][time]};
};
}
#regex {$dtsync_msg} {^,{(.+)}$} { #var {dtsync_msg} {&1}; };
#foreach {$visittimer_names[]} {spotident} {
#if {$visittimers[$spotident] > 0} {
#format {vtsync_msg} {%s,%s=%d} {$vtsync_msg}{$visittimer_names[$spotident]}{$visittimers[$spotident]};
#foreach {$visittimers[]} {spotident} {
#if {$visittimers[$spotident][time] > 0} {
#format {vtsync_msg} {%s,%s=%d} {$vtsync_msg}{$visittimers[$spotident][name]}{$visittimers[$spotident][time]};
};
}
#regex {$vtsync_msg} {^,{(.+)}$} { #var {vtsync_msg} {&1}; };
@ -290,22 +506,27 @@
#var {room_info} {%1};
#foreach {$visittimers[]} {spot} {
#regex {$room_info} {$spot} {
#format {visittimers[$spot]} {%T};
#format {visittimers[$spot][time]} {%T};
}
}
}
#ALIAS {gsdt} {
#var {gsdt_string} {};
#var {spot_groups} {};
#var {group_spot_label} {};
#foreach {$killtimers[]} {spot} {
#format {spotname} {$killtimer_names[$spot]};
#format {spotname} {$killtimers[$spot][name]};
#var {mins} {???};
#if {$killtimers[$spot] == 0} {
#if {$killtimers[$spot][time] == 0} {
#format {spotstring} {%s: ??? |} {$spotname};
};
#else {
#math {mins} { (($current_time - $killtimers[$spot]) + 0.5) / 60 };
#math {mins} {$current_time - $killtimers[$spot][time]};
#math {mins} {($mins - (60 - 1)) / 60};
#if {$mins > 99} { #var {mins} {99} };
#if {$mins < 10} {
@ -316,18 +537,40 @@
};
}
#if {"$killtimers[$spot][group]" == "true"} {
#if {&spot_groups[$killtimers[$spot][name]] == 0} {
#var {spot_groups[$killtimers[$spot][name]]} {$killtimers[$spot][time]};
#var {group_spot_label[$killtimers[$spot][name]]} {$spotstring};
};
#if {$killtimers[$spot][time] < $spot_groups[$killtimers[$spot][name]]} {
#var {spot_groups[$killtimers[$spot][name]]} {$killtimers[$spot][time]};
#var {group_spot_label[$killtimers[$spot][name]]} {$spotstring};
};
#continue;
};
#format {gsdt_string} {%s %s} {$gsdt_string} {$spotstring};
}
#foreach {$spot_groups} {spot} {
#format {gsdt_string} {%s %s} {$gsdt_string} {$group_spot_label[$spot]};
};
#var {spot_groups} {};
#var {group_spot_label} {};
#foreach {$visittimers[]} {spot} {
#format {spotname} {$visittimer_names[$spot]};
#format {spotname} {$visittimers[$spot][name]};
#var {mins} {???};
#if {$visittimers[$spot] == 0} {
#if {$visittimers[$spot][time] == 0} {
#format {spotstring} {%s: ??? |} {$spotname};
};
#else {
#math {mins} { (($current_time - $visittimers[$spot]) + 0.5) / 60 };
#math {mins} {$current_time - $visittimers[$spot][time]};
#math {mins} {($mins - (60 - 1)) / 60};
#if {$mins > 99} { #var {mins} {99} };
#if {$mins < 10} {
@ -338,9 +581,26 @@
};
}
#if {"$visittimers[$spot][group]" == "true"} {
#if {&spot_groups[$visittimers[$spot][name]] == 0} {
#var {spot_groups[$visittimers[$spot][name]]} {$visittimers[$spot][time]};
#var {group_spot_label[$visittimers[$spot][name]]} {$spotstring};
};
#if {$visittimers[$spot][time] < $spot_groups[$visittimers[$spot][name]]} {
#var {spot_groups[$visittimers[$spot][name]]} {$visittimers[$spot][time]};
#var {group_spot_label[$visittimers[$spot][name]]} {$spotstring};
};
#continue;
};
#format {gsdt_string} {%s %s} {$gsdt_string} {$spotstring};
}
#foreach {$spot_groups} {spot} {
#format {gsdt_string} {%s %s} {$gsdt_string} {$group_spot_label[$spot]};
};
#regex {$gsdt_string} {^{(.+)} \|$} {#var {gsdt_string} {&1}; };
#send {group say $gsdt_string};

3
src/tpamonitor.tin

@ -61,7 +61,8 @@
#alias {/break_tpa} {
#showme {\a\a};
#if {&{tpa_start}} {
#math {tpa_dur} { (($tpa_end - $tpa_start) + 0.5) / 60 };
#math {tpa_dur} {$tpa_end - $tpa_start};
#math {tpa_dur} {($tpa_dur - (60 - 1)) / 60};
#echo {<168>*** TPA broken! (lasted for $tpa_dur minutes) ***<099>};
}

Loading…
Cancel
Save