Posted by: Hero
« on: December 07, 2008, 03:01:00 PM »Quote from: HearthCore
Thanks for correcting my mistakes and giving exellent support!
Anyway's.. What Syntax can the Split() function have?
I guess your solution only works for this plugin, doesnt it?
I'll need multiple args soon that will work on different functions, that's why i ask
- EDITH SAYS q.Q -
Okay.. Now after fixing your space at the 2nd Private variable and renaming the script i've come to another error
[23:14:27] UserTalk Call Error On File> C:\Programme\StealthBot\plugins\gcc.plug
[23:14:27] Error Number: 35752 Description: URL is malformedCode: [Select]'GCC
'0.1
'&GHost++ Control and Command Center:HearthCore
'//;) 2 space indents
'// If you do not declare this as public or private, the variable value will not be accessible in subs
Private ccAccess
Private ccURL
ccAccess = 50
ccURL = "http://ghost.hearthcore.eu/exe.php?cmd=" '// I moved the url out here incase you use it in other things, it seems like a thing that you would want to look more like a setting
Sub GCC_Event_UserTalk(Username, Flags, Message, Ping)
GetDBEntry Username, Access, Flags
'// I assume you are going to use this like ".bot create"
'// Right now you are checking the whole message: If LCase(Message) = BotVars.Trigger & "bot" Then
'// You only want to see if the first 4 characters are the trigger & "bot"
'// This will do that, and handle multi-char triggers for SB 2.7
If Left(LCase(Message), Len(BotVars.Trigger & "bot")) = BotVars.Trigger & "bot" Then
'// Check for access after the command is detected in case you end up adding more access values and commands
If Access < ccAccess Then Exit Sub
'// Here we will get the arguments by splitting the messages with " " as an interval
Args = Split(Message)
'// Note: There is no reasons to put prefixes on local variables, stuff insides subs and such
'// The only reason you would ever want a prefix is if it can interfere with another plugin, which Private and Public variables will do
'// Get the upperbound of the array to check if they supplied a second message
If UBound(Args) > 0 Then
'// Get the second word, our command
Cmd = Args(1)
'// Open up your URL
urlToOpen = ccURL & Cmd
Content = scInet.OpenURL("" & urlToOpen)
'// Display
Dsp 2, "Command : " & Cmd & " | URL: " & urlToOpen, Username, vbRed
End If
End If
End Sub
That is a weird error with the Inet object, Fixed in your quoted code.