• Welcome to Valhalla Legends Archive.
 

[VB] BCP - Aliases

Started by UserLoser, September 01, 2003, 08:08 PM

Previous topic - Next topic

UserLoser

So far I can get about 3 working plugins, and Aliases is something giving me trouble.  Say if I wanted to do something simple like over (You'll get over it) - I already have all that set up in Aliases.txt.

Now if I were to do /la, it works correctly and displays the list of aliases correctly.

What I have:

txtSend - the name of my textbox to send text to battle.net and localcommands.

If Left(txtSend.Text, 1) = "/" Then CallPluginCommandNotifications Mid(txtSend.Text, 2), vbNullString, False

That would do the command 'la'.  But if I were to do '/over' - shouldn't it process the command 'over'?  And if so, why isn't it working?

Public Function PSysProcessBotCommand&(ByVal lpszCommand&)
   RTBAdd vbRed, "PSysProcessBotCommand has done something! - " & CStrToBStr(lpszCommand) ' Just so I know if anything happens here...
   PSysProcessBotCommand& = 1
End Function

Public Function CStrToBStr(ByVal str As Long) As String
   CStrToBStr = Space(CStrLen(str))
   Call CStrCpy(CStrToBStr, str)
End Function


It seems rare that PSysProcessBotCommand is ever triggered.

Spht

If CallPluginCommandNotifications() returns 1, then you should SleepEx(0, 1).

UserLoser

#2
Thanks. ;D

Skywing

#3
Quote from: Spht on September 01, 2003, 08:14 PM
If CallPluginCommandNotifications() returns 1, then you should SleepEx(0, 1).
Note that while that works in this case, it's really a sort of stopgap; the calling thread is supposed to be alertable.

In VB, fully supporting that entails using Main with MsgWaitForMultipleObjectsEx to do the message loop, calling DoEvents when directed to by the wait function.

Yoni

Quote from: Skywing on September 01, 2003, 08:24 PM
Quote from: Spht on September 01, 2003, 08:14 PM
If CallPluginCommandNotifications() returns 1, then you should SleepEx(0, 1).
Note that while that works in this case, it's really a sort of stopgap; the calling thread is supposed to be alertable.

In VB, fully supporting that entails using Main with MsgWaitForMultipleObjectsEx to do the message loop, calling DoEvents when directed to by the wait function.

And if you know how to do that, might as well write the BCP in VC++.

UserLoser

[removed post that was here, i totally misread yoni's reply about 5 times]