collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 987
  • stats Total Posts: 18348
  • stats Total Topics: 2494
  • stats Total Categories: 7
  • stats Total Boards: 33
  • stats Most Online: 500

Author Topic: Symb/PB module arent working  (Read 3906 times)

0 Members and 1 Guest are viewing this topic.

Offline Karsta

  • BeBot User
  • **
  • Posts: 28
  • Karma: +0/-0
Symb/PB module arent working
« on: November 08, 2008, 04:35:09 am »
Kbot [GROUP]    [MSG]   [Northern Star] Karstasbiatc: !symb int control eye
Warning: implode(): Invalid arguments passed in /home/karstas/kbot541/core/Professions.php on line 198

and symb module arent giving info what PB drops those symbs

and still got same PB problem as in

http://bebot.link/bebot-0-5-support/!pb-command/

Kbot [GROUP]    [MSG]   [Northern Star] Karstasbiatc: !pb oak
string(3) "Imk"
Kbot [GROUP]    [MSG]   [Northern Star] Kbot: [link]Remains of Imk[/link]
Kbot [GROUP]    [MSG]   [Northern Star] Karstasbiatc: !pb zoetic
string(3) "Bia"
Kbot [GROUP]    [MSG]   [Northern Star] Kbot: [link]Remains of Bia[/link]

Karsta

Offline redmagician

  • BeBot Rookie
  • *
  • Posts: 13
  • Karma: +0/-0
Re: Symb/PB module arent working
« Reply #1 on: November 10, 2008, 08:00:22 am »
Well I found the problem but I'm not quite sure how to fix it.

The function best_match uses a function called levenshtein() that computes the number of characters that need to be replaced, added, or deleted for the search string to match one of the pocket boss names.

levenshtein() is currently set up to use equal weights for replacing, adding, or removing characters. The reason you're seeing "Imk" when you search for "oak" is because the cost to replace "o" and "a" is less than the cost of adding "Zoetic".

The weights can be changed so one operation is favored over another but the result isn't always what's expected.

For example, if you replace
levenshtein($search, $straw[0])
with
levenshtein($search, $straw[0], 1, 20, 30)

Then insertions (1) are strongly favored over replacing (20) and deletion (30).

I have a hard time predicting the output of the levenshtein function so I am not willing to spend a great amount of time making the function work in a predictable manner.

I'll check back when I have some time and look into replacing the function with something I consider to be more predictable if someone else hasn't fixed the issue.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Symb/PB module arent working
« Reply #2 on: November 10, 2008, 05:31:50 pm »
yer we need to add a search before the current that will check for names containing wat u put 1st, if more than 1 do 2nd search on those only, if none so 2nd search on all

which im going to do NOW

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Symb/PB module arent working
« Reply #3 on: November 10, 2008, 06:10:10 pm »
The PB module Search is now Fixed in SVN

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: Symb/PB module arent working
« Reply #4 on: November 10, 2008, 07:26:32 pm »
the Symb Implode Error is now Fixed

Offline Nogoal

  • BeBot Apprentice
  • ***
  • Posts: 77
  • Karma: +0/-0
Re: Symb/PB module arent working
« Reply #5 on: November 12, 2008, 04:13:59 pm »
and symb module arent giving info what PB drops those symbs
Fast fix:
- Search for $readable_output .= "$link\n"; (should be line 263) in /modules/AO/Symbiants.php
- Add under it:
$rPB mysql_fetch_Array(mysql_query("SELECT boss_id FROM symbiants WHERE itemref='".$symb['itemref']."'"));
$namePB mysql_fetch_Array(mysql_query("SELECT name FROM pocketbosses WHERE ID='".$rPB['boss_id']."'"));
$linkPB "- <a href='chatcmd:///tell ".$this -> bot -> botname." <pre>pb ".$namePB[0]."'>".$namePB[0]."</a>";
$readable_output .= "$linkPB\n";

- Restart bot.
« Last Edit: November 12, 2008, 04:20:29 pm by Nogoal »

 

* Recent Posts
Linked objects in chat by bitnykk
[November 02, 2022, 10:56:58 am]


0.7.x updates for AO by bitnykk
[September 01, 2022, 03:25:38 pm]


0.7.x updates for AoC by bitnykk
[September 01, 2022, 03:25:22 pm]


Website back up and quick status update by bitnykk
[July 30, 2021, 04:56:19 pm]


AO Bots - discord server by bitnykk
[January 31, 2021, 03:50:48 am]

* Who's Online
  • Dot Guests: 172
  • 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-2022, SimplePortal