collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18365
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: !init Module  (Read 10705 times)

0 Members and 1 Guest are viewing this topic.

Offline Nogoal

  • BeBot Apprentice
  • ***
  • Posts: 77
  • Karma: +0/-0
!init Module
« 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<


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
« Last Edit: February 05, 2007, 12:08:56 pm by Nogoal »

Offline Sammajos

  • BeBot Rookie
  • *
  • Posts: 9
  • Karma: +0/-0
Re: !init Module
« Reply #1 on: July 05, 2006, 08:52:14 pm »

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

i missed that in your init.rar file ;)

Offline Nogoal

  • BeBot Apprentice
  • ***
  • Posts: 77
  • Karma: +0/-0
Re: !init Module
« Reply #2 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.

Offline Barvaz

  • BeBot Rookie
  • *
  • Posts: 12
  • Karma: +0/-0
Re: !init Module
« Reply #3 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

Offline Parfet

  • BeBot User
  • **
  • Posts: 33
  • Karma: +0/-0
Re: !init Module
« Reply #4 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.
« Last Edit: January 26, 2007, 06:07:37 pm by Parfet »

Offline ghostimage

  • BeBot Rookie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: !init Module
« Reply #5 on: January 24, 2007, 02:47:48 pm »
Thanks muchly, this is always handy information to have available - I'll try it out tonight :)

Offline pusikas

  • BeBot Apprentice
  • ***
  • Posts: 161
  • Karma: +0/-0
Re: !init Module
« Reply #6 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. :)
Luuv  Bot-Keeper of Vengeance ^^*

Offline pusikas

  • BeBot Apprentice
  • ***
  • Posts: 161
  • Karma: +0/-0
Re: !init Module
« Reply #7 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.
« Last Edit: January 24, 2007, 10:43:15 pm by pusikas »
Luuv  Bot-Keeper of Vengeance ^^*

Offline ghostimage

  • BeBot Rookie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: !init Module
« Reply #8 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.

Offline pusikas

  • BeBot Apprentice
  • ***
  • Posts: 161
  • Karma: +0/-0
Re: !init Module
« Reply #9 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.
Luuv  Bot-Keeper of Vengeance ^^*

Offline pusikas

  • BeBot Apprentice
  • ***
  • Posts: 161
  • Karma: +0/-0
Re: !init Module
« Reply #10 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.
« Last Edit: January 27, 2007, 11:53:20 am by pusikas »
Luuv  Bot-Keeper of Vengeance ^^*

Offline nebhyper

  • BeBot User
  • **
  • Posts: 62
  • Karma: +0/-0
Re: !init Module
« Reply #11 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.


Siocuffin (Squad Commander of United Notum Federation)
alts: Nebhyper, Nebalmighty.

Offline pusikas

  • BeBot Apprentice
  • ***
  • Posts: 161
  • Karma: +0/-0
Re: !init Module
« Reply #12 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?
Luuv  Bot-Keeper of Vengeance ^^*

Offline nebhyper

  • BeBot User
  • **
  • Posts: 62
  • Karma: +0/-0
Re: !init Module
« Reply #13 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.
Siocuffin (Squad Commander of United Notum Federation)
alts: Nebhyper, Nebalmighty.

Offline pusikas

  • BeBot Apprentice
  • ***
  • Posts: 161
  • Karma: +0/-0
Re: !init Module
« Reply #14 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).
Luuv  Bot-Keeper of Vengeance ^^*

 

* Recent Posts
0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm ]

* Who's Online
  • Dot Guests: 399
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal