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 12558 times)

0 Members and 4 Guests are viewing this topic.

Offline BoA-Gert

  • BeBot User
  • **
  • Posts: 45
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #15 on: January 04, 2010, 01:58:42 am »
It's a 3rd party BeBot module you add in to allow the !ginfo response - tried to search for the original but can't find it on here since the change.  I'd suggest looking at Snyder's !ginfo module (see here) or I can see if I can dig out the original module...

Offline shadowrik

  • BeBot Rookie
  • *
  • Posts: 12
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #16 on: January 04, 2010, 10:50:00 pm »
I installed Scott's and while it posts the information into guild chat I am failing to get it to post it in OOC or global so I"m doing something wrong.  Is it the recruitment.php file that I am missing?  Is there an example recruitment.php?

And I truly appreciate all your assitance.

Offline BoA-Gert

  • BeBot User
  • **
  • Posts: 45
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #17 on: January 05, 2010, 07:02:27 am »
Snyder's one uses recruitment.php so you can edit the recruitment info without changing the ginfo module each time - so you will need that...

The one I've tweaked is:

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

class 
GuildInfo extends BaseActiveModule
{
private $who_clicked = array();
private $spam_time 15;// minutes that spam protection is active

   
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""blue""blue");

      
$this -> help['description'] = 'Helps with guild recruitment.';
      
$this -> help['command']['ginfo']="Displays guild's info tab.";
   }

function command_handler($name$msg$origin
{
// there is only one command
if (preg_match('/^ginfo/i'$msg$info)) {
// spam protection
if ($this->is_not_spam($name)) {
return $this->info($name);
}
}
else {
$this->bot->send_help($name);
}
}
   
   
/*
   Guilds Info
   */
   
function info()
   {
      
$txt.= "##GI_red##[GUILD NAME]##end##\n\n";
  $txt.= "##GI_red##----------------##end##\n\n";
  
      
      
$txt.= "##GI_info##Recruitment contacts:##end##\n\n";
       
      
$txt.= "##purple##Guild Leader:##end##\n [GUILD LEADER] "
  $contact "is currently offline.\n\n";
 
     
  $found 0;   
      
$online $this -> bot -> core("online") -> get_online_state('[GUILD LEADER MAIN]');   
  if ($online['status'] == && $found == 0) {
        
$contact "##GI_highlight## is on with <a href='chatcmd:///tell [GUILD LEADER MAIN] I am interested in joining [GUILD NAME]'>[GUILD LEADER MAIN]</a>##end##\n\n"
$found 1;
      } 

  $online $this -> bot -> core("online") -> get_online_state('[GUILD LEADER ALT]');
  if ($online['status'] == && $found == 0) {
         
$contact "##GI_highlight##is on with <a href='chatcmd:///tell [GUILD LEADER ALT] I am interested in joining [GUILD NAME]'>[GUILD LEADER ALT]</a> (alt)##end##\n\n"
 $found 1;
  
  $txt .= $contact;
  $txt.= "##GI_normal##"."--##end##\n";
    
      
$txt.= "##purple##Guild Officers:##end##\n";
  $txt.= "[GUILD OFFICER 1] ";
  $contact "is currently offline.\n\n";
 
  
  $found 0;   
  $online $this -> bot -> core("online") -> get_online_state('[GUILD OFFICER 1 MAIN]');   
  if ($online['status'] == && $found == 0) {
        
$contact "##GI_highlight## is on with <a href='chatcmd:///tell [GUILD OFFICER 1 MAIN] I am interested in joining [GUILD NAME]'>[GUILD OFFICER 1 MAIN]</a>##end##\n\n"
$found 1;
  }
      
  $online $this -> bot -> core("online") -> get_online_state('[GUILD OFFICER 1 ALT]');
  if ($online['status'] == && $found == 0) {
         
$contact "##GI_highlight##is on with <a href='chatcmd:///tell [GUILD OFFICER 1 ALT] I am interested in joining [GUILD NAME]'>[GUILD OFFICER 1 ALT]</a> (alt)##end##\n\n"
 $found 1;
   }  
   
  $txt .= $contact   
  $txt.= "##GI_normal##"."--##end##\n";
      
  $txt.= "##GI_red##Forums:##end## ##GI_highlight##[GUILD SITE URL]\n \n";
  $txt.= "##GI_normal##"."--##end##\n";
      
$txt.= "##GI_red##City:##end## ##GI_highlight##[GUILD CITY INFO]##end##\n \n";
  $txt.= "##GI_normal##"."--##end##\n";      
      
$txt.= "##GI_red##Recruitment:##end## ##yellow##[GUILD RECRUITMENT BLOCK]##end##\n \n";
      
  $txt.= "##GI_normal##"."--##end##\n";            
      
$txt.= "##GI_red##Guild Info:##end##\n \n";
      
$txt.= "##GI_info##";
      
$txt.= "[GUILD INFO BLOCK]\n";
  $txt.= "##end##";
      
      return 
$this -> bot -> core("tools") -> make_blob("[GUILD NAME] Guild info"$txt);
   }
   
public function is_not_spam($name
{
// if name is in array, check if he clicked in last $this->spam_time minutes
if (isset($this->who_clicked$name ])) {
// name is in array, check if time char last time clicked is greater than time() - $this->spam_time
if ( $this->who_clicked$name ] > ( time() - $this->spam_time 60 60 ) ) {
return false;
}
}
$this->who_clicked$name ] = time();
return true;
}
}   
?>

