• Welcome to Valhalla Legends Archive.
 

(SphtBotv3) Getting BCEL.dll to load

Started by luth, April 27, 2007, 06:10 PM

Previous topic - Next topic

luth

#15
Very strange that its not loading the DLL then...

Eternal Chat isn't quite all that I was hoping for, so I'd still like to get SphtBot working if at all possible.  What are the chances of getting a version with expanded debug information?  Or a copy of the source that shows how you're loading the DLL?  Might give me some information as to why I cant get it to load...  I'm a professional game programmer, and debugging is kinda my thing.  :)  I'd really like to use your bot since it provides the ability to create plugins; eternal chat only supports simple scripts that dont quite match my needs.  :-/

luth

Does anyone have another 'bot that has similar features of SphtBot, with the ability to write plugins beyond the capabilities of little scripts?

Spht

The error you're getting is displayed if LoadLibrary() returns NULL

luth

#18
I assume you're calling LoadLibrary("BCEL.dll") without any path specified?  I don't suppose a version that outputs the GetLastError() number after the "Failed to load BCEL.dll!" message would be possible?

Something interesting worth noting, if I remove BCEL.dll from my system (or rename it to "foo.bar"), then "Failed to load BCEL.dll!" does not appear.  Whether that means it successfully loaded it, or you skipped over that message in the case the file does not exist (unlikely), I'm unable to test, as none of my bots have been allowed to connect to B.net today.

Spht

Quote from: luth on May 10, 2007, 02:10 PM
I assume you're calling LoadLibrary("BCEL.dll") without any path specified?  I don't suppose a version that outputs the GetLastError() number after the "Failed to load BCEL.dll!" message would be possible?

Something interesting worth noting, if I remove BCEL.dll from my system (or rename it to "foo.bar"), then "Failed to load BCEL.dll!" does not appear.  Whether that means it successfully loaded it, or you skipped over that message in the case the file does not exist (unlikely), I'm unable to test, as none of my bots have been allowed to connect to B.net today.

No, it uses the path the bot is running from when calling LoadLibrary().  If BCEL loaded fine, then the bot will display a "Loading plugins" message, and /listplugins will work

Try this vb app, it is basically the same process SphtBotv3 uses for loading BCEL

Sub Main()
    Dim AppPath As String
    Dim BCEL_DLL As String
    Dim hinstLib As Long
   
    AppPath = FixPath(App.path)
    BCEL_DLL = AppPath & "BCEL.DLL"
    If SetCurrentDirectory(AppPath) = 0 Then MsgBox "Failed SetCurrentDirectory(" & AppPath & ")"
    If Len(Dir(BCEL_DLL)) Then
        hinstLib = LoadLibrary(BCEL_DLL)
        If hinstLib Then
            MsgBox "Success loading " & BCEL_DLL & vbCrLf & _
                "hinstLib = " & hinstLib
            If FreeLibrary(hinstLib) Then
                MsgBox "Success freeing library"
            Else
                MsgBox "Failed freeing library"
            End If
        Else
            MsgBox "Failed loading " & BCEL_DLL & vbCrLf & _
                "Err.LastDllError = " & Err.LastDllError
        End If
    Else
        MsgBox "Could not find " & BCEL_DLL
    End If
End Sub

Mystical

ooh wow i didn't know sphtbot3 was in vb6.


mvgfdfw

#22
spam.


luth

#24
Ah, thanks spam-bot.

But seriously folks...

Thanks for the quick 'n dirty VB app.  The result from the Err.LastDllError helped me diagnose and fix the problem.  Finally, its all up and workin'.  :)

Thanks again.

*edit*
QuotePlenty of examples are provided on the SDK, and there is even a plugin template created by Yoni

Where can I find these?  Forums SEARCH didn't turn up anything (well, nothing useful).  I'd like to start hacking away at some custom plugins.  :)

Spht

Quote from: luth on May 12, 2007, 10:15 PM
Ah, thanks spam-bot.

But seriously folks...

Thanks for the quick 'n dirty VB app.  The result from the Err.LastDllError helped me diagnose and fix the problem.  Finally, its all up and workin'.  :)

Thanks again.

So, what was the problem?

Quote from: luth on May 12, 2007, 10:15 PM
*edit*
QuotePlenty of examples are provided on the SDK, and there is even a plugin template created by Yoni

Where can I find these?  Forums SEARCH didn't turn up anything (well, nothing useful).  I'd like to start hacking away at some custom plugins.  :)

http://www.valhallalegends.com/pub/BCP/

Let us know if you make any plugins for the public!

luth

http://www.valhallalegends.com/pub/BCP/Documentation/
It's empty!

Is there no documentation on how to write plugins?  I have the EmptyPlugin solution for vc7, and its all fine and dandy, but theres no docs anywhere.  :)  Is there another source for BCP documentation?  Or perhaps some example source files showing some simple, routine operations?


luth

Yeah, thats where I got the SDK.  But, as I just said, there's no documentation, some some barebones files.  Granted, there's not a lot of source there, but if there is any documentation available, I'd like to read it before I start hacking away.

And, because I forgot:
Quote from: Spht on May 13, 2007, 08:38 AM
Let us know if you make any plugins for the public!
Of course.  :)  Most everything I do is public, open source, and comes with my personal tech support.  What can I say?  Once a teacher, always a teacher.