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: problem with invite command, need fix  (Read 9959 times)

0 Members and 1 Guest are viewing this topic.

Offline kinbaku

  • BeBot Rookie
  • *
  • Posts: 8
  • Karma: +0/-0
problem with invite command, need fix
« on: November 01, 2005, 09:09:30 pm »
If you try to invite the bot to its own channel it results in a crash. ie if your bot is named bob, and u do !invite bob, the bot disconnects with this error in the console window:

Read error: EOF
[CONN] [ERROR] Bot has disconnected. Reconnecting in 60 seconds.
The bot is restarting.

Wondering if anybody could write a fix for me, i cant seem to fix it myself. Thanks.

PS - one would assume you could just NOT invite the bot to its own channel, but some friends of mine seem to find it funny to do so just to crash the bot. Thanks.

Offline Khalem

  • BeBot Founder
  • Administrator
  • ********
  • Posts: 1169
  • Karma: +0/-0
    • http://www.ancarim.com
problem with invite command, need fix
« Reply #1 on: November 03, 2005, 12:52:35 am »
This is a theoretical fix.

Open modules/PrivGroup.php
Find function invite
Replace it with
Code: [Select]

    function invite($from, $type, $who)
    {
        if (($this -> bot -> guildbot && $this -> bot -> is_member($from)) ||
                             $this -> bot -> admin -> in_group($from, "raidleader") ||
                                         $this -> bot -> admin -> in_group($from, "admin") ||
                                         $this -> bot -> admin -> in_group($from, "superadmin"))
        {
                if ($this -> bot -> botname == $who)
                {
                  $msg = "You cannot invite the bot to its own chat group";
                }
                else if ($this -> bot -> aoc -> get_uid($who))
                {
                  $this -> bot -> aoc -> privategroup_invite($who);
                  $this -> bot -> send_tell($who, "You have been invited to the privategroup by " . $from . ".");
                  $msg = "<font color=#ffff00>" . $who . "</font> has been invited.";
                }
                else
                {
                  $msg = "Player <font color=#ffff00>" . $who . "</font> does not exist.";
                }
        }
      else
        $msg = "You do not have permission to use this command.";


      if ($type == "tell")
        $this -> bot -> send_tell($from, $msg);
      else
        $this -> bot -> send_pgroup($msg);
    }
  }


Untested, but should work.
BeBot Founder and Fixer Kingpin

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
problem with invite command, need fix
« Reply #2 on: November 07, 2005, 05:03:07 pm »
Yep, works like a champ.  :D
<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky

Offline Solerna

  • BeBot User
  • **
  • Posts: 21
  • Karma: +0/-0
problem with invite command, need fix
« Reply #3 on: November 10, 2005, 11:23:29 pm »
Works like a charm IF i suply the bot name all in lowercase letters "bot" However if I invite "Bot" or "bOt" or any other version it still crashes =/

Offline Xenixa

  • Contributor
  • *******
  • Posts: 307
  • Karma: +0/-0
problem with invite command, need fix
« Reply #4 on: November 10, 2005, 11:33:17 pm »
Replace
Code: [Select]
if ($this -> bot -> botname == $who)
With
Code: [Select]
if ($this -> bot -> botname == strtolower($who))
<<< Hack's in Zend Studio

All my Custom Bebot files may be Found Here <-clicky

Offline Solerna

  • BeBot User
  • **
  • Posts: 21
  • Karma: +0/-0
problem with invite command, need fix
« Reply #5 on: November 11, 2005, 12:12:46 am »
Thanx, some days I shouldn't be allowed infront of the comp. Almost poked my eye when I saw that >.<

 

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