Less flexible than Snyder's but has similar functionality - I've got mine setup so it checks a set of officer alts rather than all officer alts (as Snyder's does), recruitment and guild info is fixed in the 1 file (so a bot restart is needed but that's not that often) but does use the 15min spam routine from Snyder's (handy to avoid those who like clicking links 6-7 times :P)...

As for showing information, not sure what you're trying to do - the !ginfo module is normally used so people can send a tell to the bot and receive a link to click which has more info than a normal recruitment script can have.

For example, you'd have a script which would be:

Code: [Select]
<a href="text://[Some brief info - no more than ~40 chars is good]<br><br><a href='chatcmd:///tell [Your Bot]!ginfo>Click here</a> for more info about the guild.">[Your guild name/click text]</a> - [normal text]
This would show [Your guild name/click text] - [normal text] in global, a user would click the link and see the brief info with a link to click for more info (this is the !ginfo link).  When a user clicks the !ginfo link, they'd get a tell back with a link to click which would have the actual guild info stuff.

Hope that's clear :P

Offline TBK

  • BeBot User
  • **
  • Posts: 26
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #18 on: February 08, 2010, 01:14:48 am »
I would like to add a feature, where I get one of the online staffs (leader(s) and officers) name (chosen randomly). Anybody got a clue how it can be done?

Which I then can use in the link below:
Code: [Select]
$txt .="<Center><font color='#FFFFFF' face='HYBORIANSMALL'><a style='text-decoration:none' href='chatcmd:///tell ".$inv." Hi ".$inv.", I would like to join'><u>Press here to Join!</u></a></font></Center>
« Last Edit: February 08, 2010, 01:31:01 am by TBK »

Offline BoA-Gert

  • BeBot User
  • **
  • Posts: 45
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #19 on: February 08, 2010, 02:49:18 am »
Could be done - can see if I can get something up during the week if no-one else does...

Offline TBK

  • BeBot User
  • **
  • Posts: 26
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #20 on: February 18, 2010, 01:55:11 pm »
I have come up with this, but my output is 0. Could anybody point out what I'm doing wrong?

Code: [Select]
<?php
foreach ($this->officers as $v) {
$online $this->find_officer($v);

$name_online in_array('online'$online);

unset($v$online$name_online[0]);
}

$online_staff = array($name_online);


function randomElement(array $array)
{

$rand mt_rand(0count($array) - 1);
$array_keys array_keys($array);
   
return $array[$array_keys[$rand]];
}

