Post reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.
Name:
Email:
Subject:
Message icon:

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

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 malformed


Code: [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.
Posted by: HearthCore
« on: December 05, 2008, 02:16:48 PM »

Quote from: Hero
Split(Text, [Interval]) is all you need for now, if you do not  specify an interval it uses " " or  a space. It also returns an Array.

Code: [Select]
'test
 '0.1
 '&GHost++ Control Script:HearthCore
 
 '//;) 2 space indents
 
 '// If  you do  not declare this  as public  or  private, the variable  value will not  be accessible in subs
 Private testAccess
 Private testURL
 
 testAccess = 50
 testURL = "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 test_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 < testAccess 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 = testURL & Cmd
       Content = scInet.OpenURL(urlToOpen)
      
       '// Display
       Dsp 2, "Command : " & Cmd & " | URL: " & urlToOpen, Username, vbRed
 
     End If
   End If
 End Sub

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 malformed


Code: [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
Posted by: Hero
« on: December 05, 2008, 01:31:29 PM »

Split(Text, [Interval]) is all you need for now, if you do not  specify an interval it uses " " or  a space. It also returns an Array.

Code: [Select]
'test
'0.1
'&GHost++ Control Script:HearthCore

'//;) 2 space indents

'// If  you do  not declare this  as public  or  private, the variable  value will not  be accessible in subs
Private testAccess
Private testURL

testAccess = 50
test URL = "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 test_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 < testAccess 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 = testURL & Cmd
      Content = scInet.OpenURL(urlToOpen)
      
      '// Display
      Dsp 2, "Command : " & Cmd & " | URL: " & urlToOpen, Username, vbRed

    End If
  End If
End Sub
Posted by: HearthCore
« on: December 05, 2008, 09:44:08 AM »

Oh! Thanks
Working as intendet now.

But i've come to get to my 2nd issue allready xD..

Code: [Select]
'test
'0.1
'&GHost++ Control Script:HearthCore

    testAccess = 50
    
    
Sub test_Event_UserTalk(Username, Flags, Message, Ping)
    GetDBEntry Username, Access, Flags
        
    If Access < testAccess Then Exit Sub
    
    If LCase(Message) = BotVars.Trigger & "bot" Then
        testCMD = Split(Message, cmd(0) & " ")
    
        URL = "http://ghost.hearthcore.eu/exe.php?cmd="
        
        Content = scInet.OpenURL(URL & testCMD)
        
        dsp 2, "CMD : " & testCMD & " | URL: " & URL & Message, Username, vbRed
    End If
End Sub

I DO know i'm doing smth wrong with the Split fucntion.. is there any proper Syntax? I hope you guess what i'm trying to do there.. the URL i show you, is some kind of Command interface for my Hosting Bot.. i want StealthBot NOT to whiper it the commands to it ( like i did it with previous trys xD.. ), but instead use that certain interface

Would be great if you could lend me a hand there
Posted by: Vector
« on: December 03, 2008, 12:58:53 PM »

DSP Origin, Message, Username, vbColor

You have DSP Origin, Message, vbColor ;p
Posted by: HearthCore
« on: December 01, 2008, 07:15:41 PM »

So they really are playing dump

Kay Understood everything so far.. Still, i do get that error mentioned above and you didnt even enter on it
Posted by: Vector
« on: December 01, 2008, 12:56:24 PM »

Hearth, the main reason for Flags and Ping is simple:

Although most scripters will never use them, some will find it useful. And the only way those scripters will be able to use those arguments is if they are passed to the scripting system.

The OrignalStatString argument, for example, contains the username's unparsed statstring.

The parsed version of the statstring contains the uer's level, clan tag, icon code, and a few other things.
Posted by: ArticWolve
« on: December 01, 2008, 09:06:20 AM »

Fine... Zone taught me the VERY BASICS...... I had to teach myself the rest because no one @ sb wanted to take the time to help me learn what I needed to know. And I still goto him or Hero or Vector for help.
Posted by: Hero
« on: November 30, 2008, 07:53:51 PM »

Some of the events may seem as if they have extra arguments, but sometimes I will end up using every single one of them. Stealth decided which arguments each event would have when he created the bot, mainly the arguments you get for each event are the data that battle.net sends the bot for each event.
Posted by: Reason
« on: November 30, 2008, 01:32:58 PM »

*cough give credit where credit is due cough*
Posted by: ArticWolve
« on: November 29, 2008, 07:09:38 PM »

Rofl? I remember when I started scripting I didn't know jack. Now look where I am at: Partaking on two of the biggest and difficult scripts: Advanced Moderation and Project Neglected Fury.
Posted by: DarkMage2303
« on: November 29, 2008, 05:12:08 PM »

Code: [Select]
Sub FT_Output_Negative
    dsp, 3,"You do NOT have enough Access. dumpass.. " , vbRed

Fix your spelling, you put dump:)
Posted by: Reason
« on: November 29, 2008, 02:43:50 PM »

Because if you dont have flags and ping and such in there then stealth will for 1. give you wrong values for some things, and to, give you incorrect parameters. its like this.

If you have
Code: [Select]
Event_UserJoins(Username, Flags)
then stealth will give u

Code: [Select]
Event_UserJoins(Username, Flags, message, ping, product, level, originalstatstring)
which is why you get an error.

The stealth developers are to lazy to check the parameters and if one isnt there, then don't send it.

~Edit Parameters = the stuff in parenthesis
Posted by: HearthCore
« on: November 28, 2008, 09:28:47 PM »

Okay.. I've read some documentations so far, aswell as analysed some scripts from here.
I've mastered normal Events - the Syntax ( so far  ) aswell as Access stuff and the CustomGreet stuff xD...

[div class='codetop']CODE[/div][div class='codemain' style='height:200px;white-space:pre;overflow:auto']'CG
'0.1
'&Custom Greet Tryout:HearthCore

Sub CG_Event_Userjoins(Username, Flags, Message, Ping, Product, Level, OriginalStatstring)

AddQ  "/w " & Username & " Hey there " & Username & ", your Ping is " & Ping


End Sub[/div]

Why are those bunch of most likely unused stats needed in the UserJoins Event? (the things in here )
I've tried deleting the unused ones of those.. like Product, Level, Flags and Message.. so.. Why can't i?^^ Giving bunch of errors then ain't i?
What is the Level and Statstring stuff in there anyway?


[div class='codetop']CODE[/div][div class='codemain' style='height:200px;white-space:pre;overflow:auto']'CT
'0.1
'&Command Testing:HearthCore


Sub CT_Event_UserTalk(Username, Flags, Message, Ping)
   
   Trigger = "!"
   
   If InStr(Lcase(Message), Trigger & "fuck") Then
      dsp 3, "Stupid Fuck", Username, vbRed
   End If

End Sub
[/div]

woot woot >.<

Why is Ping and Flags needed in there? i mean.. i don't use it. Is this sorta just SB's VBs musthave or crybaby? Seems like VBs for SB is pretty much dump


[div class='codetop']CODE[/div][div class='codemain' style='height:200px;white-space:pre;overflow:auto']'AT
'0.1
'&Access Testing:HearthCore:wootwoot:>

Const AT_Access = 40

Sub AT_Event_UserTalk(Username, Flags, Message, Ping)
   GetDBEntry Username, myAccess, myFlags
   
   If myAccess < AT_Access Then Exit Sub
   
   If InStr(Lcase(Message), BotVars.Trigger & "fuck") Then
      dsp 3, "Stupid Fuck. You got " & myAccess & " Access btw.. and you only needed " & AT_Access & " .", Username, vbRed
   End If

End Sub[/div]

.. now the outcome of using functions for the next few steps was the following..

[div class='codetop']CODE[/div][div class='codemain' style='height:200px;white-space:pre;overflow:auto']'FT
'0.1
'&Function Testing:HearthCore:Some Serious Function Testing.. oh well.. NOT... oO..

Public FT_Access = 50

Sub FT_Event_UserTalk(Username, Flags, Message, Ping)
   GetDBEntry Username, myAccess, myFlags
   
   If InStr(Lcase(Message), BotVars.Trigger & "fuck") Then
      '//FT_Check_Access()
      if myAccess < FT_Access Then FT_Output_Negative()
      if myAccess > FT_Access Then FT_Output_Positive()
   End If
   
   
End Sub


'// Access Checking :>
'//Sub FT_Check_Access
   '//if myAccess < FT_Access Then FT_Output_Negative() Else FT_Output_Positive()
'//End Sub

'// When the Access is given
Sub FT_Output_Positive
   dsp, 3,"You got enough Access. Great " , vbRed
End Sub

'// When .. NOT.
Sub FT_Output_Negative
   dsp, 3,"You do NOT have enough Access. dumpass.. " , vbRed
End Sub[/div]

Now.. ignore the outcommented stuff for now.
I'm getting an Error anyways.. Error Number: 13   Description: Typen unvertr?glich (Type Dismatch)

Why the hell is that and where does that come from?
(Note - its 6:30 AM here. Was Drunk and didnt want to go to bed.. then had the sudden idea to finally start coding VBs for gawds sake xD)


Sake for everyone.

Gnait buddys :>
Hope when i'll wakeup and move my ass to my pc.. i'll find some answers.. xD