- Joined
- Jul 17, 2007
- Messages
- 532
- Reaction score
- 0
I think the VB could be improved somewhat
(For example, that code is case sensitive and can be written anywhere in the text for example you wouldn't be able to say
"Yeah just shout :command and it'll do it"
As you saying that would trigger :command
(Split it to the first 'space' (if one exists) and then convert it to lcase
For example
Note: Convert the command to lowercase before adding it to the code Simply by doing
Bit messy code (Just wrote it inside this message window so i couldn't tab it out properly etc) but you should get the gist - hopefully.
Edit:
Btw, i noticed you replaced " with $ - Presumably because you don't know how to place " inside a string, if you type " twice aka "" then it prints it once inside a string for example
Output:
~ Jeax
(For example, that code is case sensitive and can be written anywhere in the text for example you wouldn't be able to say
"Yeah just shout :command and it'll do it"
As you saying that would trigger :command
(Split it to the first 'space' (if one exists) and then convert it to lcase
For example
Code:
If (instr(ToSay, "commandhere")) Then
dim tmp as string
if (instr(ToSay, " ") then
tmp = ToSay.Split(" ")(0)
else
tmp = ToSay
end if
if ("commandhere" = lcase(tmp)) Then
Send index "BKAlertHere"
end if
end if
Note: Convert the command to lowercase before adding it to the code Simply by doing
Code:
& lcase(TxtCommand.text)
Bit messy code (Just wrote it inside this message window so i couldn't tab it out properly etc) but you should get the gist - hopefully.
Edit:
Btw, i noticed you replaced " with $ - Presumably because you don't know how to place " inside a string, if you type " twice aka "" then it prints it once inside a string for example
Code:
msgbox "Hello "" World"
Output:
Code:
Hello " World
~ Jeax
Last edited:

