Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: DarkMod on March 21, 2003, 12:00 PM

Title: Commands help
Post by: DarkMod on March 21, 2003, 12:00 PM
Ok, I am making my bot have the capability for the masters to say for example "~ban shoe" in the channel and the bot will do it. I got that part down, the part I am having trouble with is getting it to reconize the name (in this case shoe) after the command, anyone have any idea how I can get it to eliminate the '~ban 'part of the message when the bot sends the kick command?
Title: Re: Commands help
Post by: Eibro on March 21, 2003, 12:37 PM
Search the string for whitespace, return the string found after the whitepace. What language is this in? (/me guesses Visual Basic)
Title: Re: Commands help
Post by: DarkMod on March 21, 2003, 01:48 PM
yes it is in VB.
Title: Re: Commands help
Post by: n00blar on March 21, 2003, 02:58 PM
(assuming that strData contains only the message "~ban [name]")

Dim strCommand as String
Dim strArguement as String 'can optionaly make an array

strCommand = Mid$(strData, 2, InStr(strData, " ") - 1)
strArguement = Mid$(strData, InStr(strData, " ") + 1)

In your case strCommand = "ban" and strArguement = "shoe"
Title: Re: Commands help
Post by: Grok on March 21, 2003, 06:11 PM
Even simpler:
if Instr(textline, " ") > 1 Then
   cmd = Split(textline, " ")(0)
   arg1 = Split(textline, " ")(1)
end if
Title: Re: Commands help
Post by: Warrior on May 10, 2005, 09:08 PM
Read the DATES see 2003!
Title: Re: Commands help
Post by: OnlyMeat on May 11, 2005, 05:50 AM
Quote from: Warrior on May 10, 2005, 09:08 PM
Read the DATES see 2003!

Yes, so why are you reviving old topics?
Title: Re: Commands help
Post by: UserLoser. on May 11, 2005, 06:47 AM
Quote from: OnlyMeat on May 11, 2005, 05:50 AM
Quote from: Warrior on May 10, 2005, 09:08 PM
Read the DATES see 2003!

Yes, so why are you reviving old topics?

He isn't.  Apparently there was some "spammer" yesterday