Battletech: The Frontier Lands :: Forums :: The Frontier Forums :: Game Discussion
 
<< Previous thread | Next thread >>
Juicy Xpert helpfulness for 3027
Moderators: Devlin Stone, Power Shaper, GeeOhDee, Paddock, Captain QB
Author Post
Huck
Wed Jul 22 2009, 02:00PM
Registered Member #3696
Joined: Fri Oct 10 2008, 12:24PM
Posts: 1
setWriteRegExps(qr/^$/, qr/^#HUD|^MOTD/);
addTrigger("STARTUP",qr/MOTD/,sub {
parse("xperthud.pl");
parse("battlerecorder.pl");
delTrigger(qr/^STARTUP$/);
shift;
});

################################# Claim Timer ##############################
{
my $claimStart=0;
my $claimTime=0;

addTrigger("CLAIM_TIMER",
qr/^Complex claim initiated\. Claim will complete in \d+ minutes\./,
sub {
my $line = shift;
if($line =~ m/in (\d+)/) {
$claimTime=$1*60;
$claimStart=time;
statusWindow->setFGColor(BLUE);
statusWindow->print("Claim Noted.\n");
statusWindow->resetAttributes();
} $line;}, 0, 1);

addAlias("CLAIM_TIMER",qr/^cclaim/,
sub {
if(time < $claimStart + $claimTime) {
my $rest = $claimStart + $claimTime - time;
statusWindow->setFGColor(BLUE);
statusWindow->print(sprintf("Claim will be done in %02d:%02d\n",
(int($rest/60)),($rest%60)));
statusWindow->resetAttributes();
} else {
statusWindow->setFGColor(BLUE);
statusWindow->print("I dont know any ongoing Claims.\n");
statusWindow->resetAttributes();
}
return undef;
}, 1);

addAlias("CLAIM_TIMER",qr/^setclaim \d+/,
sub {
my $line = shift;
if($line =~ m/setclaim (\d+)/) {
$claimTime=$1*60;
$claimStart=time;
statusWindow->setFGColor(BLUE);
statusWindow->print("Claim set.\n");
statusWindow->resetAttributes();
}
return undef;
} , 1);

my $rclaimsub=sub {
if(time < $claimStart + $claimTime) {
my $rest = $claimStart + $claimTime - time;
XM::sendText(sprintf("sendchannel $reportChannel=TOC on Complex %02d:%02d\n",
(int($rest/60)),($rest%60)));
} else {
statusWindow->setFGColor(BLUE);
statusWindow()->print("I dont know any ongoing Claims.\n");
statusWindow->resetAttributes();
}
return undef;
};

addAlias("CLAIM_TIMER",qr/^rclaim/,$rclaimsub,1);

addAlias("CLAIM_TIMER", qr/^autotoc(\s+\d+)?/,
sub {
my $interval=5*60;
my $line = shift;
if($line =~ /^autotoc\s+(\d+)/) {
$interval = $1*60;
}
if ($interval>0) {
if(time < $claimStart + $claimTime) {
statusWindow->setFGColor(BLUE);
statusWindow->print("AutoTOC started. Will report every $interval seconds.\n");
statusWindow->resetAttributes();

delDelayed("^CLAIM_TIMER");
my $calltime = $claimStart + $claimTime-$interval;
while($calltime > time) {
addDelayed("CLAIM_TIMER",$calltime-time, $rclaimsub);
$calltime -= $interval;
}
} else {
statusWindow->setFGColor(BLUE);
statusWindow->print("I dont know any ongoing Claims.\n");
statusWindow->resetAttributes();
}
} else {
delDelayed("^CLAIM_TIMER");
statusWindow->setFGColor(BLUE);
statusWindow->print("AutoTOC disengaged.\n");
statusWindow->resetAttributes();
}
return undef;
} ,1);

}

################################# Frequencies ##############################

addTrigger("START_FREQ","================================= Frequencies ================================",sub {
setTriggerState("^FREQ_",1);
return $_;
}, 0, 1);

addTrigger("END_FREQ", "==============================================================================",sub {
setTriggerState("^FREQ_",0);
return $_;
}, 0, 1);

addTrigger("FREQ_MAIN","Main:.+(\\d+)",sub {
my $line=shift;
if ($line=~/(\d\d\d\d+)/) {
XM::sendText("&F_MAIN me=$1\n");
}
return $line;
}, 0,0);

addTrigger("FREQ_BACKUP1","Backup:.+(\\d+)",sub {
my $line=shift;
if ($line=~/(\d\d\d\d+)/) {
XM::sendText("&F_BACKUP1 me=$1\n");
}
return $line;
}, 0,0);

addTrigger("FREQ_BACKUP2","Backup2:.+(\\d+)",sub {
my $line=shift;
if ($line=~/(\d\d\d\d+)/) {
XM::sendText("&F_BACKUP2 me=$1\n");
}
return $line;
}, 0,0);

addTrigger("FREQ_SCREAM1","Scream:.+(\\d+)",sub {
my $line=shift;
if ($line=~/(\d\d\d\d+)/) {
XM::sendText("&F_SCREAM1 me=$1\n");
}
return $line;
}, 0,0);

addTrigger("FREQ_SCREAM2","Scream2:.+(\\d+)",sub {
my $line=shift;
if ($line=~/(\d\d\d\d+)/) {
XM::sendText("&F_SCREAM2 me=$1\n");
}
return $line;
}, 0,0);

addTrigger("FREQ_STRIKE","Strike:.+(\\d+)",sub {
my $line=shift;
if ($line=~/(\d\d\d\d+)/) {
XM::sendText("&F_STRIKE me=$1\n");
}
return $line;
}, 0,0);

addTrigger("FREQ_HEAVY","Heavy:.+(\\d+)",sub {
my $line=shift;
if ($line=~/(\d\d\d\d+)/) {
XM::sendText("&F_HEAVY me=$1\n");
}
return $line;
}, 0,0);

addTrigger("FREQ_CHAT","Chat:.+(\\d+)",sub {
my $line=shift;
if ($line=~/(\d\d\d\d+)/) {
XM::sendText("&F_CHAT me=$1\n");
}
return $line;
}, 0,0);

{
# Configure your prefered channel settings here
my %mapping = (# primary channel, Modes, Backup channel, mode, backup slot
a=>["F_MAIN","DG","F_BACKUP1","DR","f"],
b=>["F_SCREAM1","R","F_SCREAM2","R","g"],
c=>["F_STRIKE","DY"],
d=>["F_HEAVY","DM"],
e=>["F_CHAT","DW"]
);
my $cmd="";
foreach my $c (keys %mapping) {
$cmd.="\@force me=setchannelfreq $c=[v($mapping{$c}->[0])]\n";
}
# TODO: keep them here, or set a character-script? or both?
addAlias("SET_RADIO_FREQS","^setallfreqs",$cmd ,1);

$cmd="";
foreach my $c (keys %mapping) {
my $mode=$mapping{$c}->[1];
if ($mode=~/E/) {
$mode =~ s/E//g;
$cmd.="setchannelmode $c=$mode\n";
}
$cmd.="setchannelmode $c=$mapping{$c}->[1]\n";
}
addAlias("SET_RADIO_MODES","^setallmodes",$cmd ,1);

$cmd="";
foreach my $c (keys %mapping) {
$cmd.="setchannelfreq $c=0\n";# or set random?
if (defined $mapping{$c}->[4]) {
$cmd.="setchannelfreq $mapping{$c}->[4]=0\n";
}
}
addAlias("ZERO_RADIO_FREQS","^zeroallfreqs",$cmd,1);

$cmd="";
foreach my $c (keys %mapping) {
next unless defined $mapping{$c}->[2];
$cmd.="\@force me=setchannelfreq $c=[get(me/$mapping{$c}->[2])]\n";
$cmd.="\@force me=setchannelfreq $mapping{$c}->[4]=[v($mapping{$c}->[0])]\n";
my $mode=$mapping{$c}->[3];
if ($mode=~/E/) {
$mode =~ s/E//g;
$cmd.="setchannelmode $c=$mode\n";
}
$cmd.="setchannelmode $mapping{$c}->[4]=$mapping{$c}->[3]\n";
}
addAlias("GO_RADIO_BACKUP","^setbackupfreqs",$cmd,1);

$cmd ="\@force me=setchannelfreq a=[v($mapping{b}->[0])]\n";
$cmd.="\@force me=setchannelmode a=$mapping{b}->[1]\n";
addAlias("INIT_MECHWARRIOR","^initmw",$cmd,1);

}


Mushi modded one of the scripts for xpertmud:

Stick this code into a file and name it bt3027.pl and drop the .PL into xpertmud/appdata/perl with the rest

You can edit bookmark -> Scripting -> #parse 'bt3027.pl'

to get it running. Make sure to use single quotes!

This allows several things. You can now +miread 2/latest and it will automatically grab the frequencies and set them on your char.

Enter your mech and utilise the following commands:

setallfreqs (sets channels a-e as main/scream/strike/heavy/chat)

setallmodes (sets modes as set out in bt3027.pl) ---> If you open that file in a code editor, notepad++ is good, then you will notice a ##Frequencies section. Go down a bit and modify

# Configure your prefered channel settings here
my %mapping = (# primary channel, Modes, Backup channel, mode, backup slot
a=>["F_MAIN","DG","F_BACKUP1","DR","f"],
b=>["F_SCREAM1","R","F_SCREAM2","R","g"],
c=>["F_STRIKE","DY"],
d=>["F_HEAVY","DM"],
e=>["F_CHAT","DW"]
);

Here you can change the order of what channels you want where for the 'setallfreqs' command as well as the default mode you want!

If you can deaded, you can use 'zeroallfreqs' or my other frequency randomiser or if you have to go backup, type 'setbackupfreqs'.

This will shift the old channels to the bottom, and set the backup channel into the A channel , as well as change the colors to more scary looking backup ones!


Other features of interest...:

Type 'setclaim ' when an enemy claim pops up to set a timer. You can check how long is left with 'cclaim' or 'rclaim' which will radio how long is left. You can also type 'autotoc' to radio the timer left every 6 minutes...or if you want to modify it whatever time you like!



ALL credit goes to MUSHI

[ Edited Wed Jul 22 2009, 02:02PM ]
Back to top
 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System