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

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

Author Topic: help request - Ginfo officer online status  (Read 12555 times)

0 Members and 1 Guest are viewing this topic.

Offline Monk4y

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
help request - Ginfo officer online status
« on: September 21, 2009, 08:20:50 pm »
Im not sure if this is the right place, but I'll post it here anyway.

Im trying to sort out a guild info script with an online status for officers. The trouble is they are always on their alt characters and when the ginfo script goes up it shows their main as offline - but they are actually online with an alt.  I have the section regarding online/offline status below but need someone smarter than me to make it show that he is on an alt and not just offline.

Code: [Select]
$txt.= "##GI_orange##GUILD LEADER##end##\n";
$online = $this -> bot -> core("online") -> get_online_state('Doob');
if ($online['status'] <= 0)
{
$txt.= "##GI_highlight##".$online['content']." :: Doob##end##<br /><br>";
}
else
{
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Doob I just clicked the guild advert in globlal, do you have time to chat?'>Doob</a>##end##\n";
}

Any assistance would be greatly appreciated.
Thankyou for your time.

Offline BoA-Gert

  • BeBot User
  • **
  • Posts: 45
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #1 on: October 17, 2009, 02:22:15 am »
I use:

Code: [Select]
  $txt.= "##purple##{Officer block}:##end##\n{Officer Name} ";
  $contact = "is currently offline.\n\n";
     
  $found = 0;  
      $online = $this -> bot -> core("online") -> get_online_state('{Main char}');  
  if ($online['status'] == 1 && $found == 0) {
        $contact = "##GI_highlight## is on with <a href='chatcmd:///tell {Main char} {text}'>{Main char}</a>##end##\n\n";
$found = 1;
      }
 
      $online = $this -> bot -> core("online") -> get_online_state('{Alt char}');  
  if ($online['status'] == 1 && $found == 0) {
        $contact = "##GI_highlight## is on with <a href='chatcmd:///tell {Alt char} {text}'>{Alt char}</a>##end##\n\n";
$found = 1;
      }
.
.
.
$txt .= $contact;

repeat the alt char block for each alt - the last line as after all the alts - this will output 1 line with a click link for whichever alt is online or use the default "is currently offline" if no alts are on.

Probably could be a bit neater but works how I need it to ;)

Offline Monk4y

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #2 on: October 20, 2009, 04:19:44 am »
thanks for your reply.

Offline keirou

  • BeBot Apprentice
  • ***
  • Posts: 90
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #3 on: October 20, 2009, 05:53:00 am »
With the help of a guild member I was able to modify this script so it now tells you if the leader / officers are online (AND on what character)

Code: [Select]
<?php
/*
* GuildInfo
* This module helps people with guild recruitment.
*
*
*/
$GuildInfo = new GuildInfo($bot);

class 
GuildInfo extends BaseActiveModule
{

   function 
__construct(&$bot)
   {
      
parent::__construct(&$botget_class($this));
      
      
$this -> register_command('all''ginfo'"ANONYMOUS");

      
$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""Silver""Silver");

      
$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).";
   }

   function 
command_handler($name$msg$origin)
   {
      if (
preg_match('/^ginfo/i'$msg$info)) {
         
$words trim(substr($msgstrlen('ginfo')));
         if (
$words == "members")
         {
            return 
$this -> memberslist();
         } else if(
$words == "classes") {
            return 
$this -> memberscount();
         } else {
            return 
$this -> info();
         }
      } else if(
preg_match('/^grecruit/i'$msg$info)) {
         
//return "Command under development";
         
$msg $this -> recruit();
         
$channel $this -> bot -> core("chat") -> lookup_group("Playfield");
         return 
"Currently under development: ".$channel;
      } else {
         
$this -> bot -> send_help($name);
      }
   }
   
   
/*
   Guilds Info
   */
   
