BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => AO 0.6 support => Topic started by: Karsta on November 11, 2011, 12:45:28 pm

Title: Using scripts to make modules
Post by: Karsta on November 11, 2011, 12:45:28 pm
Hey, is there kinda easyway to use script that i have on AO to convert to bot command that bot would post it.

Expample like gauntlet TS guide Skils window that shows hided skills etc.

So basicly i would need somekinda ready php to just add script somewhere :D
Title: Re: Using scripts to make modules
Post by: mcgunman on November 26, 2011, 05:00:14 pm
just take any module e.g. that code below and place the script stuff in $output and rename $stats. If that's to complicate for you I suggest you find someone to do it for you. ^^

Code: [Select]
<?php
$stats 
= new stats($bot);

class 
stats extends BaseActiveModule
{
        function 
__construct (&$bot)
        {
                
parent::__construct(&$botget_class($this));

                
$this -> register_command("all""stats""MEMBER");
                
$this -> help['description'] = "Shows hidden stats List.";
                
$this -> help['command']['stats']="Shows hidden stats List.";
        }

        function 
command_handler($source$msg$type)
        {
                
$this->error->reset();

                
$com $this->parse_com($msg, array('com''sub''args'));

                
$command $vars[0];

                switch(
$com['com'])
                {
                        case 
'stats':
                                return(
$this -> stats($source$type));
                                break;
                        default:
                                
$this -> error -> set("Broken plugin, recieved unhandled command: $command");
                                return(
$this->error->message());
                }
        }

        function 
stats ($source$type )
        {
                
$output='<place your script in here>';
                
$this -> bot -> send_output($source$output$type);
        }
}
?>
SimplePortal 2.3.7 © 2008-2024, SimplePortal