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: Cannot find the T_String in here + Buddy_Status problem.  (Read 6407 times)

0 Members and 1 Guest are viewing this topic.

Offline Faelwen

  • BeBot User
  • **
  • Posts: 35
  • Karma: +0/-0
Cannot find the T_String in here + Buddy_Status problem.
« on: April 28, 2009, 12:07:53 am »
here is the script i have, will post the whole script, but the problem is around line 94 if "cmd" has right. Thanks for doing this as i cannot see any problem with it but my comp can..

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

class GuildInfo extends BaseActiveModule
{

   function __construct(&$bot)
   {
      parent::__construct(&$bot, get_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($msg, strlen('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##_-T F W-_##end##\n\n";
     
     
      $txt.= "##purple##Leaders:##end##\n\n";
      $online = $this -> bot -> core("online") -> get_online_state('Faelwen');
      $txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Faelwen Im interested in joining _-T F W-_'>Faelwen</a>##end##\n";

      $txt.= "##purple##Leaders Alts:##end##\n";
      $online = $this -> bot -> core("online") -> get_online_state('Eliteguard');
      $txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Eliteguard Im interested in joining _-T F W-_'>Eliteguard</a>##end##\n";
     
      $txt.= "##purple##Officers:##end##\n";
      $online = $this -> bot -> core("online") -> get_online_state('Xaviera');
      $txt.= "##GI_highlight##".$online['content']." :: <a href='chatcmd:///tell Xaviera Im interested in joining _-T F W-_'>Xaviera</a> - Officer##end##\n";

      $txt.= "##GI_red##Website:##end## ##GI_highlight##http://www.thefw.forumotion.net##end##\n\n";
      $txt.= "##GI_red##City:##end## ##GI_highlight##Full Tier I (include towers and walls). soon Tier II keep##end##\n\n";
     
      $txt.= "##GI_red##Recruitment:##end## ##yellow## We are looking for people older then the age of 17 and from level 50+ 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## ##yellow##[Medium]##end##\n";
      $txt.= "##purple##Bear Shaman:##end## ##Yellow##[Medium]##end##\n";
      $txt.= "##purple##Conqueror:##end## ##yellow##[Medium]##end##\n";
      $txt.= "##purple##Dark Templer:##end## ##Yellow##[Medium]##end##\n";
      $txt.= "##purple##Demonologist:##end## ##Yellow##[Medium]##end##\n";
      $txt.= "##purple##Guardian:##end## ##yellow##[Medium]##end##\n";
      $txt.= "##purple##Herald of Xotli:##end## ##Yellow##[Medium]##end##\n";
      $txt.= "##purple##Necromancer:##end## ##green##[High]##end##\n";
      $txt.= "##purple##Priest of Mitra:##end## ##green##[High]##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.= "The Forgotten Warriors have just recently opened the Application system and hopes as many uses it instead of spamming "Can i join?". Would be a lot easier for us if you did go to our website that is under graphical developement, and acutally read the application rules and read little more..\n

Our main goal is to provide the members at the highest point we can get. We don't have a 24 man raid on our own yet, but that will come when the time comes by, step-by-step, with other words. We are currently Laying weight to powerlevell everyone that wants to hit lvl 80 as soon as possible. \n

We are also Doing instances everyday and when we can, such as Onyx, Epic Kheshatta, The Scorpion Cave. And so on. We are also happy with that we are helping our members really good with the questing part. The loot system isnt random, and if someone needs when i dont say the can need i just give them a warning. if you cant follow it then you are banned from instances maybe a couple of days, just to learn you the basics we have. If you only need it to your class and or Alts you can need by asking the group/raid if any other people wants it/needs it. \n

We dont care if you are Casual or Hardcore Players, we want Hardcore players for sure. But it's great to have Casual players to ofc. When it comes to the "Where is your guild from, Scandinavian, english, russian, poland or whatsoever. We just want you to inform you that we are an International guild that needs only english written people that can write in English, doesn't mather if you have dyslexia, just tell the problem to us either in-game or at the forum.\n

Our motto is.
Respect the ones above you, take action and listen carefully for both intruders and for new ORDERS!
Ones again, send your application in here! http://www.thefw.forumotion.net

Congratulations for coming so far, keep in touch m8s! \n\n";
      $txt.= "<a href='chatcmd:///tell tfwbot !ginfo members'>List of Members</a>\n";
      $txt.= "<a href='chatcmd:///tell tfwbot !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##• " . $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• ".$key." = ##blob_title##".$value."##end##";
      $blob = " :: " . $this -> bot -> core("tools") -> make_blob("click to view", $inside);

      return $total . " Guild Classes:" . $blob;
   }
}
?>
« Last Edit: April 28, 2009, 03:00:10 pm by Faelwen »

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Cannot find the T_String in here.. need deeply help..
« Reply #1 on: April 28, 2009, 12:36:14 am »
Uhm... I think you forgot a closing " somewhere, at least if my memory is right. Check around the mentioned line.

Offline Faelwen

  • BeBot User
  • **
  • Posts: 35
  • Karma: +0/-0
Re: Cannot find the T_String in here.. need deeply help..
« Reply #2 on: April 28, 2009, 12:54:50 am »
Bah i checked, doesnt seem to be any.. Need help from everyone i can get guys!

Offline Sabkor

  • Contributor
  • *******
  • Posts: 30
  • Karma: +0/-0
Re: Cannot find the T_String in here.. need deeply help..
« Reply #3 on: April 28, 2009, 08:16:17 am »
Just like the error says, line 94...

$txt.= "The Forgotten Warriors have just recently opened the Application system and hopes as many uses it instead of spamming "Can i join?". Would be a lot easier for us if you did go to our website that is under graphical developement, and acutally read the application rules and read little more..\n


All the quotes there are causing your error.

Offline Faelwen

  • BeBot User
  • **
  • Posts: 35
  • Karma: +0/-0
Re: Cannot find the T_String in here.. need deeply help..
« Reply #4 on: April 28, 2009, 02:55:48 pm »
Thanks m8, but i seem to have another problem with the "new" Whois.php

This error comes up... and i really cant see the problem! been checking and scratching my head at this..

Fatal error: Cannot access private propert Bot::$buddy_status in C:\Users\Steven\and so on\Bebot-hyborian\core\Whois.php on line 124.

Quote
/*
   This gets called if a buddy logs on/off
   */
   function buddy($name, $online, $level, $location, $class)
   {
      $user = $this -> bot -> core("chat") -> get_uid($name);

      $who = array();
      $who["id"] = $user;
      $who["nickname"] = $name;
      if(!array_key_exists($name, $this -> bot -> buddy_status))
         $who["online"] = 0;
      else
      {
         if(4 == ($this -> bot -> buddy_status[$name] & 4))
            $who["online"] = 3;
         else if(2 == ($this -> bot -> buddy_status[$name] & 2))
            $who["online"] = 2;
         else if(1 == ($this -> bot -> buddy_status[$name] & 1))
            $who["online"] = 1;
         else
            $who["online"] = 0;
      }

      $who["level"] = $level;
      $who["location"] = $location;
      $class_name = $this -> class_name[$class];
      if ($class_name == "")
      {
         $class_name = "Commoner";
      }
      $who["class"] = $class_name;
      $lookup = $this -> bot -> db -> select("SELECT * FROM #___craftingclass WHERE name = '" . $name . "'", MYSQL_ASSOC);
      if (!empty($lookup))
      {
         $who["craft1"] = $lookup[0]['class1'];
         $who["craft2"] = $lookup[0]['class2'];
      }
      $this -> update($who);
   }

Would be really helpful if you guys could solve this while i'm studying and scratching my head into this ^^
« Last Edit: April 28, 2009, 03:05:04 pm by Faelwen »

 

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