BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Age of Conan Archive => AoC 0.6.x Custom/Unofficial modules => Topic started by: dragonjr on November 12, 2010, 02:03:30 am

Title: ginfo help please
Post by: dragonjr on November 12, 2010, 02:03:30 am
ok im still learning hearand ive read 3-4 diffrent things ive gotten one ginfo.php put it into the custom mods and i ahvent changed the info on it(guild info ). ive read i need to make a info file and put it into the txt folder under the bot but what is the info file and how do i make it ?
any help would be great
thanks
Title: Re: ginfo help please
Post by: Runemy on November 12, 2010, 03:41:59 am
You do not need another file, all you need is in the ginfo.php file.

Open it in a editor like Crimson Editor (http://www.crimsoneditor.com/) and customize it as you wish.
Title: Re: ginfo help please
Post by: snyder on November 12, 2010, 10:46:25 am
http://www.cro-guild.com/bebot/Ginfo.php.txt
this is ginfo module, change officers ofc


this is recruitment info file that is defined at line 11:
http://www.cro-guild.com/bebot/recruitment.php.txt
change text to your likeing


and dont forget to rename files :)
Title: Re: ginfo help please
Post by: Runemy on November 12, 2010, 02:10:00 pm
Oh, hmm.. yeah.. I was a bit fast there, we're using guildinfo.php for our needs when it comes to this, and not ginfo.php :)

This is ours, and we're not using 2 files for this.
(rename from .txt to .php)
Title: Re: ginfo help please
Post by: dragonjr on November 13, 2010, 01:36:56 am
so am i taking the ginfo.php and changing it to a txt file and puting it in to the txt file ???
Title: Re: ginfo help please
Post by: Cuval on November 18, 2010, 08:08:00 am
You only keep the ginfo.php and change the texts in that file in your code editor (notepad++ or whatever you like to use). All texts are in the .php file. This module does not support a .txt file with the info.
Title: Re: ginfo help please
Post by: dragonjr on November 19, 2010, 01:11:26 am
do any of the mods except .txt because im getting broken codes in scripts and everything else do i just rename them ?
Title: Re: ginfo help please
Post by: snyder on November 24, 2010, 12:11:42 pm
you can change
[/code]private $recruitment_file = 'D:/www/bebot/recruitment.php';
Code: [Select]
to whatever you want, it will work since file is being read with file_get_contents() function
Title: Re: ginfo help please
Post by: dragonjr on November 24, 2010, 07:12:28 pm
i have one more question on the guild info mod is it possible to run 2 different ginfo at the same time like i wanted to try this one
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##_-E M P-_##end##\n\n";
      
      
      
$txt.= "##purple##Leaders:##end##\n\n";
      
$online $this -> bot -> core("online") -> get_online_state('Jiheld');
      
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Jiheld Im interested in joining _-E M P-_'>Jiheld</a>##end##\n";
      
$online $this -> bot -> core("online") -> get_online_state('Ronmel');
      
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Ronmel Im interested in joining _-E M P-_'>Ronmel</a>##end##\n\n";
      
$txt.= "##purple##Leaders Alts:##end##\n";
      
$online $this -> bot -> core("online") -> get_online_state('Mustage');
      
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Mustage Im interested in joining _-E M P-_'>Mustage</a>##end##\n";
      
$online $this -> bot -> core("online") -> get_online_state('Ronmello');
      
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Ronmello Im interested in joining _-E M P-_'>Ronmello</a>##end##\n";
      
$online $this -> bot -> core("online") -> get_online_state('Balashi');
      
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Balashi Im interested in joining _-E M P-_'>Balashi</a>##end##\n\n";
      
      
$txt.= "##purple##Officers:##end##\n";
      
$online $this -> bot -> core("online") -> get_online_state('Cheyenne');
      
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Cheyenne Im interested in joining _-E M P-_'>Cheyenne</a> - Officer##end##\n";
      
$online $this -> bot -> core("online") -> get_online_state('Blui');
      
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Blui Im interested in joining _-E M P-_'>Blui</a> - Officer##end##\n";
      
