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

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

Author Topic: Using scripts to make modules  (Read 1638 times)

0 Members and 1 Guest are viewing this topic.

Offline Karsta

  • BeBot User
  • **
  • Posts: 28
  • Karma: +0/-0
Using scripts to make modules
« 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

Offline mcgunman

  • BeBot Rookie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: Using scripts to make modules
« Reply #1 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);
        }
}
?>

 

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


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 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: 659
  • 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