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: Help with online info in GuildInfo Relay Module  (Read 8930 times)

0 Members and 1 Guest are viewing this topic.

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: Help with online info in GuildInfo Relay Module
« Reply #15 on: September 08, 2008, 07:44:40 pm »
ok, fixed that error, bot loaded fine this time, the command shows up, but for some reason it isn't making the blob like it should


Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: Help with online info in GuildInfo Relay Module
« Reply #16 on: September 08, 2008, 07:53:49 pm »
I take that back, everything is working except for the fact of there is no guild window...that is an aoc thing


Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Help with online info in GuildInfo Relay Module
« Reply #17 on: September 08, 2008, 08:10:58 pm »
im redoing the module, just wondering about more info on what you mean by no guild window?

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: Help with online info in GuildInfo Relay Module
« Reply #18 on: September 08, 2008, 08:14:31 pm »
well in aoc anyone can view the guild information, this module makes use of that by linking back to the guild info window...in AO, there really isn't a guild info window save what you make of it.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Help with online info in GuildInfo Relay Module
« Reply #19 on: September 08, 2008, 09:02:07 pm »
<?php
/*
* GuildInfo, by Kaeus
* This module helps people with guild recruitment.
* Recoded by Temar
*
*/
$GuildInfo = new GuildInfo($bot);

class GuildInfo extends BaseActiveModule
{

   function __construct(&$bot)
   {
      parent::__construct(&$bot, get_class($this));
     
      $this -> register_command('all', 'ginfo', "ANONYMOUS");
      $this -> register_alias("member list", "ginfo members");
      $this -> register_alias("member", "ginfo classes");

      $this -> bot -> core("colors") -> define_scheme("GI", "highlight", "yellow");
      $this -> bot -> core("colors") -> define_scheme("GI", "normal", "white");
      $this -> bot -> core("colors") -> define_scheme("GI", "info", "lightgreen");
      $this -> bot -> core("colors") -> define_scheme("GI", "red", "red");
      $this -> bot -> core("colors") -> define_scheme("GI", "blue", "blue");

      $this -> help['description'] = 'Helps with guild recruitment.';
      $this -> help['command']['ginfo']="Displays guild's info tab.";
      $this -> help['command']['ginfo members']="Displays a list of members in the guild.";
      $this -> help['command']['ginfo classes']="Displays a list of classes in the guild.";
      $this -> help['command']['grecruit']="Displays a recruitment link in OOC (usable only with priveleges).";

      $this -> bot -> core("settings") -> create("GuildInfo", "leader", "", "Users who should be Listed as Contacts under Leader seperated by ; eg user1;user2;user3");
      $this -> bot -> core("settings") -> create("GuildInfo", "users", "", "Users who should be Listed as Contacts user Officers seperated by ; eg user1;user2;user3");
      $this -> bot -> core("settings") -> create("GuildInfo", "website", "", "The Website that will be show in the Guild info blob");
   }

   function command_handler($name, $msg, $origin)
   {
      $msg = explode(" ", $msg);
      Switch(strtolower($msg[0]))
      {
         case'ginfo':
            Switch(strtolower($msg[1]))
            {
               //case 'members':
               //   return $this -> memberslist();
               //case 'classes':
               //   return $this -> memberscount();
               Default:
                  return $this -> info();
            }
         case 'grecruit': // this section doesnt work as command isnt registered
            //return "Command under development";
            $msg = $this -> recruit();
            $channel = $this -> bot -> core("chat") -> lookup_group("Playfield");
            return "Currently under development: ".$channel;
         Default:
            return "Broken plugin, recieved unhandled command: $command in Guildinfo.php";
      }
   }
   