$online $this -> bot -> core("online") -> get_online_state('Haiwan');
      
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Haiwan Im interested in joining _-E M P-_'>Haiwan</a> - Officer##end##\n";
      
$online $this -> bot -> core("online") -> get_online_state('Froxer');
      
$txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Froxer Im interested in joining _-E M P-_'>Froxer</a> - Officer##end##\n";
      
$txt.= "##GI_red##Website:##end## ##GI_highlight##http://www.enragedpolarbears.com##end##\n\n";
      
$txt.= "##GI_red##City:##end## ##GI_highlight##Full Tier II (include towers and walls). Tier III keep##end##\n\n";
      
      
$txt.= "##GI_red##Recruitment:##end## ##yellow## We looking for people older then the age of 18 and from level 70+ Active people that want to raid and have fun.##end##\n\n";
      
$txt.= "##Red## [Low]: We have enough.##end## ##yellow## [Medium]: We could use 1.##end## ##green##[High]: need 2 or more.##end##\n\n";
      
$txt.= "##purple##Assissin:##end## ##yellow##[Medium]##end##\n";
      
$txt.= "##purple##Barbarian:##end## [Closed]##end##\n";
      
$txt.= "##purple##Bear Shaman:##end## ##red##[Low]##end##\n";
      
$txt.= "##purple##Conqueror:##end## ##yellow##[Medium]##end##\n";
      
$txt.= "##purple##Dark Templer:##end## ##red##[Low]##end##\n";
      
$txt.= "##purple##Demonologist:##end## ##Yellow##[Medium]##end##\n";
      
$txt.= "##purple##Guardian:##end## ##red##[Low]##end##\n";
      
$txt.= "##purple##Herald of Xotli:##end## ##Yellow##[Medium]##end##\n";
      
$txt.= "##purple##Necromancer:##end## ##Red##[Low]##end##\n";
      
$txt.= "##purple##Priest of Mitra:##end## ##red##[Low]##end##\n";
      
$txt.= "##purple##Ranger:##end## ##Yellow##[Medium]##end##\n";
      
$txt.= "##purple##Tempest of set:##end## ##Yellow##[Medium]##end##\n\n";
      
      
$txt.= "##GI_red##Guild Info:##end##\n";
      
$txt.= "##GI_info##";
      
$txt.= "Enraged Polarbears is curently progressing through the 24 people raid material of AoC, and we are curently in need of a few selected recruits among our ranks.\n

Our main goal is to form a stable and solid relatively small raiding team with people that will get to know each other and have fun together. This is, in our opinion, the only way a guild can stack together and succeed, and the only way one won't feel just another pawn of the guild's leadership. We plan on making members feel at home and welcome. We also plan on encouraging people to take part in the guild's doings, not only in the raiding part but also the planning ones. We will ask for your opinion, your best thought strategy, your participation in the guild's politics, we will be happy when you speak your mind and provide constructive feedback at our forum. \n

We will also face with respect any prospective applicants, trials and members. There will not be any form of abusing at all, none harassing/pseudo-professional elitist attitude and so on and forth. We are fully aware of the true importance of this game, which is close to zero, and our priority -hands down- will be to have fun and make people in the raid happy so they will be eager to raid with us again, irregardless of the epics. \n

That of course doesn't mean we will slack behind and go casual, rather the opposite. We are a semi-hardcore guild with high if not very high end-game goals that are to be achieved, meaning that we have a good selection system and only keep players good enough to achieve those goals. \n

In any case, anyone who decides to apply, please visit our website for an application. Or just have a chat with one of us. http://www.enragedpolarbears.com \n

If you reached here, bravo! and thank you for your time and hope to see all of you soon online! \n\n"
;
      
$txt.= "<a href='chatcmd:///tell embot !ginfo members'>List of Members</a>\n";
      
$txt.= "<a href='chatcmd:///tell embot !ginfo classes'>List of Classes</a>\n";
      
$txt.= "##end##";
      
      
      return 
$this -> bot -> core("tools") -> make_blob("_-E M P-_"$txt);
   }
   
