BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => 0.2.x Custom/Unofficial Modules => Topic started by: Nogoal on July 05, 2006, 10:53:47 am

Title: !init Module
Post by: Nogoal on July 05, 2006, 10:53:47 am
I dunno why nobody thought about doing that module before so I did it : ). This module tell you where to set up your AGG/DEF bar. It also gives some info about inits needed for your weapons/nano. I added some information about AS and formulae for other specials.

!help !init / !nano / !as for more infos.


>Download (http://ao.inutiles.be/Init.rar)<


PS: I'm using RINGbot but it should work on BeBot too I guess, didn't tried.

Edit: I updated files to version 1.03 thanks to Parfet
Title: Re: !init Module
Post by: Sammajos on July 05, 2006, 08:52:14 pm

require_once("./includes/ModuleBase.php");

i missed that in your init.rar file ;)
Title: Re: !init Module
Post by: Nogoal on July 10, 2006, 10:34:51 am
Well like I said it's for RINGbot. So I added a version for bebot in the rar, didn't tested but should work.
Title: Re: !init Module
Post by: Barvaz on July 21, 2006, 06:40:48 pm
not working in bebot..

Fatal error: Access to undeclared static property: 
Init::$instance in C:\red\modules\Init.php on line 31
Title: Re: !init Module
Post by: Parfet on January 24, 2007, 02:08:05 pm
This is a great plugin, and I use it constantly on my main org's ign bot, I wanted it for my BeBot 0.2.10, but it wouldn't run due to missing functions and other problems... I recoded it from the one posted above, and it works.

Code: [Select]
<?
/*
*
////////////////  RINGBOT plugin ::Inits:: by NoGoal V1.00 //////////////
//
// V 1.0
// First release with code redone for RINGBOT
//
///////////////
*
* Init.php rewrite by Parfet (RK2)
* recoded off original plugin due to incompatabilities
*
* BeBot - An Anarchy Online Chat Automaton
* Copyright (C) 2004 Jonas Jax
*
* Developed by Blondengy (RK1)
* Special thanks goes out to Khalem (RK1) for his support.
*
*/

/*
Add a "_" at the beginning of the file (_Init.php) if you do not want it to be loaded.
*/

$init = new init($bot);

$commands["tell"]["init"] = &$init;
$commands["pgmsg"]["init"] = &$init;
$commands["gc"]["init"] = &$init;
$commands["tell"]["nano"] = &$init;
$commands["pgmsg"]["nano"] = &$init;
$commands["gc"]["nano"] = &$init;
$commands["tell"]["as"] = &$init;
$commands["pgmsg"]["as"] = &$init;
$commands["gc"]["as"] = &$init;

