Thread Tools Display Modes
08-06-14, 08:29 AM   #1
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
Bring back an outdated addon?

When using the command to bring up the interface for this old addon. I get this error. Ive been really digging deep into LUA. Trying to learn basic fixes for old addons.

Code:
Message: Interface\AddOns\AIBot\Core.lua:599: attempt to call global 'InterfaceOptionsFrame_OpenToFrame' (a nil value)
Time: 08/06/14 08:26:46
Count: 1
Stack: Interface\AddOns\AIBot\Core.lua:599: in function `?'
...\AddOns\AIBot\Libs\AceConsole-3.0\AceConsole-3.0.lua:94: in function `?'
Interface\FrameXML\ChatFrame.lua:4315: in function `ChatEdit_ParseText'
Interface\FrameXML\ChatFrame.lua:3969: in function `ChatEdit_SendText'
Interface\FrameXML\ChatFrame.lua:4008: in function `ChatEdit_OnEnterPressed'
[string "*:OnEnterPressed"]:1: in function <[string "*:OnEnterPressed"]:1>

Locals: self = <table> {
 SetDefaultModuleLibraries = <function> defined @Interface\AddOns\AIBot\Libs\AceAddon-3.0\AceAddon-3.0.lua:398
 Enable = <function> defined @Interface\AddOns\AIBot\Libs\AceAddon-3.0\AceAddon-3.0.lua:325
 RegisterChatCommand = <function> defined @Interface\AddOns\AIBot\Libs\AceConsole-3.0\AceConsole-3.0.lua:85
 EnableModule = <function> defined @Interface\AddOns\AIBot\Libs\AceAddon-3.0\AceAddon-3.0.lua:363
 modules = <table> {
 }
 GetModule = <function> defined @Interface\AddOns\AIBot\Libs\AceAddon-3.0\AceAddon-3.0.lua:241
 IterateEmbeds = <function> defined @Interface\AddOns\AIBot\Libs\AceAddon-3.0\AceAddon-3.0.lua:473
 defaultModuleLibraries = <table> {
 }
 TimeLeft = <function> defined @Interface\AddOns\AIBot\Libs\AceTimer-3.0\AceTimer-3.0.lua:187
 UnregisterChatCommand = <function> defined @Interface\AddOns\AIBot\Libs\AceConsole-3.0\AceConsole-3.0.lua:111
 ScheduleRepeatingTimer = <function> defined @Interface\AddOns\AIBot\Libs\AceTimer-3.0\AceTimer-3.0.lua:143
 CancelAllTimers = <function> defined @Interface\AddOns\AIBot\Libs\AceTimer-3.0\AceTimer-3.0.lua:175
 Printf = <function> defined @Interface\AddOns\AIBot\Libs\AceConsole-3.0\AceConsole-3.0.lua:69
 baseName = "AIBot"
 SetDefaultModulePrototype = <function> defined @Interface\AddOns\AIBot\Libs\AceAddon-3.0\AceAddon-3.0.lua:440
 optionsFrame = <unnamed> {
 }
 CancelTimer = <function> defined @Interface\AddOns\AIBot\Libs\AceTimer-3.0\AceTimer-3.0.lua:161
 optionsFrame2 = <unnamed> {
 }
 name = "AIBot"
 OnDisable = <function> defined @Interface\AddOns\AIBot\Core.lua:611
 IsEnabled = <function> defined @Interface\AddOns\AIBot\Libs\AceAddon-3.0\AceAddon-3.0.lua:482
 orderedModules = <table> {
 }
 ScheduleTimer = <function> defined @Interface\AddOns\AIBot\Libs\AceTimer-3.0\AceTimer-3.0.lua:108
 DisableModule = <function> defined @Interface\AddOns\AIBot\Libs\AceAddon-3.0\AceAddon-3.0.lua:381
 SetProfile = <function> defined @Interface\AddOns\AIBot\Core.lua:565
 secondperson = <function> defined @Interface\AddOns\AIBot\Core.lua:795
 defaultModuleState = true
 preparemsg = <function> defined @Interface\AddOns\AIBot\Core.lua:637
 RegisterMessage = <function> defined @Interface\AddOns\AIBot\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:118
 GetArgs = <function> defined @Interface\AddOns\AIBot\Libs\AceConsole-3.0\AceConsole-3.0.lua:144
 Print = <function> defined @Interface\AddOns\AIBot\Libs\AceConsole-3.0\AceConsole-3.0.lua:54
 CHAT_MSG_WHISPER = <function> defined @Interface\AddOns\AIBot\Core.lua:615
 enableit = <function> defined @Interface\AddOns\AIBot\Core.lua:817
 GetSetting = <function> defined @Interface\AddOns\AIBot\Core.lua:553
 OnEnable = <function> defined @Interface\AddOns\AIBot\Core.lua:606
 IsModule = <function> defined @Interface\AddOns\AIBot\Libs\AceAddon-3.0\AceAddon-3.0.lua:499
 db = <table> {
 }
 SetDefaultModuleState = <function> defined @Interface\AddOns\AIBot\Libs\AceAddon-3.0\AceAddon-3.0.lua:418
 VARIABLES_LOADED = <function> defined @Interface\AddOns\AIBot\Core.lua:583
 OnInitialize = <function> defined @Interface\AddOns\AIBot\Core.lua:569
 SetEnabledState = <function> defined @Interface\AddOns\AIBot\Libs\AceAddon-3.0\AceAddon-3.0.lua:455
 SetSetting = <function> defined @Interface\AddOns\AIBot\Core.lua:561
 enabledState = true
 GetProfile = <function> defined @Interface\AddOns\AIBot\Core.lua:557
 RegisterEvent = <function> defined @Interface\AddOns\AIBot
What is wrong with the addon? I updated all the libs but still got most of the same errors, like 11 of them went away though.

This is the addon I am referring to

http://www.wowinterface.com/download...379-AIBot.html
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...
  Reply With Quote
08-06-14, 08:36 AM   #2
Sharparam
A Flamescale Wyrmkin
 
Sharparam's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2011
Posts: 102
You could try replacing lines 597 through 603 in Core.lua with this:

lua Code:
  1. function AIBot:ChatCommand(input)
  2.     if not input or input:trim() == "" then
  3.         InterfaceOptionsFrame_OpenToCategory(self.optionsFrame)
  4.     elseif(input~=nil and input:trim() == "profile") then
  5.         InterfaceOptionsFrame_OpenToCategory(self.optionsFrame2)
  6.     end
  7. end

Note that the addon is 6 years old, so there could be a lot of issues with it now that aren't as easily fixed.
  Reply With Quote
08-06-14, 07:59 PM   #3
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
First problem fixed, Can you explain the adjustments and why they are needed please?

Code:
Message: Interface\AddOns\AIBot\Core.lua:616: bad argument #1 to 'sub' (string expected, got nil)
Time: 08/06/14 19:56:49
Count: 4
Stack: (tail call): ?
[C]: in function `sub'
Interface\AddOns\AIBot\Core.lua:616: in function `?'
...Bot\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:146: in function <...Bot\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:146>
[string "safecall Dispatcher[16]"]:4: in function <[string "safecall Dispatcher[16]"]:4>
[C]: ?
[string "safecall Dispatcher[16]"]:13: in function `?'
...Bot\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:91: in function `Fire'
...face\AddOns\AIBot\Libs\AceEvent-3.0\AceEvent-3.0.lua:70: in function <...face\AddOns\AIBot\Libs\AceEvent-3.0\AceEvent-3.0.lua:69>

Locals: <none>
This happens when the a message is sent to me now, it doesnt respond. I updated the Callback-handler lib. Should I just restore it back to the old one?
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...

Last edited by morpheusxeno : 08-06-14 at 08:05 PM.
  Reply With Quote
08-06-14, 08:02 PM   #4
Sharparam
A Flamescale Wyrmkin
 
Sharparam's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2011
Posts: 102
That part of the code uses the obsolete "argn" notation, so it would have to be updated to use proper Lua vararg instead. There is likely to be similar issues in other places as well.
  Reply With Quote
08-07-14, 01:21 AM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
I have a prototype of a more optimized version of the bot's conversation engine almost ready. It uses more advanced string.gsub() calls to handle the tags of the internal scripts a lot more efficiently. Oh, ya, and I ripped out the dependency of the Ace3 framework.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 08-07-14 at 01:26 AM.
  Reply With Quote
08-07-14, 07:15 AM   #6
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
Originally Posted by SDPhantom View Post
I have a prototype of a more optimized version of the bot's conversation engine almost ready. It uses more advanced string.gsub() calls to handle the tags of the internal scripts a lot more efficiently. Oh, ya, and I ripped out the dependency of the Ace3 framework.
OH RLY ? I really love this mod, I used to use it along time ago. I didnt know really anything about lua back then. I am really looking to make this chatterbot a type of information database. Looking forward to your work.
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...
  Reply With Quote
08-07-14, 10:26 AM   #7
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
I'm only aiming to get the engine working again, all of the AIML scripts are going to stay intact and it'll function the same as it used to, only a little faster. The only difference is it'll be made as a library, the UI and configurations have been stripped in order to focus on just getting the engine to work. I don't plan on taking up the addon itself and officially supporting it.



Edit: Code tested and is working under WoD Beta. It should work for MoP, just be sure to change the TOC number to 50400. To ask the bot a question, use /aibot and ask something. Addons can query the bot by calling AIBot:Query(message[,sender]). The function returns a string containing the response. If sender is omitted or nil, the bot uses the player's name by default. Bot personality variables are stored in Constants.lua and AIML scripts are in Brain.lua.

Edit #2: Fixed a possible recursive pattern matching problem with <sr> and <srai> tags.

--== Attached file moved to newer post ==--
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 08-08-14 at 12:09 AM.
  Reply With Quote
08-07-14, 07:35 PM   #8
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
Ah yes working beautifully
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...

Last edited by morpheusxeno : 08-07-14 at 07:42 PM.
  Reply With Quote
08-07-14, 07:40 PM   #9
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
I left an opening for it to respond to anyone since you can give it the name of the person that's talking to it. It wouldn't be too hard to get it to respond to whispers. All that'll be needed is to set up a handler to catch the whispers, then send the response back out.

An example of doing this in your own addon:
lua Code:
  1. local EFrame=CreateFrame("Frame");
  2. EFrame:RegisterEvent("CHAT_MSG_WHISPER");
  3. EFrame:SetScript("OnEvent",function(self,event,msg,sender)
  4.     SendChatMessage(AIBot:Query(msg,sender),"WHISPER",nil,sender);
  5. end);
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 08-07-14 at 09:11 PM.
  Reply With Quote
08-07-14, 09:32 PM   #10
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
That goes in the core?
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...
  Reply With Quote
08-07-14, 10:04 PM   #11
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
Actually, I'll upload a new version so you can turn it on and off.

Update #1:
Just for some fun and to test the whisper handler, I whispered myself and watched the bot start talking to itself.
Probably would be a good idea to check for that.

Update #2:
The changes are done and it seems to be running fine. I included a few fixes I had in an earlier post. I also put in a check so if you whisper yourself, the bot won't go into an infinite loop talking to itself. As fun as it is, it makes the game unplayable. The bot will also greet you when you log in and tell you how to use it. It also doesn't break character when you toggle the whisper handler on/off.

The new commands are as follows:
/aibot - Toggles the whisper handler on/off.
/aichat - Talk to AIBot by typing your message after the command, like a chat channel.

<<Attachment removed to preserve space>>
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 01-19-16 at 01:03 AM.
  Reply With Quote
08-08-14, 08:03 AM   #12
morpheusxeno
A Flamescale Wyrmkin
 
morpheusxeno's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 126
I have started to implement the aiml files into the new changes found here

https://code.google.com/p/aiml-en-us-foundation-alice/
__________________
My mother-in-law fell down a wishing well. I was amazed; I never knew they worked...
  Reply With Quote
08-08-14, 11:39 AM   #13
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
I'm thinking I'll have to write a new external parser to convert the AIML files into the brain tables and change the format that the tables are written. In order to make a format that works, I'll need to know the complete syntax of AIML and what each tag is supposed to do. Any good references will help, I've looked over the official documentation many times over and the source AIML files themselves are make more sense than the specification. To further add, I think we'll be working with AIML version 1.0.1. There's a draft out for version 2.0, but it might take a lot more to get the addon working with that.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 08-08-14 at 11:42 AM.
  Reply With Quote
08-08-14, 09:30 PM   #14
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,323
I have a working prototype of an AIML converter that parses into a Lua table.

So far, each <category> tag is translated into this format:
Code:
["pattern|that"]="template";
Note this allows multiples of the same pattern to match different <that> tags. The two values are separated by a pipe character. If there is no <that> tag, the pipe character should be omitted. This format should also help in-game memory usage since there's only one table instead of 10,000+.



Update: In order to add some more variance to the bot code, I'm allowing multiple templates to exist for a single pattern. I don't know how AIML handles duplicated patterns, but I modified my format above to be able to include the following alternative for this case. When this pattern is used, a random template will be chosen out of the list. This list method should only be used when more than one template is being defined.

Code:
["pattern|that"]={"template1","template2", ... ,"templateN"};
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 08-09-14 at 03:06 AM.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Bring back an outdated addon?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off