   /*
   Guilds Info
   */
   function info()
   {
      $txt.= "##GI_red##<font Color='red' face='LARGE_BOLD'>".$this -> bot -> guildname." Info:</font>##end##\n";
      $txt.= "##GI_red##Website:##end## ##GI_highlight##".$this -> bot -> core("tools") -> chatcmd($this -> bot -> core("settings") -> get("GuildInfo", "website"), $this -> bot -> core("settings") -> get("GuildInfo", "website"), "start")."##end##\n\n";
      $txt.= "##GI_red##Leader:##end##\n";
      $users = $this -> bot -> core("settings") -> get("GuildInfo", "leader");
      $users = str_replace(" ", "", $users);
      $users = explode(";", $users);
      if(!empty($users))
      {
         foreach($users as $user)
         {
            $user = ucfirst(strtolower($user));
            $online = $this -> bot -> core("online") -> get_online_state($user);
            if ($online['status'] <= 0)
               $txt.= "  ".$user."##end##";
            else
               $txt.= "  ".$this -> bot -> core("tools") -> chatcmd("Im interested in joining ".$this -> bot -> guildname, $user, "tell ".$user)."##end##";
            $txt.= " :: ##GI_highlight##".$online['content']."\n";
         }
      }
      $txt.= "\n##GI_red##Officers:##end##\n";
      $users = $this -> bot -> core("settings") -> get("GuildInfo", "users");
      $users = str_replace(" ", "", $users);
      $users = explode(";", $users);
      if(!empty($users))
      {
         foreach($users as $user)
         {
            $user = ucfirst(strtolower($user));
            $online = $this -> bot -> core("online") -> get_online_state($user);
            if ($online['status'] <= 0)
               $txt.= "  ".$user."##end##";
            else
               $txt.= "  ".$this -> bot -> core("tools") -> chatcmd("Im interested in joining ".$this -> bot -> guildname, $user, "tell ".$user)."##end##";
            $txt.= " :: ##GI_highlight##".$online['content']."\n";
         }
      }
      Return ($this -> bot -> guildname." Info :: ".$this -> bot -> core("tools") -> make_blob("click to view", $txt));
   }

   /*
   Still working on this, for now just some random debugging stuff I was trying
   * /
   function recruit()
   {   
      $blob = "TDK is Recruiting!: '";
      $blob.= $this -> info();
      $blob.= " Playfield ID: ";
      return $blob;
     
   } */
   
}
?>
« Last Edit: September 09, 2008, 08:00:01 pm by Temar »

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Help with online info in GuildInfo Relay Module
« Reply #20 on: September 08, 2008, 09:13:31 pm »
i just added the code that returns the info function data as blob, no idea why this isnt there in original code :p

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: Help with online info in GuildInfo Relay Module
« Reply #21 on: September 08, 2008, 09:20:02 pm »
getting a warning : wrong parameter count for explode() on line 40 giving ingame message of "broke plugin, recieved unhandled command"

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Help with online info in GuildInfo Relay Module
« Reply #22 on: September 08, 2008, 09:21:17 pm »
fixed

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: Help with online info in GuildInfo Relay Module
« Reply #23 on: September 08, 2008, 09:38:11 pm »
ok, updated, but will have to try out the rest later, not liking aorc now, will wait until this evening when I get in game..thanks temar


Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: Help with online info in GuildInfo Relay Module
« Reply #24 on: September 09, 2008, 04:21:42 pm »
ok temar, getting blank blobs when doing the ginfo.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Help with online info in GuildInfo Relay Module
« Reply #25 on: September 09, 2008, 04:55:04 pm »
my bad, change the last line of function info, so it used $txt not $info

and yes aorc doesnt like blank blobs :p
« Last Edit: September 09, 2008, 04:57:06 pm by Temar »

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: Help with online info in GuildInfo Relay Module
« Reply #26 on: September 09, 2008, 05:39:33 pm »
ok the blob is coming up now, so that is fixed. I've set the info up under "set guildinfo". The website displays fine...

then the problem comes in. Leader does not, neither does officers.

Second problem: somehow it is not recognizing the command arguments. It ignores the "members" or "classes" argument.

basically the blob as it works right now, looks like this:

Quote
Ascension Info:
Website: http://www.clan-ascension.org

Leader:
Offline :: Leyor
Officers:
Unknown :: Leyor
the guildinfo settings look like this:Settings for guildinfo

Quote
leader:  Porta
 Description: Users who should be Listed as Contacts under Leader seperated by ; eg user1;user2;user3
/tell shal9000 !set guildinfo leader <new value>

users:  Sundragon2,Lillitheve,Troxxor,Ganerc
 Description: Users who should be Listed as Contacts user Officers seperated by ; eg user1;user2;user3
/tell shal9000 !set guildinfo users <new value>

website:  http://www.clan-ascension.org
 Description: The Website that will be show in the Guild info blob
/tell shal9000 !set guildinfo website <new value>

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Help with online info in GuildInfo Relay Module
« Reply #27 on: September 09, 2008, 06:35:23 pm »
Not , but ; in the settings I think.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Help with online info in GuildInfo Relay Module
« Reply #28 on: September 09, 2008, 06:44:11 pm »
yer i wasnt sure that !ginfo members and !ginfo classes would work as they were subcommand and i wasnt sure if they would work with command alias
i tried do it this was simple because
!ginfo members = !member list
!ginfo classes = !member

i will look into this now

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: Help with online info in GuildInfo Relay Module
« Reply #29 on: September 09, 2008, 06:46:25 pm »
the one for leader only had one name, so there was no "," or ";" and it still didn't display right. Will check the other two now
 

 

* 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: 655
  • 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