Valhalla Legends Forums Archive | Battle.net Bot Development | Case or Code Commands

AuthorMessageTime
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:
[code]
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
[/code]

Thx in advance.
June 9, 2003, 5:17 AM
minzliu
well
[code]
If (Username) = "WiLD" Then
If Left((LCase(Message)), 12) = ("?" & "testing") Then
CleanSlateBot2.Send "Hi"
End If
End If
[/code]
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:
[code]
If (Username) = "WiLD" Then
If instr(Message,"?testing") > 0 then
cleanslatebot2.send "Hi"
End If
End If
[/code]
June 9, 2003, 7:55 AM
laurion
Please use the [ code ] and [ /code ] tags.
June 9, 2003, 10:19 AM
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:
[code]
dim trigger
trigger = "."

If trigger = "." Then
If instr(Message,"?testing") > 0 then
cleanslatebot2.send "Hi"
End If
End If
[/code]
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
June 10, 2003, 12:48 AM
Fr0z3N
dim trigger as string
trigger = "."

If username = "joe" and LCase(message) = "?trigger" then
frmmain.cleanslatebot.send "current trigger is: " & trigger
end if
June 11, 2003, 2:25 AM
TheMinistered
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.
June 11, 2003, 2:41 AM
laurion
[quote author=Fr0z3N link=board=17;threadid=1587;start=0#msg12061 date=1055298357]
dim trigger as string
trigger = "."

If username = "joe" and LCase(message) = "?trigger" then
frmmain.cleanslatebot.send "current trigger is: " & trigger
end if
[/quote]
[quote author=laurion link=board=17;threadid=1587;start=0#msg11925 date=1055153943]
Please use the [ code ] and [ /code ] tags.
[/quote]
June 11, 2003, 10:18 AM
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.
June 11, 2003, 7:23 PM
Spht
[quote author=Fr0z3N link=board=17;threadid=1587;start=0#msg12113 date=1055359389]
There is no rule to use the Code commands.
[/quote]

But it is suggested that you use them for the sake of other people wanting to clearly read what you post.
June 11, 2003, 9:40 PM
Fr0z3N
[quote author=Spht link=board=17;threadid=1587;start=0#msg12121 date=1055367617]
[quote author=Fr0z3N link=board=17;threadid=1587;start=0#msg12113 date=1055359389]
There is no rule to use the Code commands.
[/quote]

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

Yes but when you are helping someone learn they should not be replying with a "smart ass" attitude.
June 12, 2003, 2:44 AM
laurion
[quote author=Fr0z3N link=board=17;threadid=1587;start=0#msg12154 date=1055385887]
[quote author=Spht link=board=17;threadid=1587;start=0#msg12121 date=1055367617]
[quote author=Fr0z3N link=board=17;threadid=1587;start=0#msg12113 date=1055359389]
There is no rule to use the Code commands.
[/quote]

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

Yes but when you are helping someone learn they should not be replying with a "smart ass" attitude.
[/quote]
I'm not the one who asked for this information, nor am I a "smart ass".
June 12, 2003, 11:41 AM
St0rm.iD
[quote author=Fr0z3N link=board=17;threadid=1587;start=0#msg12154 date=1055385887]
[quote author=Spht link=board=17;threadid=1587;start=0#msg12121 date=1055367617]
[quote author=Fr0z3N link=board=17;threadid=1587;start=0#msg12113 date=1055359389]
There is no rule to use the Code commands.
[/quote]

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

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

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.
June 12, 2003, 8:45 PM
Tuberload
I like to think that my ass really is smart personally...
June 12, 2003, 10:47 PM

Search