• Welcome to Valhalla Legends Archive.
 

Case or Code Commands

Started by WiLD, June 09, 2003, 12:17 AM

Previous topic - Next topic

WiLD

Yo all,

I have tried so long and still cant do commands. I have been reading peoples posts about commands and still dont get it. Could you please tell me from the start. From like when you make a module to when i can test it out. Case or Code is fine,at the moment i just want it to work for me. i will add an access list later on.

This is wat i have tried:

Public Sub DoCommands(ByVal strAccount As String, ByVal strText As String, ByVal Whispered As Boolean)
On Error GoTo DoCommands_Error
Dim pA() As String
Dim strSyntax As String
Dim Command As String
Dim Username As Boolean
Dim Master As Boolean
Dim strAccessLetter As String
Dim namelen As Integer
Dim listname As String

If (Username) = "WiLD" Then
If Left((LCase(Message)), 12) = ("?" & "testing") Then
CleanSlateBot2.Send "Hi"
End If
End If


Thx in advance.
=_=  &&  g0dFraY  &&  -=Templar=-  @USWest

minzliu

#1
well

If (Username) = "WiLD" Then
If Left((LCase(Message)), 12) = ("?" & "testing") Then
CleanSlateBot2.Send "Hi"
End If
End If

Left((LCase(Message)), 12) will select 12 characters and ("?" & "testing") = ?testing, ?testing is not 12 characters so there for
cleanslatebot2.send "Hi" will never happen

try this:

If (Username) = "WiLD" Then
If instr(Message,"?testing") > 0 then
  cleanslatebot2.send "Hi"
End If
End If

Tazo

Please use the [ code ] and [ /code ] tags.

WiLD

ok i have been doing some testing and got it down to 1 thing. It says there is some thing wrong with .Send in the CleanSlateBot2.Send part. I dont have a clue why it would have something to do with that.. Im at school so from memory i did:

dim trigger
trigger = "."

If trigger = "." Then
If instr(Message,"?testing") > 0 then
 cleanslatebot2.send "Hi"
End If
End If

srr i cant remember exactly but when i get home i will fix it up.

If any one could give me the simple say command for anyone to use. Meaning i can use it or even other people i dont no :)

Back to the code, when i go to test it i just have to put say and it says theres some error. It highlights the top line (public fuction commands.....) and highlights .Send of CleanSlateBot.Send in blue. If you have any ideas could you please post them.

I have also used the forums search feature and didnt find anything really usefull
=_=  &&  g0dFraY  &&  -=Templar=-  @USWest

Fr0z3N

dim trigger as string
trigger = "."

If username = "joe" and LCase(message) = "?trigger" then
frmmain.cleanslatebot.send "current trigger is: " & trigger
end if

TheMinistered

#5
I don't think giving this guy code is going to help.  I think we should give him the general idea on how to implement commands.  an abstract thought??

First thing you do is check the message for the trigger.  The trigger should always be the first character.  The command string (what identifies the command) begins immediately after the trigger and ends before the first space found.  The data associated with the command string begins after the first space found.

Here is a psuedo modular layout for handling commands:

CommandDispatcher(rawdata)
   This parses the rawdata and then calls the appropriate function, passing the appropriate data.  

CommandBan(username)
CommandKick(username)
CommandSquelch(username)
   Functions, such as these, are called by the dispatcher.

I suggest you write your own code to fit your own requirements.  You're welcome for the information.

Tazo

Quote from: Fr0z3N on June 10, 2003, 09:25 PM
dim trigger as string
trigger = "."

If username = "joe" and LCase(message) = "?trigger" then
frmmain.cleanslatebot.send "current trigger is: " & trigger
end if
Quote from: laurion on June 09, 2003, 05:19 AM
Please use the [ code ] and [ /code ] tags.

Fr0z3N

There is no rule to use the Code commands. As I recall, I am helping you. Do not comment on that. Comment if the code does not work and you need help.

Spht

Quote from: Fr0z3N on June 11, 2003, 02:23 PM
There is no rule to use the Code commands.

But it is suggested that you use them for the sake of other people wanting to clearly read what you post.

Fr0z3N

Quote from: Spht on June 11, 2003, 04:40 PM
Quote from: Fr0z3N on June 11, 2003, 02:23 PM
There is no rule to use the Code commands.

But it is suggested that you use them for the sake of other people wanting to clearly read what you post.

Yes but when you are helping someone learn they should not be replying with a "smart ass" attitude.

Tazo

Quote from: Fr0z3N on June 11, 2003, 09:44 PM
Quote from: Spht on June 11, 2003, 04:40 PM
Quote from: Fr0z3N on June 11, 2003, 02:23 PM
There is no rule to use the Code commands.

But it is suggested that you use them for the sake of other people wanting to clearly read what you post.

Yes but when you are helping someone learn they should not be replying with a "smart ass" attitude.
I'm not the one who asked for this information, nor am I a "smart ass".

Banana fanna fo fanna

Quote from: Fr0z3N on June 11, 2003, 09:44 PM
Quote from: Spht on June 11, 2003, 04:40 PM
Quote from: Fr0z3N on June 11, 2003, 02:23 PM
There is no rule to use the Code commands.

But it is suggested that you use them for the sake of other people wanting to clearly read what you post.

Yes but when you are helping someone learn they should not be replying with a "smart ass" attitude.

Don't diss laurion, he's chill. And that wasn't a smart ass comment he made, nor is he the poster of the question. Finally, you are taking a smart-ass approach to telling him that he is a smart-ass.

Thus, being the smart-ass that I am, please, everyone, just don't be a smart-ass.

That is all.

Tuberload

I like to think that my ass really is smart personally...
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown