• Welcome to Valhalla Legends Archive.
 

disconnect & Quit

Started by TeEhEiMaN, May 27, 2003, 12:01 AM

Previous topic - Next topic

TeEhEiMaN

This is what tryed but It did not work. Can you guys help me out here?


'disconnect command

If Username = Form5.txtMaster.Text Then
If Left((LCase(Message)), 12) = (Form5.txtTrigger.Text & "disconnect ") Then
CleanSlateBot1.Disconnect
End If
End If



'quit command
If Username = Form5.txtMaster.Text Then
If Left((LCase(Message)), 6) = (Form5.txtTrigger.Text & "quit ") Then
Unload Me
End If
End If

Tazo

y do you have spaces at the end of the commands?

Yoni

Did you try sending the commands with a space after them?

timbo

just a thought...

If Username = Form5.txtMaster.Text and Instr(1,Message,strTrigger & "disconnect",vbTextCompare) > 0 Then
CleanSlateBot1.Disconnect
End If


______


If Left((LCase(Message)), 5) = frmOptions.Trigger.Text & "quit" Then
If Username = Form5.txtMaster.Text Then
unload me
end

End If

WiLD

wow thx ______

a great code example, i have been using case, i might start using code now, looks easyier enough.

I understand everything except for 1 part:
If Left((LCase(Message)), 5)
Could you kinda put this into english.

thx
=_=  &&  g0dFraY  &&  -=Templar=-  @USWest

Yoni

"If the 5 leftmost chars in the translation to lowercase of Message are-"

______

Left(string,length) meaning left of a string and how long it is

lcase(message)    = lower cased message to look for

5 =  the length in  Left(string,length)


Grok

#9
Or ..


      If VB.Left(LCase(Message), 5) = frmOptions.DefInstance.Trigger.Text & "quit" Then
         If Username = Form5.DefInstance.txtMaster.Text Then
            Me.Close()
         End If
      End If


However, you should not use Left anymore.  Use SubString function of the String class.

CrAz3D

Quote
If Username = Form5.txtMaster.Text Then
If Left((LCase(Message)), 12) = (Form5.txtTrigger.Text & "disconnect ") Then
FORM1.CleanSlateBot1.Disconnect
End If
End If
Might that be your problem?  That your CSB mod is in a different arrear than your commands?  I know I don't have my commands on my main form.
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

______

Quote from: CrAz3D on May 28, 2003, 10:36 AM
Quote
If Username = Form5.txtMaster.Text Then



wouldnt

If lcase(Username) = lcase(Form5.txtMaster.Text) Then

be better beacause if you didnt lcase it would be looking for Exact casing on the user.  

example USERnAme@azeroth = username@azeroth ' this would be false
lcaseing makes it like this  username@azeroth = username@azeroth ' this would be true

Soul Taker

I just use Option Compare Text myself, much easier than lcase()ing everything.

Undeference

you know, vb really sucks. Try using something else. There are already too many vb bots. >:(

Kp

Quote from: Undeference on May 30, 2003, 01:59 PMyou know, vb really sucks. Try using something else. There are already too many vb bots. >:(
This is not the place to start a language war.  If these people want to write in VB, so be it.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!