Valhalla Legends Forums Archive | Visual Basic Programming | [VB] BCP - Aliases

AuthorMessageTime
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.

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

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?

[code]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[/code]

It seems rare that PSysProcessBotCommand is ever triggered.
September 2, 2003, 1:08 AM
Spht
If CallPluginCommandNotifications() returns 1, then you should SleepEx(0, 1).
September 2, 2003, 1:14 AM
UserLoser
Thanks. ;D
September 2, 2003, 1:18 AM
Skywing
[quote author=Spht link=board=5;threadid=2543;start=0#msg19774 date=1062465257]
If CallPluginCommandNotifications() returns 1, then you should SleepEx(0, 1).
[/quote]
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.
September 2, 2003, 1:24 AM
Yoni
[quote author=Skywing link=board=5;threadid=2543;start=0#msg19776 date=1062465852]
[quote author=Spht link=board=5;threadid=2543;start=0#msg19774 date=1062465257]
If CallPluginCommandNotifications() returns 1, then you should SleepEx(0, 1).
[/quote]
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.
[/quote]

And if you know how to do that, might as well write the BCP in VC++.
September 2, 2003, 6:59 AM
UserLoser
[removed post that was here, i totally misread yoni's reply about 5 times]
September 2, 2003, 11:35 PM

Search