function info()
   {
      
$txt.= "##GI_red##GUILD NAME HERE##end##\n\n";
 $txt.= "##end##\n";      
      
      
$txt.= "##highlight##Leader:##end##\n\n";
$online $this -> officercheck("GUILD LEADER NAME");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";
 $txt.= "##end##\n";      
      
$txt.= "##highlight##Officers:##end##\n";
$online $this -> officercheck("OFFICER 1");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";
     
$online $this -> officercheck("OFFICER 2");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";
$online $this -> officercheck("OFFICER 3");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";
$online $this -> officercheck("OFFICER 4");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";
$online $this -> officercheck("OFFICER 5");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";  
$online $this -> officercheck("OFFICER 6");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";  
 $txt.= "##end##\n"
      
$txt.= "##GI_red##Website:##end## ##GI_info## WWW. YOUR WEBSITE HERE .COM##end##\n\n";
      
$txt.= "##GI_red##City:##end## ##Silver##WHAT YOUVE BUILT##end##\n\n";
      
$txt.= "##GI_red##Raids:##end## ##Silver##WHAT YOUVE KILLED##end##\n\n";
      
$txt.= "##GI_red##Recruitment:##end## ##Silver##SPECIAL REQUIREMENTS??.##end##\n\n";
 $txt.= "##end##\n";
      
$txt.= "##highlight##Assassin:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Barbarian:##end## ##Red## [Closed]##end##\n";
      
$txt.= "##highlight##Bear Shaman:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Conqueror:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Dark Templer:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Demonologist:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Guardian:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Herald of Xotli:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Necromancer:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Priest of Mitra:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Ranger:##end## ##Red##[Closed]##end##\n";
      
$txt.= "##highlight##Tempest of Set:##end## ##Red##[Closed]##end##\n\n";
 $txt.= "##end##\n";
      
      
$txt.= "##GI_red##Guild Info:##end##\n";
      
$txt.= "##Silver##";
      
$txt.= "GUILD INFO SECTION 1\n\n";
 $txt.= "##end##\n";
 $txt.= "##Silver##";
      
$txt.= "GUILD INFO SECTION 2\n\n";
 $txt.= "##end##\n";
 $txt.= "##Silver##";
      
$txt.= "GUILD INFO SECTION 3\n\n";
      
$txt.= "##end##";
      
      
      return 
$this -> bot -> core("tools") -> make_blob("WHAT YOU WANT THE BOT TO TELL THE PLAYER"$txt);
   }
   
/*
   Still working on this, for now just some random debugging stuff I was trying
   */
   
function recruit()
   {   
      
$blob "Guild Name is Recruiting!: '";
      
$blob.= $this -> info();
      
$blob.= " Playfield ID: ";
      return 
$blob;
      
   }

/*
Checks online list for presence of officer of $name
Returns online status, and if online, name of current main/alt
*/
function officercheck($name)
{
$online $this -> bot -> db -> select("SELECT t1.nickname FROM "
"#___online AS t1 LEFT JOIN #___whois AS t2 ON t1.nickname = t2.nickname WHERE status_gc=1");

$found FALSE;
if (!empty($online))
{
foreach ($online as $player)
{
if(isset($this -> listed[$channel][$player[0]]))
Continue;

$main $this -> bot -> core("alts") -> main($player[0]);

if ($name == $main)
{
$online_state $this -> bot -> core("online") -> get_online_state($this -> bot -> core("chat") -> get_uname($player[0]));
$retstr " - " $this -> bot -> core("chat") -> get_uname($player[0]);
$found TRUE;
break;
}
else if ($name == $this -> bot -> core("chat") -> get_uname($player[0]))
{
$online_state $this -> bot -> core("online") -> get_online_state($main);
$retstr " - " $main;
$found TRUE;
break;
}
}
if ($found == FALSE)
{
$online_state $this -> bot -> core("online") -> get_online_state($name);
$retstr " - " $name;
}
}
return array($online_state$retstr);
}
   
   
/*
   Need to revize so it just uses core
   */
   
function memberslist()
   {
      
$blob "";
      
$count 0;
      
$result $this -> bot -> db -> select("SELECT nickname, last_seen FROM #___users WHERE user_level = " MEMBER " ORDER BY nickname ASC");
      if (!empty(
$result))
      {
         
$inside "##blob_title##:::: <botname>'s Member List ::::##end##\n\n";
         foreach (
$result as $val)
         {
            
$count++;
            
$inside .= "##blob_text##&#8226; " $val[0];
            if (
$val[1] > 0)
            {
               
$inside .= ", last seen at " gmdate($this -> bot -> core("settings") -> get("Time""FormatString"), $val[1]);
            }
            else
            {
               
$inside .= ", never seen online";
            }
            
$inside .= "##end## ".$this -> bot -> core("tools") -> chatcmd("whois " $val[0], "[Whois]")."\n";
         }
         
$blob " :: " $this -> bot -> core("tools") -> make_blob("click to view"$inside);
      }
      return 
$count " Guild Members:" $blob;
   }
   
   