/*
   Still working on this, for now just some random debugging stuff I was trying
   */
   
function recruit()
   {   
      
$blob "EMP 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##&#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;
   }
}
?>

and im useing this one

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##Black Moon Rising##end##\n\n";
    
$txt.= "##end##\n";      
      
      
$txt.= "##highlight##Leader:##end##\n\n";
   
$online $this -> officercheck("Reklats");
   
$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("nerissa");
   
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
    
$txt.= "##end##\n";
     
$online $this -> officercheck("sininstyle");
   
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
    
$txt.= "##end##\n";
   
$online $this -> officercheck("jormette");
   
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
    
$txt.= "##end##\n";
   
$online $this -> officercheck("bludflo");
   
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
    
$txt.= "##end##\n";
 $online $this -> officercheck("wintershade");
   
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
    
$txt.= "##end##\n";
 $online $this -> officercheck("Lunixxheals");
   
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
    
$txt.= "##end##\n";
   
$online $this -> officercheck("thrognar");
   
$online_state $online[0];
      
$txt.= "##GI_highlight##".$online_state['content'] . $online[1];
    
$txt.= "##end##\n";    
   
$online $this -> officercheck("melwren");
   
$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## http://blackmoonrising.guildlaunch.com##end##\n\n";
      
$txt.= "##GI_red##City:##end## ##Silver##Complete T3 City##end##\n\n";
      
$txt.= "##GI_red##Raids:##end## ##Silver##T1 T2 T3##end##\n\n";
      
$txt.= "##GI_red##Recruitment:##end## ##Silver##Open.##end##\n\n";
    
$txt.= "##end##\n";
      
$txt.= "##highlight##Assassin:##end## ##Red##[open]##end##\n";
      
$txt.= "##highlight##Barbarian:##end## ##Red## [open]##end##\n";
      
$txt.= "##highlight##Bear Shaman:##end## ##Red##[open]##end##\n";
      
$txt.= "##highlight##Conqueror:##end## ##Red##[open]##end##\n";
      
$txt.= "##highlight##Dark Templer:##end## ##Red##[open]##end##\n";
      
$txt.= "##highlight##Demonologist:##end## ##Red##[open]##end##\n";
      
$txt.= "##highlight##Guardian:##end## ##Red##[open]##end##\n";
      
$txt.= "##highlight##Herald of Xotli:##end## ##Red##[open]##end##\n";
      
$txt.= "##highlight##Necromancer:##end## ##Red##[open]##end##\n";
      
$txt.= "##highlight##Priest of Mitra:##end## ##Red##[open]##end##\n";
      
$txt.= "##highlight##Ranger:##end## ##Red##[open]##end##\n";
      
$txt.= "##highlight##Tempest of Set:##end## ##Red##[open]##end##\n\n";
    
$txt.= "##end##\n";
      
      
$txt.= "##GI_red##Guild Info:##end##\n";
      
$txt.= "##Silver##";
      
$txt.= "Mature Casual Guild -  Looking for all classes and levels - and serious raiders, especially West Coast and Oceanic Players.Also Looking for Tier Three Raiders willing to put in the work of learning new strats and be part of a team.
\n\n"
;
    
$txt.= "##end##\n";
    
    
      
      
      return 
$this -> bot -> core("tools") -> make_blob("Black Moon Rising"$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;
   }
}
?>

and i have this file saved in the mod folder as php and i have it saved in txt file.
if i want to add info on it all i do is change and save it in both files but is it possible to have 2 diffrent Ginfo's in the bot running at the same time? if so how would i make it work?

Title: Re: ginfo help please
Post by: Drizzurdeen on November 24, 2010, 08:31:34 pm
of course it is possible ... just change the name of the second file ... like ginfo2.php than u have to change the code itself ... u have to change the comand ginfo into ex. ginfo2 ... so u can see with !ginfo2 the text of the ginfo2.php ... this would be the easiest way so i think

hope i could help

greetz drizz
Title: Re: ginfo help please
Post by: dragonjr on November 25, 2010, 12:25:47 am
i just want to make sure im doing this right
<?php
/*
* GuildInfo, by Kaeus
* This module helps people with guild recruitment.
*
*
*/
$GuildInfo = new GuildInfo($bot);

