BeBot - An Anarchy Online and Age Of Conan chat automaton

Archive => Anarchy Online Archive => BeBot 0.5 support => Topic started by: Karsta on November 08, 2008, 04:35:09 am

Title: Symb/PB module arent working
Post by: Karsta 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/ (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
Title: Re: Symb/PB module arent working
Post by: redmagician 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.
Title: Re: Symb/PB module arent working
Post by: Temar 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
Title: Re: Symb/PB module arent working
Post by: Temar on November 10, 2008, 06:10:10 pm
The PB module Search is now Fixed in SVN
Title: Re: Symb/PB module arent working
Post by: Temar on November 10, 2008, 07:26:32 pm
the Symb Implode Error is now Fixed
Title: Re: Symb/PB module arent working
Post by: Nogoal 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.
SimplePortal 2.3.7 © 2008-2024, SimplePortal