/*
   Need to revize so it just uses core
   */
   
function memberscount()
   {
      
$blob "";
      
$total 0;
      
      
$buddies count($this -> bot -> aoc -> buddies);
      
//Get a list of professions
      
$profession_list "'".$this->bot->core('professions')->get_professions("', '")."'";
      
$counts $this -> bot -> db -> select("SELECT t2.class, COUNT(DISTINCT t1.nickname)
            FROM #___users AS t1 LEFT JOIN #___whois AS t2 ON t1.nickname = t2.nickname
             WHERE user_level = " 
MEMBER " AND t2.class IN ($profession_list) GROUP BY class");
            
      foreach (
$this -> bot->core('professions')->get_profession_array() as $prof)
         
$count[$prof] = 0;
      if (!(empty(
$counts)))
      {
         foreach (
$counts as $profcount)
         {
            
$count[$profcount[0]] += $profcount[1];
            
$total += $profcount[1];
         }
      }
      
      
$inside "##blob_title##:::: <botname>'s Member Count ::::##end##\n";
      
$inside .= "\n##blob_text##Buddy List Count: ##blob_title##".$buddies."##end##\n";
      foreach (
$count as $key => $value)
         
$inside .= "\n&#8226; ".$key." = ##blob_title##".$value."##end##";
      
$blob " :: " $this -> bot -> core("tools") -> make_blob("click to view"$inside);

      return 
$total " Guild Classes:" $blob;
   }
}
?>

It shows if they are offline or Online, and uses the current ginfo script.

Props to kontar from Third Time Lucky on Gwahlur for coding that for me though.

Offline Monk4y

  • BeBot User
  • **
  • Posts: 23
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #4 on: October 21, 2009, 02:08:49 am »
thanks again.

Offline snyder

  • BeBot User
  • **
  • Posts: 34
  • Karma: +0/-0
  • CRO guild
    • CRO Guild @ Crom
Re: help request - Ginfo officer online status
« Reply #5 on: October 24, 2009, 10:46:10 pm »
try this for officers online (any member actually)

Code: [Select]
        $query = $this->bot->db->select("select o.nickname from #___online as o, #___alts as a where o.status_gc = '1' and ( (o.nickname = a.alt and a.main = '".$name."') or (o.nickname = a.main and a.alt = '".$name."') ) LIMIT 1");
        if (!empty($query)) {
            foreach ($query as $user) {
                $name = $user[0];
                unset($user);
            }
        }
        unset($query);
        // online status
        $online = $this->bot->core("online")->get_online_state($name);
        return array($online, $name);

Offline PBbot

  • BeBot Rookie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #6 on: October 28, 2009, 04:23:05 pm »
I get the error :
fatal error: Cannot redeclare class Guildinfo in C:\.......\ginfo.php on line 294

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #7 on: October 28, 2009, 04:30:53 pm »
Check if you have pasted the code two times in your file...
Success is not final, failure is not fatal: it is the courage to continue that counts.
- Sorry, i dont have time to reply question on PM. Make a topic.

Offline PBbot

  • BeBot Rookie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #8 on: October 28, 2009, 04:55:29 pm »
This is the code. Im not a php guru so any help is appriciated.

Code: [Select]
<?php
/*
* GuildInfo
* This module helps people with guild recruitment.
*
*
*/
$GuildInfo = new GuildInfo($bot);

class 
GuildInfo extends BaseActiveModule
{

   function 
__construct(&$bot)
   {
      
parent::__construct(&$botget_class($this));
      
      
$this -> register_command('all''ginfo'"ANONYMOUS");

      
$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""Silver""Silver");

      
$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).";
   }

   function 
command_handler($name$msg$origin)
   {
      if (
preg_match('/^ginfo/i'$msg$info)) {
         
$words trim(substr($msgstrlen('ginfo')));
         if (
$words == "members")
         {
            return 
$this -> memberslist();
         } else if(
$words == "classes") {
            return 
$this -> memberscount();
         } else {
            return 
$this -> info();
         }
      } else if(
preg_match('/^grecruit/i'$msg$info)) {
         
//return "Command under development";
         
$msg $this -> recruit();
         
$channel $this -> bot -> core("chat") -> lookup_group("Playfield");
         return 
"Currently under development: ".$channel;
      } else {
         
$this -> bot -> send_help($name);
      }
   }
   
   