/*
The Class itself...
*/
class init
{
var $bot;

/*
Constructor:
Hands over a referance to the "Bot" class.
*/
function init (&$bot)
{
$this -> bot = &$bot;
}

/*
This gets called on a tell with the command
*/
function tell($name, $msg) {
if (preg_match("/^" . $this -> bot -> commpre . "init (.+) (.+) (.+)/i", $msg, $info))
$this->bot->send_tell($name, $this->init_blob($info[1],$info[2],$info[3]));

else if (preg_match("/^" . $this -> bot -> commpre . "nano (.+) (.+) (.+)/i", $msg, $info))
$this->bot->send_tell($name, $this->nano_blob($info[1],$info[2],$info[3]));

else if (preg_match("/^" . $this -> bot -> commpre . "as (.+) (.+) (.+)/i", $msg, $info))
$this->bot->send_tell($name, $this->as_blob($info[1],$info[2],$info[3]));
}

/*
This gets called on guild channel with the command
*/
function gc($name, $msg) {
if (preg_match("/^" . $this -> bot -> commpre . "init (.+) (.+) (.+)/i", $msg, $info))
$this->bot->send_gc($this->init_blob($info[1],$info[2],$info[3]));

else if (preg_match("/^" . $this -> bot -> commpre . "nano (.+) (.+) (.+)/i", $msg, $info))
$this->bot->send_gc($this->nano_blob($info[1],$info[2],$info[3]));

else if (preg_match("/^" . $this -> bot -> commpre . "as (.+) (.+) (.+)/i", $msg, $info))
$this->bot->send_gc($this->as_blob($info[1],$info[2],$info[3]));
}

/*
This gets called on private channel with the command
*/
function pgmsg($name, $msg) {
if (preg_match("/^" . $this -> bot -> commpre . "init (.+) (.+) (.+)/i", $msg, $info))
$this->bot->send_pgroup($this->init_blob($info[1],$info[2],$info[3]));

else if (preg_match("/^" . $this -> bot -> commpre . "nano (.+) (.+) (.+)/i", $msg, $info))
$this->bot->send_pgroup($this->nano_blob($info[1],$info[2],$info[3]));

else if (preg_match("/^" . $this -> bot -> commpre . "as (.+) (.+) (.+)/i", $msg, $info))
$this->bot->send_pgroup($this->as_blob($info[1],$info[2],$info[3]));
}

/*
Makes the init-blob
*/
function init_blob($AttTim,$RechT,$InitS) {

if( $InitS < 1200 )
{
$AttCalc = round(((($AttTim - ($InitS / 600)) - 1)/0.02) + 87.5, 0);
$RechCalc = round(((($RechT - ($InitS / 300)) - 1)/0.02) + 87.5, 0);
}
else
{
$InitSk = $InitS - 1200;
$AttCalc = round(((($AttTim - (1200/600) - ($InitSk / 600 / 3)) - 1)/0.02) + 87.5, 0);
$RechCalc = round(((($RechT - (1200/300) - ($InitSk / 300 / 3)) - 1)/0.02) + 87.5, 0);
}

if( $AttCalc < $RechCalc ) $InitResult = $RechCalc;
else { $InitResult = $AttCalc; }
if( $InitResult < 0 ) $InitResult = 0;
if( $InitResult > 100 ) $InitResult = 100;

$Initatta1 = round((((100 - 87.5) * 0.02) + 1 - $AttTim) * (-600),0);
$Initrech1 = round((((100-87.5)*0.02)+1-$RechT)*(-300),0);
if($Initatta1 > 1200) { $Initatta1 = round((((((100-87.5)*0.02)+1-$AttTim+2)*(-1800)))+1200,0); }
if($Initrech1 > 1200) { $Initrech1 = round((((((100-87.5)*0.02)+1-$AttTim+4)*(-900)))+1200,0); }
if( $Initatta1 < $Initrech1 ) $Init1 = $Initrech1;
else { $Init1 = $Initatta1; }

$Initatta2 = round((((87.5-87.5)*0.02)+1-$AttTim)*(-600),0);
$Initrech2 = round((((87.5-87.5)*0.02)+1-$RechT)*(-300),0);
if($Initatta2 > 1200) { $Initatta2 = round((((((87.5-87.5)*0.02)+1-$AttTim+2)*(-1800)))+1200,0); }
if($Initrech2 > 1200) { $Initrech2 = round((((((87.5-87.5)*0.02)+1-$AttTim+4)*(-900)))+1200,0); }
if( $Initatta2 < $Initrech2 ) $Init2 = $Initrech2;
else { $Init2 = $Initatta2; }

$Initatta3 = round((((0-87.5)*0.02)+1-$AttTim)*(-600),0);
$Initrech3 = round((((0-87.5)*0.02)+1-$RechT)*(-300),0);
if($Initatta3 > 1200) { $Initatta3 = round((((((0-87.5)*0.02)+1-$AttTim+2)*(-1800)))+1200,0); }
if($Initrech3 > 1200) { $Initrech3 = round((((((0-87.5)*0.02)+1-$AttTim+4)*(-900)))+1200,0); }
if( $Initatta3 < $Initrech3 ) $Init3 = $Initrech3;
else { $Init3 = $Initatta3; }

$inside  = "<font color=#DFDF00>::: AGG/DEF Calculator - RINGBOT Plugin - Version 1.01 :::</font><font color=#CCF0AD>\nRecoded for BeBot by Parfet (RK2)\n\n";
$inside .= "RINGBot (c) - a BeBot branch.\nDeveloped by Zacix\nOriginal Bebot (c) source by BlondEngy\nScript by Nogoal\n\n* BeBot - An Anarchy Online Chat Automaton\n* Copyright (C) 2004 Jonas Jax\n*\n* Developed by Blondengy (RK1)\n\n";
$inside .= "Results:\n";
$inside .= "Attack:</font><font color=#97BE37> ". $AttTim ." </font><font color=#CCF0AD>second(s).\n";
$inside .= "Recharge: </font><font color=#97BE37>". $RechT ." </font><font color=#CCF0AD>second(s).\n";
$inside .= "Init Skill: </font><font color=#97BE37>". $InitS ."</font><font color=#CCF0AD>\n";
$inside .= "Def/Agg: </font><font color=#97BE37>". $InitResult ."%</font><font color=#CCF0AD>\n";
$inside .= "You must set your AGG bar at </font><font color=#97BE37>". $InitResult ."% (". round($InitResult*8/100,2) .") </font><font color=#CCF0AD>to wield your weapon at 1/1.\n\n";
$inside .= "Init needed for max speed at Full Agg: </font><font color=#97BE37>". $Init1 ." </font><font color=#CCF0AD>inits.\n";
$inside .= "Init needed for max speed at neutral (88%bar): </font><font color=#97BE37>". $Init2 ." </font><font color=#CCF0AD>inits.\n";
$inside .= "Init needed for max speed at Full Def: </font><font color=#97BE37>". $Init3 ." </font><font color=#CCF0AD>inits.\n";

return $this->bot->make_blob("AGG/DEF :: Click for results", $inside);
}

/*
Makes the nano-blob
*/
function nano_blob($AttTim,$RechT,$InitS) {

if( $InitS < 1200 )
{
$AttCalc = round(((($AttTim - ($InitS / 200)) )/0.02) + 87.5, 0);
$RechCalc = $RechT;
}
else
{
$InitSk = $InitS - 1200;
$AttCalc = round(((($AttTim - (1200/200) - ($InitSk / 200 / 6)))/0.02) + 87.5, 0);
$RechCalc = $RechT;
}

$InitResult = $AttCalc;
if( $InitResult < 0 ) $InitResult = 0;
if( $InitResult > 100 ) $InitResult = 100;

$Initatta1 = round((((100 - 87.5) * 0.02) - $AttTim) * (-200),0);
$Initrech1 = $RechT;
if($Initatta1 > 1200) { $Initatta1 = round((((((100-87.5)*0.02)-$AttTim+6)*(-600)))+1200,0); }
$Init1 = $Initatta1;

$Initatta2 = round((((87.5-87.5)*0.02)-$AttTim)*(-200),0);
$Initrech2 = $RechT;
if($Initatta2 > 1200) { $Initatta2 = round((((((87.5-87.5)*0.02)-$AttTim+6)*(-600)))+1200,0); }
$Init2 = $Initatta2;

$Initatta3 = round((((0-87.5)*0.02)-$AttTim)*(-200),0);
$Initrech3 = $RechT;
if($Initatta3 > 1200) { $Initatta3 = round((((((0-87.5)*0.02)-$AttTim+6)*(-600)))+1200,0); }
$Init3 = $Initatta3;

$inside  = "<font color=#DFDF00>::: Nano AGG/DEF Calculator - RINGBOT Plugin - Version 1.01 :::</font><font color=#CCF0AD>\nRecoded for BeBot by Parfet (RK2)\n\n";
$inside .= "RINGBot (c) - a BeBot branch.\nDeveloped by Zacix\nOriginal Bebot (c) source by BlondEngy\nScript by Nogoal\n\n* BeBot - An Anarchy Online Chat Automaton\n* Copyright (C) 2004 Jonas Jax\n*\n* Developed by Blondengy (RK1)\n\n";
$inside .= "Results:\n";
$inside .= "Attack:</font><font color=#97BE37> ". $AttTim ." </font><font color=#CCF0AD>second(s).\n";
$inside .= "Recharge:</font><font color=#97BE37> ". $RechT ." </font><font color=#CCF0AD>second(s).\n";
$inside .= "Init Skill:</font><font color=#97BE37> ". $InitS ."</font><font color=#CCF0AD>\n";
$inside .= "Def/Agg:</font><font color=#97BE37> ". $InitResult ."%</font><font color=#CCF0AD>\n";
$inside .= "You must set your AGG bar at</font><font color=#97BE37> ". $InitResult ."% (". round($InitResult*8/100,2) .") </font><font color=#CCF0AD>to instacast your nano.\n\n";
$inside .= "NanoC. Init needed to instacast at Full Agg:</font><font color=#97BE37> ". $Init1 ." </font><font color=#CCF0AD>inits.\n";
$inside .= "NanoC. Init needed to instacast at neutral (88%bar):</font><font color=#97BE37> ". $Init2 ." </font><font color=#CCF0AD>inits.\n";
$inside .= "NanoC. Init needed to instacast at Full Def:</font><font color=#97BE37> ". $Init3 ." </font><font color=#CCF0AD>inits.\n";

return $this->bot->make_blob("Nano AGG/DEF :: Click for results", $inside);
}

/*
Makes the AS-blob
*/
function as_blob($AttTim,$RechT,$ASS) {
$capped = round($RechT+10,0);
$ASRech = round(($RechT*40)-($ASS*3)/100, 0);
if($ASRech < $capped) { $ASRech = round($RechT+10,0); }
$MultiP = round($ASS/95,0);
$ASCap = (-10+(39*$RechT))*100/3;

$inside  = "<font color=#DFDF00>::: AS Calculator - RINGBOT Plugin - Version 1.01 :::</font><font color=#CCF0AD>\nRecoded for BeBot by Parfet (RK2)\n\n";
$inside .= "RINGBot (c) - a BeBot branch.\nDeveloped by Zacix\nOriginal Bebot (c) source by BlondEngy\nScript by Nogoal\n\n* BeBot - An Anarchy Online Chat Automaton\n* Copyright (C) 2004 Jonas Jax\n*\n* Developed by Blondengy (RK1)\n\n";
$inside .= "Results:\n";
$inside .= "Attack: </font><font color=#97BE37>". $AttTim ." </font><font color=#CCF0AD>second(s).\n";
$inside .= "Recharge: </font><font color=#97BE37>". $RechT ." </font><font color=#CCF0AD>second(s).\n";
$inside .= "AS Skill: </font><font color=#97BE37>". $ASS ."</font><font color=#CCF0AD>\n";
$inside .= "AS Multiplier:</font><font color=#97BE37> 1-". $MultiP ."x</font><font color=#CCF0AD>\n";
$inside .= "AS Recharge: </font><font color=#97BE37>". $ASRech ."</font><font color=#CCF0AD>\n";
$inside .= "AS Skill needed to cap: </font><font color=#97BE37>". round($ASCap,0) ." </font><font color=#CCF0AD>for </font><font color=#97BE37>". round($RechT+10,0) ."</font><font color=#CCF0AD>s.\n\n";
$inside .= "Specials Refresh Formulae: (<a href='chatcmd:///start http://forums.anarchyonline.com/showthread.php?t=99162'>Main Source</a> by SirAronar)\n
Brawl = 15s
Burst = (Recharge x 20) + Burst Delay/100* - Burst skill/25)
Dimach = 1800s
Fast Attack = (Attack x 16) - Fast skill/100
Fling Shot = (Attack x 16) - Fling skill/100
Full Auto = (Recharge x 40) + Full Auto Delay/100* - FA skill/25
Sneak Attack = 40s
Backstab = 40 - Sneak Attack skill/75

* Those values can be found on aomainframe.info or auno.org</font>";

return $this->bot->make_blob("AS Calculator :: Click for results", $inside);
}

}
?>

