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: Quotes!  (Read 14198 times)

0 Members and 2 Guests are viewing this topic.

Offline Ebag333

  • Contributor
  • *******
  • Posts: 134
  • Karma: +0/-0
Re: Quotes!
« Reply #15 on: September 14, 2007, 04:41:10 pm »
Hmm, that DOES seem to be a rather silly way of handling that. :)

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Quotes!
« Reply #16 on: September 14, 2007, 04:42:27 pm »
The send_quote way of getting a random quote is horrible. Try this for a function send_quote instead:

Code: [Select]
function send_quote($qnum)
{ // Start function send_quote()
$strquote = "";
if($qnum == -1)
{
// Get a random quote
$sql = "SELECT * FROM #___quotes ORDER BY RAND() LIMIT 1";
$result = $this -> bot -> db -> select($sql, MYSQL_ASSOC);
if(!empty($result))
{
$strquote = "#" . $result[0]['id'] . " - " . $result[0]['quote'] . " [Contributed by: " . $result[0]['contributor'] . "]";
}
else
{
$strquote = "No quotes exist. Add some!";
}
}
else
{
    //Get the quote with the given $qnum
$sql = "SELECT * FROM #___quotes WHERE id=".$qnum;
$result = $this -> bot -> db -> select($sql, MYSQL_ASSOC);
if (!empty($result))
{
$strquote = "#" . $result[0]['id'] . " - " . $result[0]['quote'] . " [Contributed by: " . $result[0]['contributor'] . "]";
}
else
{
$strquote = "Quote with id of " . $qnum . " not found.";
}         
}
return $strquote;
} // End function send_quote()

Again I don't use this module so this code hasn't been tested.
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Dracutza

  • BeBot Apprentice
  • ***
  • Posts: 126
  • Karma: +0/-0
Re: Quotes!
« Reply #17 on: March 28, 2008, 03:48:43 am »
using temar's 0.4 -> 0.5 support/conversion file, i can get quotes to load, and display but on !quote add test, a new quote is not submitted and an old one is displayed.

On dropping the table, and letting the mod create a new one... !quote add test gets me:

Fatal error: Cannot use string offset as an array in P:\bots\custom\modules\Quotes.php on line 274

last line is 274

      
Code: [Select]
// Get the ID of the highest quote.
$sql = "SELECT id FROM #___quotes ORDER BY id DESC LIMIT 1";
$result = $this -> bot -> db -> select($sql);
$num = intval($result[0][0]);

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Quotes!
« Reply #18 on: March 28, 2008, 04:25:23 am »
the table is empty and there is no check
because its empty it isnt an array but the line is treating it as if it was

Offline Dracutza

  • BeBot Apprentice
  • ***
  • Posts: 126
  • Karma: +0/-0
Re: Quotes!
« Reply #19 on: March 28, 2008, 05:48:39 am »
ok but what about
bot: !quote add TEST TEST
bot: quote #33 blah blah

attempting to add a quote results in just another quote being displayed and nothing is submitted.  as if the bot and the mod don't get past the whitespace after !quote.

Offline Dracutza

  • BeBot Apprentice
  • ***
  • Posts: 126
  • Karma: +0/-0
Re: Quotes!
« Reply #20 on: March 29, 2008, 06:12:29 pm »
applied blueeagle's suggestions

bot [2008-03-29 16:08:56]    [TELL]  [INC]   Dracutza: !quote add test!
bot [2008-03-29 16:08:56]    [TELL]  [OUT]   -> Dracutza: No quotes exist. Add some!



Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Quotes!
« Reply #21 on: March 29, 2008, 11:18:09 pm »
This module is currently quite broken.

I have got a module for 0.5.x but it's not backwards compatible and unfortunately I do not see myself having time to backport it anytime soon. :(
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Dracutza

  • BeBot Apprentice
  • ***
  • Posts: 126
  • Karma: +0/-0
Re: Quotes!
« Reply #22 on: March 30, 2008, 08:18:22 am »
This module is currently quite broken.

I have got a module for 0.5.x but it's not backwards compatible and unfortunately I do not see myself having time to backport it anytime soon. :(

the one i have works just fine in 4... it's a 0.5 version I am looking for.

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Quotes!
« Reply #23 on: March 30, 2008, 08:42:42 am »
the one i have works just fine in 4... it's a 0.5 version I am looking for.

Oh. I juste assumed you wanted a 0.4-module since you're in the 0.4 module section of the forum..

The following does run on my bot, however I haven't tested it on a non-svn setup so it might not work out of the box.

The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Quotes!
« Reply #24 on: March 30, 2008, 09:13:14 am »
did u try running the 0.4 version on your 0.5 bot useing this module too

http://bebot.link/0-5-x-customunofficial-modules/0-4_support-for-latest-0-5/

Offline Dracutza

  • BeBot Apprentice
  • ***
  • Posts: 126
  • Karma: +0/-0
Re: Quotes!
« Reply #25 on: March 30, 2008, 05:48:40 pm »
did u try running the 0.4 version on your 0.5 bot useing this module too

http://bebot.link/0-5-x-customunofficial-modules/0-4_support-for-latest-0-5/

yes.  it displays old ones, but will not accept additions

Offline Dracutza

  • BeBot Apprentice
  • ***
  • Posts: 126
  • Karma: +0/-0
Re: Quotes!
« Reply #26 on: March 30, 2008, 05:57:44 pm »

The following does run on my bot, however I haven't tested it on a non-svn setup so it might not work out of the box.



doesn't for me.

it kills aorc when clicking the quote management interface

Quote
bot [2008-03-30 15:55:57]    [TELL]  [INC]   Dracutza: quote add TEST TEST

bot [2008-03-30 15:55:57]    [TELL]  [OUT]   -> Dracutza:  Your quote has been added to the database
bot [2008-03-30 15:55:57]    [TELL]  [OUT]   -> Dracutza: [link]Quote management interface[/link]
bot [2008-03-30 15:56:11]    [PGRP]  [MSG]   [bot] Dracutza: !quote
bot [2008-03-30 15:56:11]    [PGRP]  [MSG]   [bot] bot:  Where were you
 when Dracutza told me: ''?

funny... one version displays but does not accept, the other version accepts but does not display  :P

Offline Dracutza

  • BeBot Apprentice
  • ***
  • Posts: 126
  • Karma: +0/-0
Re: Quotes!
« Reply #27 on: March 30, 2008, 07:00:18 pm »
funny... one version displays but does not accept, the other version accepts but does not display  :P

actually blueeagles 0.5 version does not really accept new ones either.  In viewing the DB, it creates a record, and records the owner, but the quote is left blank.

Offline Dracutza

  • BeBot Apprentice
  • ***
  • Posts: 126
  • Karma: +0/-0
Re: Quotes!
« Reply #28 on: April 03, 2008, 05:38:04 pm »
any chance of getting Glara's Quote 100% 0.5 compatible?

Offline Glarawyn

  • BeBot Hero
  • ******
  • Posts: 521
  • Karma: +0/-0
Re: Quotes!
« Reply #29 on: April 03, 2008, 06:19:29 pm »
As a rule, I don't update my custom modules until we hit the release candidate stage of development.

If you want to pay me off in Supple bots or Combined Sharpshooter's armor or other in game loot that would be of interest I would be willing to shift game time to coding time. :)
« Last Edit: April 03, 2008, 06:25:21 pm by Glarawyn »

 

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