function randomKey(array $array)
{
return randomElement(array_keys($array));
}

$inv randomKey($online_staff);


$txt .="<Center><font color='#FFFFFF' face='HYBORIANSMALL'><a style='text-decoration:none' href='chatcmd:///tell ".$inv." Hi ".$inv.", I would like to join'><u>Press here to Join!</u></a></font>;
?>

« Last Edit: February 18, 2010, 02:49:46 pm by TBK »

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #21 on: February 18, 2010, 03:23:31 pm »
$txt .="<Center><font color='#FFFFFF' face='HYBORIANSMALL'><a style='text-decoration:none' href='chatcmd:///tell ".$inv." Hi ".$inv.", I would like to join'><u>Press here to Join!</u></a></font>";

Missing a " at the end

And im not sure if this is your complete file, because there are other problem too like missing print/echo and functions
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 TBK

  • BeBot User
  • **
  • Posts: 26
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #22 on: February 18, 2010, 09:39:26 pm »
It is not my full file. I use the Snyder modified version as template (http://www.cro-guild.com/bebot/Ginfo.php.txt).


The problem is not ", I just removed to must of my file xD

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #23 on: February 18, 2010, 10:59:38 pm »
Ok, i dunno why you have function (array $array) {} ...

For easier making of the random function, take a look on: http://php.net/manual/en/function.array-rand.php


Code: [Select]
<?php
      
foreach ($this->officers as $v) {
         
$online $this->find_officer($v);
         
         
$name_online in_array('online'$online);

         unset(
$v$online$name_online[0]);
      }
      
      
$online_staff = array($name_online);
      
      
      function 
randomElement($array)
      {

         
$rand mt_rand(0count($array) - 1);
         
$array_keys array_keys($array);
         
         return 
$array[$array_keys[$rand]];
      }
      
      function 
randomKey($array)
      {
         return 
randomElement(array_keys($array));
      }
      
      
$inv randomKey($online_staff);
      
      
$txt .="<Center><font color='#FFFFFF' face='HYBORIANSMALL'><a style='text-decoration:none' href='chatcmd:///tell ".$inv." Hi ".$inv.", I would like to join'><u>Press here to Join!</u></a></font>";
?>
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 TBK

  • BeBot User
  • **
  • Posts: 26
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #24 on: February 19, 2010, 12:14:52 am »
Like this?
Code: [Select]
<?php
      
foreach ($this->officers as $v) {
         
$online $this->find_officer($v);
         
         
$name_online in_array('online'$online);

         unset(
$v$online$name_online[0]);
      }
      
      
$online_staff = array($name_online);
          
      
$inv array_rand($online_staff1);
      
      
$txt .="<Center><font color='#FFFFFF' face='HYBORIANSMALL'><a style='text-decoration:none' href='chatcmd:///tell ".$inv." Hi ".$inv.", I would like to join'><u>Press here to Join!</u></a></font>";
?>

Offline TBK

  • BeBot User
  • **
  • Posts: 26
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #25 on: February 19, 2010, 12:26:10 am »
Get this output :
Code: [Select]
/tell 0, Hi 0, I would like to join

Offline Getrix

  • Contributor
  • *******
  • Posts: 509
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #26 on: February 19, 2010, 07:00:29 am »
Quote
If you are picking only one entry, array_rand()  returns the key for a random entry. Otherwise, it returns an array of keys for the random entries. This is done so that you can pick random keys as well as values out of the array.

$inv = array_rand($online_staff, 1);
$officer = $online_staff[$inv];
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 TBK

  • BeBot User
  • **
  • Posts: 26
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #27 on: February 24, 2010, 03:11:11 am »
Figured out the problem, the $online_status returns a multidimensional array, which I of cause didn't know. So I searched the wrong array. Should had done a dump to begin with  ;D

Thx for the help Getrix :)

Here is the working code:
Code: [Select]
<?php
$online_staff = array();