/*
   Guilds Info
   */
   
function info()
   {
      
$txt.= "##GI_red##Polarbears##end##\n\n";
 $txt.= "##end##\n";      
      
      
$txt.= "##highlight##Leader:##end##\n\n";
$online $this -> officercheck("Ronmel");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";
 $txt.= "##end##\n";      
      
$txt.= "##highlight##Officers:##end##\n";
$online $this -> officercheck("Dawee");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";
     
$online $this -> officercheck("Sabasi");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";
$online $this -> officercheck("Groshznax");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";
$online $this -> officercheck("Senkar");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";
$txt.= "##highlight##Recryitments Officers:##end##\n";
$online $this -> officercheck("Idia");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
 $txt.= "##end##\n";  
$online $this -> officercheck("Twistybull");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
$online $this -> officercheck("Aerithchan");
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1]; 
$txt.= "##end##\n";  
 $txt.= "##end##\n"
      
$txt.= "##GI_red##Website:##end## ##GI_info## www.Polarbears.no##end##\n\n";
      
$txt.= "##GI_red##City:##end## ##Silver##Tier 3 50%##end##\n\n";
      
$txt.= "##GI_red##Raids:##end## ##Silver##Tier 1 50%##end##\n\n";
      
$txt.= "##GI_red##Recruitment:##end## ##Silver##Looking for active scandinavians older than 18 that want to raid and have fun.##end##\n\n";
 $txt.= "##end##\n";
      
$txt.= "##highlight##Assassin:##end## ##Green##[High]##end##\n";
      
$txt.= "##highlight##Barbarian:##end## ##Yellow## [Medium]##end##\n";
      
$txt.= "##highlight##Bear Shaman:##end## ##Green##[High]##end##\n";
      
$txt.= "##highlight##Conqueror:##end## ##Green##[High]##end##\n";
      
$txt.= "##highlight##Dark Templer:##end## ##Yellow##[Medium]##end##\n";
      
$txt.= "##highlight##Demonologist:##end## ##Red##[Low]##end##\n";
      
$txt.= "##highlight##Guardian:##end## ##Green##[High]##end##\n";
      
$txt.= "##highlight##Herald of Xotli:##end## ##Yellow##[Medium]##end##\n";
      
$txt.= "##highlight##Necromancer:##end## ##Yellow##[Medium]##end##\n";
      
$txt.= "##highlight##Priest of Mitra:##end## ##Red##[Low]##end##\n";
      
$txt.= "##highlight##Ranger:##end## ##Green##[High]##end##\n";
      
$txt.= "##highlight##Tempest of Set:##end## ##Red##[Low]##end##\n\n";
 $txt.= "##end##\n";
      
      
$txt.= "##GI_red##Guild Info:##end##\n";
      
$txt.= "##Silver##";
      
$txt.= "We are a mature guild with most of our members 
between the age 25-45 yrs old. Most of us have rather 
extensive gaming experiences from other MMO and 
FPS games. Our main goal with this guild is to 
create a comfortable and fun journey in the world 
of Hyboria for all our members. We are loyal and 
helpful towards our ingame friends, and espesially 
towards our guildies.\n\n"
;
 $txt.= "##end##\n";
 $txt.= "##Silver##";
      
$txt.= "As mentioned earlier community and friendship will 
be essential in running our Guild. Needless to say 
due to our prior gaming experiences we are ambitious 
and serious gamers and will not be mistaken for being 
pushovers in any sence. Still if your goal is hardcore 
raiding, grinding and sieging 24/7 we might not be 
the Guild to fulfill your ingame ambitions. We all have 
RL obligations like work/school/family life etc. which 
can be quite time consuming at times so we will 
probably never become the first Guild to new content 
or be the first to take down any high end bosses.\n\n"
;
 $txt.= "##end##\n";
 $txt.= "##Silver##";
      
$txt.= "We have a 24/7 ventrilo server running, webpages, 
AOCbot and very helpfully members.
We also have almost a full tier 3 city. 
We are raiding 2-3 times a week.\n\n"
;
      
