tags for BeBot's color module // Changed nano to ninit to avoid problems // //V 1.04 by Temar // Updated to 0.4+ // Added !nanoinit as an Alterative if u use !nano already // Droped 3 variable req down to 2 (ur skill isnt required) // //V 1.03 by Parfet // Corrected copy/paste error in !init // //V 1.02 by Parfet // Reworked !nano // // V 1.01 by Parfet // Recoded to make it work with BEBOT // // V 1.0 by Nogoal // 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); /* The Class itself... */ class Init extends BaseActiveModule { var $bot; /* Constructor: Hands over a referance to the "Bot" class. */ function __construct (&$bot) { parent::__construct(&$bot, get_class($this)); //Register commands $this -> bot = &$bot; $this -> register_command('tell', 'init', 'GUEST'); $this -> register_command('gc', 'init', 'GUEST'); $this -> register_command('pgmsg', 'init', 'GUEST'); $this -> register_command('tell', 'ninit', 'GUEST'); $this -> register_command('gc', 'ninit', 'GUEST'); $this -> register_command('pgmsg', 'ninit', 'GUEST'); $this -> register_command('tell', 'as', 'GUEST'); $this -> register_command('gc', 'as', 'GUEST'); $this -> register_command('pgmsg', 'as', 'GUEST'); $this -> bot -> core("colors") -> define_scheme("init", "sub", "bluegray"); $this -> help['description'] = 'Inits/AS Calculator - BEBOT Plugin - Version 1.05.1'; $this -> help['command']['init ']="Shows Weapon Info Based on the Stats you give."; $this -> help['command']['ninit ']="Shows Nanocasting Info Based on the Stats you give."; $this -> help['command']['as ']="Shows Aim Shot Info Based on the Stats you give."; $this -> help['notes'] = 'the Skill Requirement is Optional'; } function tell($name, $msg) { $this -> command_handler($name, $msg, "tell"); } function gc($name, $msg) { $this -> command_handler($name, $msg, "gc"); } function pgmsg($name, $msg) { $this -> command_handler($name, $msg, "pgmsg"); } /* This gets called on private channel with the command */ function command_handler($name, $msg, $origin) { $vars = explode(' ', $msg); $ver = explode(".", $this -> bot -> botversion); if($ver[1] < 5) { if (!empty($this -> bot -> commpre)) { $vars[0] = substr($vars[0], 1); } } if(count($vars) > 4) $msg = "##error##Error: Too Many Variables Given##end##"; elseif(count($vars) < 3) $msg = "##error##Error: Not enough Variables Given##end##"; else Switch(strtolower($vars[0])) { case'init': $msg = $this -> init_blob($vars[1], $vars[2], $vars[3]); break; case'ninit': $msg = $this -> nano_blob($vars[1], $vars[2], $vars[3]); break; case'as': $msg = $this -> as_blob($vars[1], $vars[2], $vars[3]); break; Default: $msg = "##error##Error : Broken plugin, recieved unhandled command: ".$vars[0]."##end##"; } $this -> bot -> send_output($name, $msg, $origin); } /* 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-$RechT+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-$RechT+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-$RechT+4)*(-900)))+1200,0); } if( $Initatta3 < $Initrech3 ) $Init3 = $Initrech3; else { $Init3 = $Initatta3; } $inside = "##blob_title##::: Weapons Inits Calculator - Version 1.05.1 :::##end##\n\n"; $inside .= "##init_sub##Attack:##end## ##highlight##". $AttTim ."##end## ##blob_text##second(s).##end##\n"; $inside .= "##init_sub##Recharge:##end## ##highlight##". $RechT ."##end## ##blob_text##second(s).##end##\n"; $inside .= "##init_sub##Init Skill:##end## ##highlight##". $InitS ."##end##\n"; $inside .= "##init_sub##Def/Agg:##end## ##highlight##". $InitResult ."%##end##\n"; $inside .= "##blob_text##You must set your AGG bar at ##highlight##". $InitResult ."% (". round($InitResult*8/100,2) .")##end## ##blob_text##to wield your weapon at 1/1.##end##\n\n"; $inside .= "##init_sub##Init needed for max speed at Full Agg:##end## ##highlight##". $Init1 ."##end## ##blob_text##inits.##end##\n"; $inside .= "##init_sub##Init needed for max speed at Neutral :##end## ##highlight##". $Init2 ."##end## ##blob_text##inits.##end##\n"; $inside .= "##init_sub##Init needed for max speed at Full Def:##end## ##highlight##". $Init3 ."##end## ##blob_text##inits.##end##\n"; return $this -> bot -> core("tools") -> 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) + 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; $inside = "##blob_title##::: Nano Init Calculator - Version 1.05.1 :::##end##\n\n"; $inside .= "##init_sub##Attack:##end## ##highlight##". $AttTim ."##end## ##blob_text##second(s).##end##\n"; $inside .= "##init_sub##Recharge:##end## ##highlight##". $RechT ."##end## ##blob_text##second(s).##end##\n"; $inside .= "##init_sub##Init Skill:##end## ##highlight##". $InitS ."##end##\n"; $inside .= "##init_sub##Def/Agg:##end## ##highlight##". $InitResult ."%##end##\n"; $inside .= "##blob_text##You must set your AGG bar at##end## ##highlight##". $InitResult ."% (". round($InitResult*8/100,2) .")##end## ##blob_text##to instacast your nano.##end##\n\n"; $inside .= "##init_sub##NanoC. Init needed to instacast at Full Agg:##end## ##highlight##". $Init1 ."##end## ##blob_text##inits.##end##\n"; $inside .= "##init_sub##NanoC. Init needed to instacast at Neutral :##end## ##highlight##". $Init2 ."##end## ##blob_text##inits.##end##\n"; $inside .= "##init_sub##NanoC. Init needed to instacast at Full Def:##end## ##highlight##". $Init3 ."##end## ##blob_text##inits.##end##\n"; return $this -> bot -> core("tools") -> 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 = "##blob_title##::: AS Calculator - Version 1.05.1 :::##end##\n\n"; $inside .= "##init_sub##Attack:##end## ##highlight##". $AttTim ."##end## ##blob_text##second(s).##end##\n"; $inside .= "##init_sub##Recharge:##end## ##highlight##". $RechT ."##end## ##blob_text##second(s).##end##\n"; $inside .= "##init_sub##AS Skill:##end## ##highlight##". $ASS ."##end##\n"; $inside .= "##init_sub##AS Multiplier:##end## ##highlight##1-". $MultiP ."x##end##\n"; $inside .= "##init_sub##AS Recharge:##end## ##highlight##". $ASRech ."##end##\n"; $inside .= "##init_sub##AS Skill needed to cap:##end## ##highlight##". round($ASCap,0) ."##end## ##blob_text##for##end## ##highlight##". round($RechT+10,0) ."##end####blob_text##s.##end##\n\n"; $inside .= "##init_sub##Specials Refresh Formulae:##end## ##blob_text##(Main Source 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##end##"; return $this -> bot -> core("tools") -> make_blob("AS Calculator :: Click for results", $inside); } } ?>