You need the above zip yet for the help files.
Hope this helps out someone ;)

btw, I didn't make this plugin, I just made it work, so don't ask me why's & hows, for I do not know.
Title: Re: !init Module
Post by: ghostimage on January 24, 2007, 02:47:48 pm
Thanks muchly, this is always handy information to have available - I'll try it out tonight :)
Title: Re: !init Module
Post by: pusikas on January 24, 2007, 03:33:09 pm
Yep, cant wait to try it out. I am especially interested in the nano init part, never seen a calculator that worked correctly for me. :)
Title: Re: !init Module
Post by: pusikas on January 24, 2007, 10:41:35 pm
Nano init not working correctly. Tells me I need to be at full agg for SOTOS at 2130 nano init, and I can easily instacast it at 50%, at 37.5% with OS. Also, why do you need to give the AS calc your recharge speed? AFAIK, only attack speed goes into the formula.
Title: Re: !init Module
Post by: ghostimage on January 25, 2007, 10:42:09 am
Also, why do you need to give the AS calc your recharge speed? AFAIK, only attack speed goes into the formula.

AS recycle time is based on the recharge time of the weapon. For example you need a lost more AS skill to cap the speed on a weapon with a 2 sec recharge time than it is on a 1.5 sec weapon.
Title: Re: !init Module
Post by: pusikas on January 25, 2007, 01:47:55 pm
That is somehow wrongly explained in some old soldier thread on forum then. Still, the nano init stuff definately isn't working correctly.
Title: Re: !init Module
Post by: pusikas on January 27, 2007, 11:44:41 am
OK, I took a loot at the code, and for nano init, it uses the 87.5% setting as neutral point. For all that I know, this is true for weapons, but not for nanos, where it is the 50% setting. I changed that in the code, and now it gives me numbers that seem to be accurate for inits below 1200. Over that it is still borked, and I do not know the forumula for it. This module assumes that you need 6x as much nano init above 1200. I changed it to 3x as much, and now it gives me numbers that work for my toons. But that may be pure accident, since I pulled that x3 out of my behind. Anyways, it works way better than before for me, so here is the code that I changed:
Code: [Select]
        function nano_blob($AttTim,$RechT,$InitS) {

        if( $InitS < 1200 )
        {
        $AttCalc        = round(((($AttTim - ($InitS / 200)) )/0.02) + 50, 0);
        $RechCalc       = $RechT;
        }
        else
        {
        $InitSk = $InitS - 1200;
        $AttCalc = round(((($AttTim - (1200/200) - ($InitSk / 200 / 3)))/0.02) + 50, 0);
        $RechCalc = $RechT;
        }

        $InitResult = $AttCalc;
        if( $InitResult < 0 ) $InitResult = 0;
        if( $InitResult > 100 ) $InitResult = 100;

        $Initatta1 = round((((100 - 50) * 0.02) - $AttTim) * (-200),0);
        $Initrech1 = $RechT;
        if($Initatta1 > 1200) { $Initatta1 = round((((((100-50)*0.02)-$AttTim+6)*(-600)))+1200,0); }
        $Init1 = $Initatta1;

        $Initatta2 = round((((87.5-50)*0.02)-$AttTim)*(-200),0);
        $Initrech2 = $RechT;
        if($Initatta2 > 1200) { $Initatta2 = round((((((87.5-50)*0.02)-$AttTim+6)*(-600)))+1200,0); }
        $Init2 = $Initatta2;

        $Initatta3 = round((((0-50)*0.02)-$AttTim)*(-200),0);
        $Initrech3 = $RechT;
        if($Initatta3 > 1200) { $Initatta3 = round((((((0-50)*0.02)-$AttTim+6)*(-600)))+1200,0); }
        $Init3 = $Initatta3;
Funnily, now that I look at it... the code already used a x3 for the 100%, 87.5% and 0% setting. So I may be right after all. :)

And once more about the !nano and !as... I guess for me I will remove the requirement to enter the recharge / attack times for those, since they are not used in the calculation at all.
Title: Re: !init Module
Post by: nebhyper on January 27, 2007, 04:52:25 pm
formula for AS is:

Aimed Shot Recharge Time = (Recharge x 40) - (3 x AS skill/100)

so a AS skill of 1,100 and a Weapon recharge of 1.3 seconds would be:

Aimed Shot Recharge Time = (1.3 x 40) - (3 x 1,100/100)

ASRT = 52 - 33

19 seconds Recharge time.


Title: Re: !init Module
Post by: pusikas on January 28, 2007, 01:38:02 pm
OK, is that formula used correctly in the module? Or do you want to say it needs to be changed in that regard as well?
Title: Re: !init Module
Post by: nebhyper on January 28, 2007, 07:05:37 pm
I am saying that is the forumla and it is used correctly.


Quote
And once more about the !nano and !as... I guess for me I will remove the requirement to enter the recharge / attack times for those, since they are not used in the calculation at all.

I was commenting on this.  Don't remove recharge / attack times from !AS as they are needed for the calc.
Title: Re: !init Module
Post by: pusikas on January 28, 2007, 09:32:10 pm
Yes, no, I meant remove the attack time from AS (not needed in the formula) and the recharge time from nano init (is fixed and cant be reduced in any way).
Title: Re: !init Module
Post by: pusikas on January 29, 2007, 03:36:57 am
And another thing about weapon init:
Code: [Select]
if($Initatta2 > 1200) { $Initatta2 = round((((((87.5-87.5)*0.02)+1-$AttTim+2)*(-1800)))+1200,0); }
if($Initrech2 > 1200) { $Initrech2 = round((((((87.5-87.5)*0.02)+1-$AttTim+4)*(-900)))+1200,0); }
can't work correctly, as it uses the weapon's attack time to calculate its recharge. Have to exchange $AttTim for $RechT in 3 instances.
Title: Re: !init Module
Post by: Nogoal on February 05, 2007, 11:45:32 am
Nice that you corrected all these bugs I never bothered with ; ). !init always worked fine so I never had to correct that copy/paste error.