$txt.= "##end##";
      
$txt.= "##Silver##";
      
$txt.= "Every new member will have a 2 week trial peroid 
in which they can get to know other members of our 
guild, and we can also get to know them better. 
During this period we will look at your level of 
ingame activity and how you interact socially and 
gamewice with your new guildies. You will during 
this peroid be treated equally and regarded as 
any other guildmember.\n\n"
;
      
$txt.= "##end##";
$txt.= "##Silver##";
      
$txt.= "In addition go to www.Polarbears.no and click on 
Guild Policies. Read these please so you are fully 
updated and aware of what we expect of you.\n\n"
;
      
$txt.= "##end##";
$txt.= "##Silver##";
      
$txt.= "If you think this could be a guild for you and want to 
join, go to www.Polarbears forum and post an application.\n\n"
;
      
$txt.= "##end##";
$txt.= "##Silver##";
      
$txt.= "Thank you for reading.\n\n";
      
$txt.= "##end##";
$txt.= "##Silver##";
      
$txt.= "We wish you all the best in the glorious world of Hyboria.\n\n";
      
$txt.= "##end##";
      
      return 
$this -> bot -> core("tools") -> make_blob("Polarbears"$txt);
   }
   
/*
   Still working on this, for now just some random debugging stuff I was trying
   */
   
function recruit()
   {   
      
$blob "Guild Name is Recruiting!: '";
      
$blob.= $this -> info();
      
$blob.= " Playfield ID: ";
      return 
$blob;
      
   }

/*
Checks online list for presence of officer of $name
Returns online status, and if online, name of current main/alt
*/
function officercheck($name)
{
$online $this -> bot -> db -> select("SELECT t1.nickname FROM "
"#___online AS t1 LEFT JOIN #___whois AS t2 ON t1.nickname = t2.nickname WHERE status_gc=1");

$found FALSE;
if (!empty($online))
{
foreach ($online as $player)
{
if(isset($this -> listed[$channel][$player[0]]))
Continue;

$main $this -> bot -> core("alts") -> main($player[0]);

if ($name == $main)
{
$online_state $this -> bot -> core("online") -> get_online_state($this -> bot -> core("chat") -> get_uname($player[0]));
$retstr " - " $this -> bot -> core("chat") -> get_uname($player[0]);
$found TRUE;
break;
}
else if ($name == $this -> bot -> core("chat") -> get_uname($player[0]))
{
$online_state $this -> bot -> core("online") -> get_online_state($main);
$retstr " - " $main;
$found TRUE;
break;
}
}
if ($found == FALSE)
{
$online_state $this -> bot -> core("online") -> get_online_state($name);
$retstr " - " $name;
}
}
return array($online_state$retstr);
}
   
   
/*
   Need to revize so it just uses core
   */
   
function memberslist()
   {
      
$blob "";
      
$count 0;
      
$result $this -> bot -> db -> select("SELECT nickname, last_seen FROM #___users WHERE user_level = " MEMBER " ORDER BY nickname ASC");
      if (!empty(
$result))
      {
         
$inside "##blob_title##:::: <botname>'s Member List ::::##end##\n\n";
         foreach (
$result as $val)
         {
            
$count++;
            
$inside .= "##blob_text##&#38;#8226; " $val[0];
            if (
$val[1] > 0)
            {
               
$inside .= ", last seen at " gmdate($this -> bot -> core("settings") -> get("Time""FormatString"), $val[1]);
            }
            else
            {
               
$inside .= ", never seen online";
            }
            
$inside .= "##end## ".$this -> bot -> core("tools") -> chatcmd("whois " $val[0], "[Whois]")."\n";
         }
         
$blob " :: " $this -> bot -> core("tools") -> make_blob("click to view"$inside);
      }
      return 
$count " Guild Members:" $blob;
   }
   
   
/*
   Need to revize so it just uses core
   */
   