foreach ($this->officers as $x) {
$online_status $this->find_officer($x);
$status $online_status[0];

if (in_array(1$status)) {
array_push($online_staff,$online_status[1]);
}

unset($x$status$online_status);
}

$officer array_rand($online_staff1);
$inv $online_staff[$officer];

$txt .="<Center><font color='#FFFFFF' face='HYBORIANSMALL'><a style='text-decoration:none' href='chatcmd:///tell ".$inv." Hi ".$inv.", I would like to join'><u>Press here to Join!</u></a></font>";
?>

« Last Edit: May 27, 2010, 08:43:08 pm by TBK »

Offline esnir

  • BeBot Rookie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: help request - Ginfo officer online status
« Reply #28 on: April 16, 2010, 10:26:16 am »
Hi Guys,

Can someone pls tell me how recruitment.php should look like?


Offline snyder

  • BeBot User
  • **
  • Posts: 34
  • Karma: +0/-0
  • CRO guild
    • CRO Guild @ Crom
Re: help request - Ginfo officer online status
« Reply #29 on: April 19, 2010, 03:58:25 pm »
my info in it, just change :)

Code: [Select]
##GI_red##About us##end##
##GI_normal##We were formed as Croatian only guild, but after few weeks we realized that there can not be only one nationality in guild and then started to recruiting people from every country. It took us some time, but now we have over 40 active lvl 80 players that are doing all raid instances. All players are 18+, but most of them is even 30+. We have Ventrilo server and most ppl use it all the time so there is allways someone to talk.##end##
##end##
##end##
##GI_red##Raiding##end##
##GI_normal##Curently we have 5 raids per week (Monday,Tuesday,Wednesday,Thursday,Sunday) and hopeing to build good secondary raid team so we have two raids at time. We are farming ALL raid bosses atleast once a week, but mostly we get 2 full BRC runs per week and 1 on T1 raids. Sometimes we hold pug raids if there is time for it and we have raid leader avaliable.##end##
##end##
##end##
##GI_red##Guild city##end##
##GI_normal##We have all Tier 3 buldings, walls will wait some better times...##end##
##end##
##end##
##GI_red##Bot##end##
##GI_normal##What is bot? Its (in this case) PHP multi-purpose script that runs from one webserver. It has a LOT of options and we make new ones if required (improved rolls, who can craft what, what materials are needed for something, what is some material used for and how much, ninja list....). Basicaly, bot is logged on one character, Shonjo, and monitores guild chat and tells (commands) to it and then makes response if it is required.##end##
##end##
##end##
##GI_red##Web site##end##
##GI_normal##Our web site, www.cro-guild.com, is custom made PHP based web, but uses SMF forum for easy user management and verification.
Members create their characters on web and apply for raids through raid planer with character they wanna go with (using AoC classes, not like most raid planers only Soldier, DPS, Healer dinstiction).
There is list of what our guild members can craft (that list is made with bot) so members can find who can make something and what does it require to be crafted.
List of items that people got is implemented on web aswell (info goes from guild bot) so you can see info on item (hover item name), who got it, when and in which raid. List is searchable aswell....##end##
##end##
##end##
##GI_red##Type of players in guild##end##
##GI_normal##We are semi-hardcore in some ways (amount of raids and time to complete runs), but we also have a lot of casual players that are here mostly for daily dungeon runs and some raids if they want. And it does not matter what kind of player you are!##end##
##end##
##end##
##GI_red##What do we require?##end##
##GI_normal##Basicaly, not much. If you want to do raids with guild you need to give some materials and money monthly (it is changed depending on building requirements for mats and what we have most) so check web site for that. We do NOT require your daily activity, a number of raids per month, etc... If you want to play, just play, if you don't, then don't play, your choice and you will not be looked at differently. We require that if you are applyed on raid planer as confirmed or avaliable to be online at raid time. You can change that status on planer any time you want.##end##
##end##
##end##
##GI_red##We are looking for:##end##

 

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