For nano init it's 200 init = -1 and after 1200 it's 600 for -1 so it's x3 like you stated.

For !as and !nano I wanted to keep the same command layout as for !init because ppl where used to !init x x xxx. You don't need AttackTime on !as nor RechargeTime on !nano.

Now I can remove the module from my raidbot and put it on org bot thanks to you ; ).

Edited files in first post
Title: Re: !init Module
Post by: Nogoal on February 05, 2007, 12:24:36 pm
Nano init not working correctly. Tells me I need to be at full agg for SOTOS at 2130 nano init, and I can easily instacast it at 50%, at 37.5% with OS. Also, why do you need to give the AS calc your recharge speed? AFAIK, only attack speed goes into the formula.
With 50% as neutral point

Results:
Attack: 7.15 second(s).
Recharge: 2.5 second(s).
Init Skill: 2130
Def/Agg: 30%
You must set your AGG bar at 30% (2.4) to instacast your nano.

NanoC. Init needed to instacast at Full Agg: 1290 inits.
NanoC. Init needed to instacast at neutral (88%bar): 1440 inits.
NanoC. Init needed to instacast at Full Def: 2490 inits.

With 87.5%

Results:
Attack: 7.15 second(s).
Recharge: 2.5 second(s).
Init Skill: 2130
Def/Agg: 68%
You must set your AGG bar at 68% (5.44) to instacast your nano.

NanoC. Init needed to instacast at Full Agg: 1740 inits.
NanoC. Init needed to instacast at neutral (88%bar): 1890 inits.
NanoC. Init needed to instacast at Full Def: 2940 inits.
SimplePortal 2.3.7 © 2008-2024, SimplePortal