Author | Message | Time |
---|---|---|
Miccolo | i have a problem wenn i conncet du bnls and the output is Connecting Connected Diconnected way | August 3, 2003, 7:54 PM |
Maddox | Is this a joke? | August 3, 2003, 9:36 PM |
FLiPPY_ | I think you might want to post your code.. make sure you use the [code ] [/code ] Function (Without Spaces before ]) | August 3, 2003, 11:38 PM |
DarkMinion | My IQ just lowered. >:( | August 4, 2003, 12:22 AM |
K | I think it would make a beautiful haiku. [quote] wenn i conncet du bnls is connecting, connected diconnected way [/quote] | August 4, 2003, 12:47 AM |
DrivE | Every man and woman on this forum is now dumber having read it. !~!HaZaRD!~! | August 4, 2003, 1:46 AM |
hismajesty | whats is the a forum it be? | August 4, 2003, 3:45 AM |
Miccolo | this is my code [code]Private Sub CleanSlateBot1_BnetConnected() chat.Text = chat.Text & "BNet Connected" & vbCrLf End Sub Private Sub CleanSlateBot1_BnetConnecting() chat.Text = chat.Text & "BNet Connecting" & vbCrLf End Sub Private Sub CleanSlateBot1_BNLSAuthEvent(Success As Boolean) If Success = True Then chat.Text = chat.Text & "Authorized" & vbNewLine Else chat.Text = chat.Text & "Unauthorized" & vbNewLine End If End Sub Private Sub CleanSlateBot1_BNLSConnected() chat.Text = chat.Text & "BNLS Connected" & vbCrLf CleanSlateBot1.Send "" End Sub Private Sub CleanSlateBot1_BNLSConnecting() chat.Text = chat.Text & "BNLS Connecting" & vbCrLf End Sub Private Sub CleanSlateBot1_BNLSDataError(Message As Byte) chat.Text = chat.Text & "BNLS DataError" & vbCrLf End Sub Private Sub CleanSlateBot1_BNLSDisconnected() chat.Text = chat.Text & "BNLS Disconnected" & vbNewLine End Sub Private Sub CleanSlateBot1_BNLSError(ErrorNumber As Integer, Description As String) chat.Text = chat.Text & "Error" & vbNewLine End Sub Private Sub CleanSlateBot1_JoinedChannel(ByVal ChannelName As String, ByVal Flags As Long, SimulatedEvent As Boolean) chat.Text = chat.Text & "Joined Channel: " & ChannelName & vbCrLf End Sub Private Sub connect_button_Click() CleanSlateBot1.Connect End Sub Private Sub Form_Load() CleanSlateBot1.BNLSBotID = "xxxxxx" CleanSlateBot1.BNLSBotPassword = "xxxxx" CleanSlateBot1.CDKey = "1234567890123" CleanSlateBot1.Product = "PXES" CleanSlateBot1.HomeChannel = "Op GdG" CleanSlateBot1.Password = "XXXXX" CleanSlateBot1.Username = "Miccolo-Bot" CleanSlateBot1.ChangePassword = False CleanSlateBot1.Server = "europe.battle.net" CleanSlateBot1.Accept = "579728" End Sub[/code] (chat ist a multiline box) | August 4, 2003, 9:09 AM |
dRAgoN | Remove your CD-Key so noone like steals it ^^ | August 4, 2003, 9:14 AM |
RhiNo | best way to just simply disconnect is close the bot with unload me or just make all your winsocks close :-P | August 4, 2003, 7:23 PM |
Camel | [quote author=RhiNo link=board=17;threadid=2192;start=0#msg17018 date=1060025038]best way to just simply disconnect is close the bot with unload me or just make all your winsocks close :-P[/quote] Unload Me will only work if there is only 1 loaded form (loaded != visible) -- use End instead. | August 10, 2003, 5:16 PM |
DarkMinion | Great, another clueless CSB user...thanks CupHead | August 10, 2003, 5:32 PM |
kamakazie | [quote author=Camel link=board=17;threadid=2192;start=0#msg17673 date=1060535815] Unload Me will only work if there is only 1 loaded form (loaded != visible) -- use End instead. [/quote] Never use End!! Instead you should unloading all the loaded forms using the Forms object. | August 10, 2003, 7:07 PM |
Camel | [quote author=kamakazie link=board=17;threadid=2192;start=0#msg17687 date=1060542467]Never use End!! Instead you should unloading all the loaded forms using the Forms object.[/quote] Never use incomplete sentances!! Instead you should making all the words being in the sentance. What's so horrible about End? | August 10, 2003, 9:07 PM |
Grok | End leaves code in memory. That code may contain references to objects. Since those objects are still referenced, they will not end and release their own code or data. I wouldn't say never use End. However, you should only use End when you know exactly why you are using it instead of doing a clean shutdown. | August 10, 2003, 9:29 PM |
kamakazie | [quote author=Camel link=board=17;threadid=2192;start=0#msg17693 date=1060549624] Never use incomplete sentances!! Instead you should making all the words being in the sentance. What's so horrible about End? [/quote] From Hardcore Visual Basic by Bruce McKinney [quote] WARNING Terminating a duplicate instance is one of those rare cases when you should actually use the End statement. Although the name sounds harmless, End is actually more like an Abort statement that means stop by any means even if it can’t do normal cleanup. Experienced Visual Basic programmers terminate their programs by unloading all the active forms. Normally, all it takes is an Unload Me statement in the main form. But if you’re trying to terminate in the main Form_Load, there is, by definition, nothing to unload. So the rule is simple: Never use End except in Form_Load. In the first edition of this book, I violated this rule by providing a procedure that looked for a duplicate instance and terminated that instance with an End statement inside the procedure. I got a rude surprise when I tried to put that procedure in the VBCore component. Visual Basic won’t let you use the End statement in a DLL or a control. [/quote] Oh and by the way, while we're on the subject of critizing simple mistakes, it's "sentence." | August 10, 2003, 9:35 PM |
Grok | [quote author=kamakazie link=board=17;threadid=2192;start=15#msg17699 date=1060551309] From Hardcore Visual Basic by Bruce McKinney ... is an Unload Me statement in the main form. But if you’re trying to terminate in the main Form_Load, there is, by definition, nothing to unload. So the rule is simple: Never use End except in Form_Load. ...[/quote] Except this is wrong. Form_Load fires after the process has been created, thus there is something to unload. If Form_Load fired before you had a process, you could not run any code in the procedure. Private Sub Form_Load() Set gObj1 = CreateObject("BlahLib.X1") Set gObj2 = CreateObject("BlahLib.Y2") Set gObj3 = CreateObject("BlahLib.Z3") Set gObj4 = CreateObject("BlahLib.A4") Set gObj5 = CreateObject("BlahLib.B5") End End Sub Now who do you suppose is going to do the cleanup on the 5 out-of-process servers just created? | August 11, 2003, 12:05 AM |
Yoni | IIRC, Unload Me in Form_Load works fine. But I could be wrong, and I'm not going to test this, of course. [quote]Now who do you suppose is going to do the cleanup on the 5 out-of-process servers just created?[/quote] Bruce McKinney, apparently. | August 13, 2003, 5:21 PM |
Camel | [quote author=Yoni link=board=17;threadid=2192;start=15#msg17980 date=1060795298][quote]Now who do you suppose is going to do the cleanup on the 5 out-of-process servers just created?[/quote] Bruce McKinney, apparently.[/quote] Good call. | August 13, 2003, 5:58 PM |
Adron | Private Sub Form_Load() Open "c:\temp\tempfile.tmp" for output as #1 Unload Me End Sub Now who do you suppose is going to do the cleanup of your temp file? | August 13, 2003, 6:28 PM |
Camel | [quote author=Adron link=board=17;threadid=2192;start=15#msg17984 date=1060799307] Private Sub Form_Load() Open "c:\temp\tempfile.tmp" for output as #1 Unload Me End Sub Now who do you suppose is going to do the cleanup of your temp file? [/quote] That's simply poor code. | August 13, 2003, 7:14 PM |
Skywing | [quote author=Adron link=board=17;threadid=2192;start=15#msg17984 date=1060799307] Private Sub Form_Load() Open "c:\temp\tempfile.tmp" for output as #1 Unload Me End Sub Now who do you suppose is going to do the cleanup of your temp file? [/quote] CreateFile(FileName, Access, ShareMode, SecAttrs, Disposition, FILE_FLAG_DELETE_ON_CLOSE | Attrs, Template); | August 13, 2003, 9:34 PM |
Adron | [quote author=Skywing link=board=17;threadid=2192;start=15#msg17997 date=1060810475] [quote author=Adron link=board=17;threadid=2192;start=15#msg17984 date=1060799307] Private Sub Form_Load() Open "c:\temp\tempfile.tmp" for output as #1 Unload Me End Sub Now who do you suppose is going to do the cleanup of your temp file? [/quote] CreateFile(FileName, Access, ShareMode, SecAttrs, Disposition, FILE_FLAG_DELETE_ON_CLOSE | Attrs, Template); [/quote] Exactly! The problem is not that of using the End or the Unload Me statements! You just have to be aware of what other calls you use and how to ensure that they are cleaned up. | August 13, 2003, 10:04 PM |
RhiNo | christ didnt think it was that big of a deal and if he made a bot im sure he dont want it to unload in form load cause that defeats the perpose of making a bot to stay online | August 18, 2003, 7:35 PM |