Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: OuTLawZGoSu on June 27, 2003, 04:35 PM

Title: How can i add a say command and a Ban command.
Post by: OuTLawZGoSu on June 27, 2003, 04:35 PM
Eh... Same As Top ^
Title: Re:How can i add a say command and a Ban command.
Post by: TeEhEiMaN on June 27, 2003, 05:38 PM
first set a master, make a text box for a master

Then your gonna need a trigger, make a text box for a trigger

Then

If Username = Form5.txtMaster.Text Then
If Left((LCase(Message)), 5) = (Form5.txtTrigger.Text & "say ") Then  'The number represends the number or words, ?triggerSay = 5, u must count the space as long with the trugger
Dim saymessage As String
saymessage = Right(Message, (Len(Message) - 5))
CleanSlateBot1.Send saymessage  'or how ever your bot sends messages
AddChat "<" & Form2.txtUsername.Text & "> ", vbCyan, saymessage & vbNewLine, vbWhite
End If
End If
Title: Re:How can i add a say command and a Ban command.
Post by: OuTLawZ-GoSu on June 28, 2003, 11:53 AM
Well my bot uses the "Send" message to send to bnet.

This is how I modifyed that code:

If username = Form1.txtMaster.Text Then
If Left((LCase(message)), 5) = (Form1.txtTrigger.Text & "say ") Then  'The number represends the number or words, ?triggerSay = 5, u must count the space as long with the trugger
Dim send As String
send = Right(message, (Len(message) - 5))
CleanSlateBot1.send send 'or how ever your bot sends messages
AddC , "<" & Form1.txtUsername.Text & "> ", vbCyan, send & vbNewLine, vbWhite
End If
End If


I added 3 text boxes on form1 called txtUsername, txtTrigger, txtMaster.

But when i type .say Test, it tells me " Duplicate Declorations in curent scope"

Help?
Title: Re:How can i add a say command and a Ban command.
Post by: Yoni on June 28, 2003, 12:22 PM
TeEhEiMaN: Please read a VB reference on "variables".
Title: Re:How can i add a say command and a Ban command.
Post by: ______ on June 28, 2003, 12:28 PM
Quote from: OuTLawZ-GoSu on June 28, 2003, 11:53 AM
Well my bot uses the "Send" message to send to bnet.

This is how I modifyed that code:

If username = Form1.txtMaster.Text Then
If Left((LCase(message)), 5) = (Form1.txtTrigger.Text & "say ") Then  'The number represends the number or words, ?triggerSay = 5, u must count the space as long with the trugger
Dim send As String
send = Right(message, (Len(message) - 5))
CleanSlateBot1.send send 'or how ever your bot sends messages
AddC , "<" & Form1.txtUsername.Text & "> ", vbCyan, send & vbNewLine, vbWhite
End If
End If



But when i type .say Test, it tells me " Duplicate Declorations in curent scope"

Help?

well you said it uses the "Send" process, then where it says cleanslatebot1.send   just replace this with send
(ex. send sendmsg)

and
" Duplicate Declorations in curent scope"
means you declared something twice"
Title: Re:How can i add a say command and a Ban command.
Post by: TeEhEiMaN on June 28, 2003, 06:43 PM
i was asumeing he had a send section in his bot. Thats where the Varuables would be.