function memberscount()
   {
      
$blob "";
      
$total 0;
      
      
$buddies count($this -> bot -> aoc -> buddies);
      
//Get a list of professions
      
$profession_list "'".$this->bot->core('professions')->get_professions("', '")."'";
      
$counts $this -> bot -> db -> select("SELECT t2.class, COUNT(DISTINCT t1.nickname)
            FROM #___users AS t1 LEFT JOIN #___whois AS t2 ON t1.nickname = t2.nickname
             WHERE user_level = " 
MEMBER " AND t2.class IN ($profession_list) GROUP BY class");
            
      foreach (
$this -> bot->core('professions')->get_profession_array() as $prof)
         
$count[$prof] = 0;
      if (!(empty(
$counts)))
      {
         foreach (
$counts as $profcount)
         {
            
$count[$profcount[0]] += $profcount[1];
            
$total += $profcount[1];
         }
      }
      
      
$inside "##blob_title##:::: <botname>'s Member Count ::::##end##\n";
      
$inside .= "\n##blob_text##Buddy List Count: ##blob_title##".$buddies."##end##\n";
      foreach (
$count as $key => $value)
         
$inside .= "\n&#38;#8226; ".$key." = ##blob_title##".$value."##end##";
      
$blob " :: " $this -> bot -> core("tools") -> make_blob("click to view"$inside);

      return 
$total " Guild Classes:" $blob;
   }
}
?>


Offline PBbot

  • BeBot Rookie
  • *
  • Posts: 5
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #9 on: October 28, 2009, 05:21:05 pm »
I'm noob, had a copy of the old ginfo file in the same folder.
All ok now :)

Offline snyder

  • BeBot User
  • **
  • Posts: 34
  • Karma: +0/-0
  • CRO guild
    • CRO Guild @ Crom
Re: help request - Ginfo officer online status
« Reply #10 on: October 28, 2009, 06:52:11 pm »
replace officercheck function with

Code: [Select]
function officercheck($name) {
        $query = $this->bot->db->select("select o.nickname from #___online as o, #___alts as a where o.status_gc = '1' and ( (o.nickname = a.alt and a.main = '".$name."') or (o.nickname = a.main and a.alt = '".$name."') ) LIMIT 1");
        if (!empty($query)) {
            foreach ($query as $user) {
                $name = $user[0];
                unset($user);
            }
        }
        unset($query);
        // online status
        $online = $this->bot->core("online")->get_online_state($name);
        return array($online, $name);
}

you get back array(Online/Offline status, Name character is useing)

and its much smaller than one from script few post up :)

Offline snyder

  • BeBot User
  • **
  • Posts: 34
  • Karma: +0/-0
  • CRO guild
    • CRO Guild @ Crom
Re: help request - Ginfo officer online status
« Reply #11 on: October 29, 2009, 10:47:15 am »
modifyed guild info module alot, you now have !settings GuildInfo option to set requirements on classes (5 levels curently: none,low,medium,high,ultrahigh)

also, recruitment text is in some external file (so you can edit without problems), but double \n dont work unfortunately there so find some other ways of making double line space

link to file:
http://www.cro-guild.com/bebot/Ginfo.php.txt

Offline Yite

  • BeBot Apprentice
  • ***
  • Posts: 152
  • Karma: +0/-0
    • Niflheim - Crom
Re: help request - Ginfo officer online status
« Reply #12 on: November 03, 2009, 01:08:06 am »
also, recruitment text is in some external file (so you can edit without problems), but double \n dont work unfortunately there so find some other ways of making double line space

For a double line space I use the following:
Quote
Blah blah blah
blah bah
##end##
##end##
Blah blah

-Yite
-Yite [Crom]

Offline snyder

  • BeBot User
  • **
  • Posts: 34
  • Karma: +0/-0
  • CRO guild
    • CRO Guild @ Crom
Re: help request - Ginfo officer online status
« Reply #13 on: November 08, 2009, 03:14:25 pm »
i updated module with spam protection

you know when some guys click 5 times and bot gets blocked :)

its 15 minutes default, you can change that of course

http://www.cro-guild.com/bebot/

Offline shadowrik

  • BeBot Rookie
  • *
  • Posts: 12
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #14 on: January 02, 2010, 08:39:24 pm »
 8) I realize I'll get the 'what a noob' expression but I'm really missing how this works for recruitment when the bot watches my guild chat not my global or say.  I've searched the file for a ///gsay and can't find it...now for testing purposes I like it returning it to guild instead.
Oh there's a couple php files failing to load and when you make it so they will load...they seem to be missing the php header(<?php)

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


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


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 200
  • 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