Archive > AO 0.6.x Custom/Unofficial modules

[AO] XP, AXP and research module.

(1/4) > >>

Nogoal:
Most recent version I could find was for 0.4 and axp calculation seemed wrong to me.

So I updated it to work with 0.6, corrected AI calc and added LE research.

Xp.phps

Khalem:
Nice one.

Just for reference, the command handling would benefit from being upgraded too when upgrading modules from 0.4

--- Code: --- /*
Unified message handler
$source: The originating player
$msg: The actual message, including command prefix and all
$type: The channel the message arrived from. This can be either "tell", "pgmsg" or "gc"
*/
function command_handler($source, $msg, $origin)
{
//ALWAYS reset the error handler before parsing the commands to prevent stale errors from giving false reports
$this->error->reset();

//The default is to split the command to com, sub and args. If you want to split it some other way change the pattern for it
//parse_com() returns an array where the pattern is the keys and the values are split out from $msg
$com = $this->parse_com($msg, array('com', 'sub', 'args'));

$command = $vars[0];

switch($com['com'])
{
case 'command1':
return($this -> somefunction($name, $com));
break;
case 'command2':
return($this -> someotherfunction($name, $com));
default:
// Just a safety net to allow you to catch errors where a module has registered  a command, but fails to actually do anything about it
$this -> error -> set("Broken plugin, recieved unhandled command: $command");
return($this->error->message());
}
}

--- End code ---

Nogoal:
Updated

Waqu:
Is this mod still working and wtb install / usage instructions.

Shelly:

--- Quote from: Waqu on August 11, 2011, 10:58:24 pm ---Is this mod still working and wtb install / usage instructions.

--- End quote ---
1. Download the Xp.phps from the 1st posting and save it in your "bot/custom/modules" folder.
2. Rename it to Xp.php
3. restart your bot

/tell <yourbot> !help xp
/tell <yourbot> !help axp
/tell <yourbot> !help lexp


 :)
Shelly

Navigation

[0] Message Index

[#] Next page

Go to full version