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

0 Members and 1 Guest are viewing this topic.

Offline Barlyman

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
    • Circle of Eternity
Help with online info in GuildInfo Relay Module
« on: July 29, 2008, 11:05:35 pm »
Hi and thanks for this awsome bot.

I have changed the guildinfo.php module to match out guilds info, I have also listed the Officers of the guild with klickable names that sent a tell with "I'm interested in what you have to offer, please tell me more" to the officer thats klicked.

Now I wonder if it's possible to make a note infront of each officer saying online or offline?
Would it be possible to just call a function in the OnlineDisplay.php module and if so, how?

Would relly like to understand how .php works better but all I ever done is VB and asp :/ and sorry for the foul words ;)
and all my "programming was a while ago, getting a bit rusty  :'(

Many thanks for all the superb coding you lads have done
//Barlyman
Barlyman 80 HoX @ Crom <Circle of Eternity>

Offline Vrykolas

  • BeBot Apprentice
  • ***
  • Posts: 100
  • Karma: +0/-0
Re: Help with online info in GuildInfo Relay Module
« Reply #1 on: July 29, 2008, 11:54:05 pm »
The code you're looking for is:
Code: [Select]
$online = $this -> bot -> core("online") -> get_online_state($name);

// $online['content'] contains online, offline or unknown as colourized text

Offline Barlyman

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
    • Circle of Eternity