class GuildInfo extends BaseActiveModule

thats the orginal

<?php
/*
* GuildInfo2, by Kaeus
* This module helps people with guild recruitment.
*
*
*/
$GuildInfo2 = new GuildInfo2($bot);

class GuildInfo2 extends BaseActiveModule

is that what you mean by adding the 2?
Title: Re: ginfo help please
Post by: Drizzurdeen on November 25, 2010, 09:54:12 am
jebb
Title: Re: ginfo help please
Post by: Yite on November 25, 2010, 09:55:45 am
You'd also have to change (at the very least) the

Code: [Select]
      $this -> register_command('all', 'ginfo', "ANONYMOUS");
and the command handler:
Code: [Select]
   function command_handler($name, $msg, $origin)
   {
      if (preg_match('/^ginfo/i', $msg, $info)) {
         $words = trim(substr($msg, strlen('ginfo')));


Having said that, if you want to try out and play around with the module I'd recommend either having a second bot (for testing) running (if you make that bot part of the same guild make sure each bot knows about the existence of the other and they use different op commands (like ! and @) configurable in the conf file)
Or rename the original Ginfo.php to _Ginfo.php (modules starting with a _ are not loaded on startup) and play with your second Ginfo.php

Title: Re: ginfo help please
Post by: dragonjr on November 25, 2010, 06:13:47 pm
ok thanks guys for the quick reply
Title: Re: ginfo help please
Post by: dillinger on January 18, 2011, 04:16:23 pm
Hi all

I'm using the !ginfo as well and It's great! But I want it to make it look a "tick" sexyer... so here is my question:

The start(hyper)link für the !ginfo script is shown in AoC standard orange, wich is ugly as hell.

How can I set the code to format the link in other colours and styles?

Code: [Select]
return $this -> bot -> core("tools") -> make_blob("<font color='#6E328A' face='HYBORIANSMALL'>Gildeninfo!</font>", $txt); This is my current code.

Thanx in advance!

dill
Title: Re: ginfo help please
Post by: Kyr on January 19, 2011, 01:40:30 am
Try this untested code:

Code: [Select]
return $this -> bot -> core("tools") -> make_blob(<font color=#6E328A face=HYBORIANSMALL>Gildeninfo!</font>", $txt, "style=text-decoration:none");

Title: Re: ginfo help please
Post by: dillinger on January 19, 2011, 09:02:06 am
Thanx Kyr!

I will test this later that day.
Title: Re: ginfo help please
Post by: dillinger on January 19, 2011, 11:25:42 am
I testet your code and the output has the same look as before -_- The font type is correct (HYBORIANSMALL), but I'm not able to change the color at all! :(

Any idea pls?

dill
Title: Re: ginfo help please
Post by: Yite on January 19, 2011, 11:55:46 am
The colour is defined by the font color=#6E328A bit

this is a RGB (Red Green Blue) value in hex, so to analyze it:
6E is the amount of red
32 is the amount of green
8A is the amount of blue

If you want the letters to be bright red you could use:
font color=#FF0000

green => #00FF00

blue => #0000FF

white => #FFFFFF

grey => #777777

etc

A quick google search and you can find a page like this http://cloford.com/resources/colours/500col.htm which has a lot of colours and their RGB values.


Title: Re: ginfo help please
Post by: dillinger on January 19, 2011, 12:05:07 pm
Ye ye Yite

I know the color tables for HTML, but my problem is: How can I colourize the static link in the !ginfo script. I tested it in a few ways, but all it changes is the font face and nothing more.

Unfortunately Kyr's code wont work also  :'(
Code: [Select]
return $this -> bot -> core("tools") -> make_blob("<font color=#6E328A face=HYBORIANSMALL>Gildeninfo!</font>", $txt, "style=text-decoration:none");
Title: Re: ginfo help please
Post by: Yite on January 19, 2011, 12:22:14 pm
Right so you're not after changing the colours in the blob itself but want to change the colour of the link that is returned in guildchat or tells.

I know how to do it in static scripts with a blob, I'll post one this evening (if I remember :p) which might or might not be of help :-/

 


Title: Re: ginfo help please
Post by: dillinger on January 19, 2011, 12:26:41 pm
Right so you're not after changing the colours in the blob itself but want to change the colour of the link that is returned in guildchat or tells.

I know how to do it in static scripts with a blob, I'll post one this evening (if I remember :p) which might or might not be of help :-/
Jay, that would be great! I can give you a reminder if u want ^^

Thanx!
Title: Re: ginfo help please
Post by: Kyr on January 19, 2011, 02:35:28 pm
Have you tried other color codes?  The color and face changes work for me in the scripts module.

Code: [Select]
<font color=#ff00ff face=hyborianlarge>Click here</font>
Title: Re: ginfo help please
Post by: dillinger on January 19, 2011, 03:07:54 pm
Yeah, all I need is the code to change the link color in the "/tell" script of !ginfo...

Code: [Select]
return $this -> bot -> core("tools") -> make_blob("<font color=#6E328A face=HYBORIANSMALL>ildeninfo!</font>", $txt, "style=text-decoration:none");This code wont change the link color! -_-
Title: Re: ginfo help please
Post by: Kentarii on January 19, 2011, 03:42:39 pm
I haven't really tested this thoroughly since conanchat doesn't support hyboriansmall, but colors should work.

Code from main/14_Tools.php
Code: [Select]
        function make_blob($title, $content)
        {
                // Using " inside a blob will end the blob.
                // Convert opening and closing tags with " to '
                // Convert any other " to HTML entities.
                $content = str_replace("=\"", "='", $content);
                $content = str_replace("\">", "'>", $content);
                $content = str_replace("\"", "&quot;", $content);

                return "<a href=\"text://" . $content . "\">" . $title . "</a>";
        }
The code from Kyr won't work without modifications...

You can add a modified make_blob function to your ginfo module and use that instead of the one inside tools
(You could modify 14_Tools.php if you want, but your change will be lost when you upgrade bebot.)

Edit GuildInfo.php and add this function at the bottom or wherevever inside the class.
Code: [Select]
        function make_blob($title, $content, $attributes = '')
        {
                // Using " inside a blob will end the blob.
                // Convert opening and closing tags with " to '
                // Convert any other " to HTML entities.
                $content = str_replace("=\"", "='", $content);
                $content = str_replace("\">", "'>", $content);
                $content = str_replace("\"", "&quot;", $content);

                return "<a href=\"text://" . $content . "\"". ($attributes ? ' '. $attributes : '') .">" . $title . "</a>";
        }

Replace this:
Code: [Select]
return $this -> bot -> core("tools") -> make_blob("<font color='#6E328A' face='HYBORIANSMALL'>Gildeninfo!</font>", $txt);
with:
Code: [Select]
return $this -> make_blob("<font color='#6e328a' face='hyboriansmall'>Gildeninfo!</font>", $txt, 'style="text-decoration:none"');

Hope it works out for you.
Title: Re: ginfo help please
Post by: dillinger on January 19, 2011, 04:05:31 pm
Big up's for you Kentarii and also thanx to Kyr!

Your code is working fine! PERFECT!

Thanx in advance!

dill
Title: Re: ginfo help please
Post by: Kritze on May 08, 2011, 10:39:08 am
hey, how i can align the text left? <left> is not working :(
Title: Re: ginfo help please
Post by: Kentarii on May 09, 2011, 12:33:47 pm
There is no such thing as <left>. All you need to do is remove the <center> & </center> tags.
Title: Re: ginfo help please
Post by: Kritze on May 10, 2011, 12:50:12 am
There is no such thing as <left>. All you need to do is remove the <center> & </center> tags.

yay! works thank you so much! :D
Title: Re: ginfo help please
Post by: crom on June 15, 2014, 07:03:07 pm
Hey. i know this is an old thread, but asking here anyway. is there a way to make the bot post recruit scripts in global chat?
SimplePortal 2.3.7 © 2008-2024, SimplePortal