• Welcome to Valhalla Legends Archive.
 

Commands help

Started by DarkMod, March 21, 2003, 12:00 PM

Previous topic - Next topic

DarkMod

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?

Eibro

#1
Search the string for whitespace, return the string found after the whitepace. What language is this in? (/me guesses Visual Basic)
Eibro of Yeti Lovers.

DarkMod

#2
yes it is in VB.

n00blar

#3
(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"

Grok

#4
Even simpler:
if Instr(textline, " ") > 1 Then
   cmd = Split(textline, " ")(0)
   arg1 = Split(textline, " ")(1)
end if

Warrior

Read the DATES see 2003!
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

OnlyMeat

Quote from: Warrior on May 10, 2005, 09:08 PM
Read the DATES see 2003!

Yes, so why are you reviving old topics?

UserLoser.

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