Re: Help with online info in GuildInfo Relay Module
« Reply #2 on: July 30, 2008, 01:31:05 am »
Dont know if this is correct, dont think so, cause it doesnt work, the bot starts and I get the blob but there is no trace of online/offline info.
Am I doing it completly wrong? ???
Code: [Select]
/*
Guilds Info
*/
function info()
{
$txt.= "##GI_red##<font Color='red' face='LARGE_BOLD'>Lorem Ipsum Guild Info:</font>##end##\n";
$txt.= "##GI_red##Website:##end## ##GI_highlight##http://loremipsum.mine.com##end##\n\n";
$online = $this -> bot -> core("online") -> get_online_state($Banshee);
$txt.= "##GI_red##Leader:##end## ##GI_highlight##<a href='chatcmd:///tell Banshee Im interested in joining Lorem Ipsum'>Banshee</a>##end##\n\n";
$txt.= "##GI_red##Officers:##end##\n";
$online = $this -> bot -> core("online") -> get_online_state($Judgement);
$txt.= "##GI_highlight##<a href='chatcmd:///tell Judgement Im interested in joining Lorem Ipsum'>Judgement</a> - Melee class leader##end##\n";
$online = $this -> bot -> core("online") -> get_online_state($Cronan);
$txt.= "##GI_highlight##<a href='chatcmd:///tell Cronan Im interested in joining Lorem Ipsum'>Cronan</a> - Tank Class leader##end##\n";

Mabey I need to change the
Code: [Select]
$online = $this -> bot -> core("online") -> get_online_state($name);to something else than
Code: [Select]
$online = $this -> bot -> core("online") -> get_online_state($Cronan);when hard coding it into the page like this
Barlyman 80 HoX @ Crom <Circle of Eternity>

Offline Barlyman

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
    • Circle of Eternity
Re: Help with online info in GuildInfo Relay Module
« Reply #3 on: July 30, 2008, 01:43:22 pm »
Wont get it to work, even tried
Code: [Select]
Guilds Info
*/
function info()
{
$txt.= "##GI_red##<font Color='red' face='LARGE_BOLD'>Lorem Ipsum Guild Info:</font>##end##\n";
$txt.= "##GI_red##Website:##end## ##GI_highlight##http://loremipsum.mine.com##end##\n\n";
$online1 = $this -> bot -> core("online") -> get_online_state('Banshee');
$online1['content'];
$txt.= "##GI_red##Leader:##end##\n";
$txt.= "##GI_highlight##<a href='chatcmd:///tell Banshee Im interested in joining Lorem Ipsum'>Banshee</a>##end##\n\n";
$txt.= "##GI_red##Officers:##end##\n";
$online2 = $this -> bot -> core("online") -> get_online_state("Judgement");
$online2['content'];
$txt.= "##GI_highlight##<a href='chatcmd:///tell Judgement Im interested in joining Lorem Ipsum'>Judgement</a> - Melee class leader##end##\n";
$online3 = $this -> bot -> core("online") -> get_online_state($Cronan);
$online3['content'];
$txt.= "##GI_highlight##<a href='chatcmd:///tell Cronan Im interested in joining Lorem Ipsum'>Cronan</a> - Tank Class leader##end##\n";

How do I get the online offline to show?
Barlyman 80 HoX @ Crom <Circle of Eternity>

Offline Vrykolas

  • BeBot Apprentice
  • ***
  • Posts: 100
  • Karma: +0/-0
Re: Help with online info in GuildInfo Relay Module
« Reply #4 on: July 30, 2008, 02:45:29 pm »
try:
Code: [Select]
function info()
{
$txt.= "##GI_red##<font Color='red' face='LARGE_BOLD'>Lorem Ipsum Guild Info:</font>##end##\n";
$txt.= "##GI_red##Website:##end## ##GI_highlight##http://loremipsum.mine.com##end##\n\n";
$online = $this -> bot -> core("online") -> get_online_state('Banshee');
$txt.= "##GI_red##Leader:##end##\n";
$txt.= "##GI_highlight##<a href='chatcmd:///tell Banshee Im interested in joining Lorem Ipsum'>Banshee</a>##end## ".$online['content']."\n\n";
$txt.= "##GI_red##Officers:##end##\n";
$online = $this -> bot -> core("online") -> get_online_state("Judgement");
$txt.= "##GI_highlight##<a href='chatcmd:///tell Judgement Im interested in joining Lorem Ipsum'>Judgement</a> - Melee class leader##end## ".$online['content']."\n";
$online = $this -> bot -> core("online") -> get_online_state('Cronan');
$txt.= "##GI_highlight##<a href='chatcmd:///tell Cronan Im interested in joining Lorem Ipsum'>Cronan</a> - Tank Class leader##end## ".$online['content']."\n";

Offline Barlyman

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
    • Circle of Eternity
Re: Help with online info in GuildInfo Relay Module
« Reply #5 on: July 30, 2008, 04:50:52 pm »
Thanks mate, works fine now :)

this is the end result, looks good :)
Code: [Select]
function info()
{
$txt.= "##GI_red##<font Color='red' face='LARGE_BOLD'>Lorem Ipsum Guild Info:</font>##end##\n";
$txt.= "##GI_red##Website:##end## ##GI_highlight##http://loremipsum.mine.com##end##\n\n";
$online = $this -> bot -> core("online") -> get_online_state('Banshee');
$txt.= "##GI_red##Leader:##end##\n";
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Banshee Im interested in joining Lorem Ipsum'>Banshee</a>##end##\n\n";
$txt.= "##GI_red##Officers:##end##\n";
$online = $this -> bot -> core("online") -> get_online_state('Judgement');
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Judgement Im interested in joining Lorem Ipsum'>Judgement</a> - Melee class leader##end##\n";
$online = $this -> bot -> core("online") -> get_online_state('Cronan');
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Cronan Im interested in joining Lorem Ipsum'>Cronan</a> - Tank Class leader##end##\n";
$online = $this -> bot -> core("online") -> get_online_state('Lajdyhawk');
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Lajdyhawk Im interested in joining Lorem Ipsum'>Lajdyhawk</a> - Healer Class leader##end##\n";
$online = $this -> bot -> core("online") -> get_online_state('Mimic');
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Mimic Im interested in joining Lorem Ipsum'>Mimic</a> - Ranged Class leader##end##\n";
$online = $this -> bot -> core("online") -> get_online_state('Barlyman');
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Barlyman Im interested in joining Lorem Ipsum'>Barlyman</a> - Bank, Guildbot, Forum##end##\n";
$online = $this -> bot -> core("online") -> get_online_state('Akimo');
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Akimo Im interested in joining Lorem Ipsum'>Akimo</a> - Recruitment, leveling##end##\n\n";
$txt.= "##GI_red##Guild Info:##end##\n";



keep up the good work
//Barlyman
« Last Edit: July 30, 2008, 06:56:19 pm by Barlyman »
Barlyman 80 HoX @ Crom <Circle of Eternity>

Offline Barlyman

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
    • Circle of Eternity
Re: Help with online info in GuildInfo Relay Module
« Reply #6 on: September 08, 2008, 01:53:22 am »
OK, time to upgrade the guildinfo even more, What I'm trying to do now is only make the officers online have clickable names

Code: [Select]
function info()
{
$txt.= "##GI_red##<font Color='red' face='LARGE_BOLD'>Circle of eternity Info:</font>##end##\n";
$txt.= "##GI_red##Website:##end## ##GI_highlight##http://www.coeguild.com##end##\n\n";
$txt.= "##GI_red##Leader:##end##\n"; 
$online = $this -> bot -> core("online") -> get_online_state('Leyor');
if $online['content'] = "online";
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Leyor Im interested in joining Circle of Eternity'>Leyor</a>##end##\n";
else;
$txt.= "##GI_highlight##".$online['content']." :: Leyor##end##\n";
endif;
$online = $this -> bot -> core("online") -> get_online_state('Banshee');
if $online['content'] = "online";
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Banshee Im interested in joining Circle of Eternity'>Banshee</a>##end##\n\n";
else;
$txt.= "##GI_highlight##".$online['content']." :: Banshee##end##\n\n";
endif;
$txt.= "##GI_red##Officers:##end##\n";

Thow this only gives me an error stating unsuspected T_variable...

Any Idé how this could be solved?

Thanks in advance
Barlyman
Barlyman 80 HoX @ Crom <Circle of Eternity>

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Help with online info in GuildInfo Relay Module
« Reply #7 on: September 08, 2008, 02:53:50 am »
need more details mainly the line it says
and also need to know what lines you are posting

Offline Barlyman

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
    • Circle of Eternity
Re: Help with online info in GuildInfo Relay Module
« Reply #8 on: September 08, 2008, 02:56:24 am »
Got it to work now :)
ctrl + c some code from core/whois.php

Code: [Select]
function info()
{
$txt.= "##GI_red##<font Color='red' face='LARGE_BOLD'>Circle of eternity Info:</font>##end##\n";
$txt.= "##GI_red##Website:##end## ##GI_highlight##http://www.coeguild.org##end##\n\n";
$txt.= "##GI_red##Leader:##end##\n"; 
$online = $this -> bot -> core("online") -> get_online_state('Leyor');
if ($online['status'] <= 0)
{
$txt.= "##GI_highlight##".$online['content']." :: Leyor##end##\n";
}
else
{
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Leyor Im interested in joining Circle of Eternity'>Leyor</a>##end##\n";
}
$online = $this -> bot -> core("online") -> get_online_state('Banshee');
if ($online['status'] <= 0)
{
$txt.= "##GI_highlight##".$online['content']." :: Banshee##end##\n";
}
else
{
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Banshee Im interested in joining Circle of Eternity'>Banshee</a>##end##\n";
}
$txt.= "##GI_red##Officers:##end##\n";

So lets say Banshe is online but Leyor is not it will look like this

Circle of eternity Info:
Website:
http://www.coeguild.org

Leader:
Offline :: Leyor
Online :: Banshee
« Last Edit: September 08, 2008, 03:01:33 am by Barlyman »
Barlyman 80 HoX @ Crom <Circle of Eternity>

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: Help with online info in GuildInfo Relay Module
« Reply #9 on: September 08, 2008, 02:22:58 pm »
is there an easy way to get this ported for AO? Would love something similar

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Help with online info in GuildInfo Relay Module
« Reply #10 on: September 08, 2008, 03:23:35 pm »
chances are it would work with ao as is
altho the module looks org specific so chances would be needed, if barlyman post full code ill look at  it and made some improvment as well and making sure its ao compatible

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: Help with online info in GuildInfo Relay Module
« Reply #11 on: September 08, 2008, 06:44:17 pm »
getting error upon bootup, can;t attach, so here's the full code with the changes from this post


Code: [Select]
'<?php
/*
* GuildInfo, by Kaeus
* 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""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).";
}

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##<font Color='red' face='LARGE_BOLD'>Circle of eternity Info:</font>##end##\n";
$txt.= "##GI_red##Website:##end## ##GI_highlight##http://www.coeguild.org##end##\n\n";
$txt.= "##GI_red##Leader:##end##\n";  
$online $this -> bot -> core("online") -> get_online_state('Leyor');
if ($online['status'] <= 0)
{
$txt.= "##GI_highlight##".$online['content']." :: Leyor##end##\n";
}
else
{
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Leyor Im interested in joining Circle of Eternity'>Leyor</a>##end##\n";
}
$online $this -> bot -> core("online") -> get_online_state('Banshee');
if ($online['status'] <= 0)
{
$txt.= "##GI_highlight##".$online['content']." :: Banshee##end##\n";
}
else
{
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Banshee Im interested in joining Circle of Eternity'>Banshee</a>##end##\n";
}
$txt.= "##GI_red##Officers:##end##\n";
/*
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;

}

/*
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 -> ao -> 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 Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Help with online info in GuildInfo Relay Module
« Reply #12 on: September 08, 2008, 07:00:47 pm »
whats the error?

Offline clashbot

  • BeBot Expert
  • ****
  • Posts: 295
  • Karma: +0/-0
    • Ascension's Home
Re: Help with online info in GuildInfo Relay Module
« Reply #13 on: September 08, 2008, 07:03:30 pm »
parse error: syntax error, unexpected ';' expecting T_FUNCTION in guildinfo.php on line 158

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Help with online info in GuildInfo Relay Module
« Reply #14 on: September 08, 2008, 07:25:46 pm »
function info has incorrect count of { and }

 

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