Author Topic: On My Way :P  (Read 1709 times)

HearthCore

  • Sr. Members
  • Newbie
  • *
  • Posts: 10
    • View Profile
On My Way :P
« 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

Reason

  • Global Moderators
  • Full Member
  • ***
  • Posts: 193
    • View Profile
    • http://Rev77.net/FailBot/latest.zip
On My Way :P
« Reply #1 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
Quote
04:37:18 PM | ?Swamp_Demon15@Azeroth? make me 1..?
04:37:28 PM | ?MikeA@Azeroth? can you code in VB6, lol?
04:37:47 PM | ?MikeA@Azeroth? And do you know how to have sex while hanging from your little toe?
04:38:01 PM | ?MikeA@Azeroth? If no to either, I'm sorry, we can't take you.
04:38:11 PM | ?MikeA@Azeroth? Joel taught us all the second one.

DarkMage2303

  • Global Moderators
  • Newbie
  • *
  • Posts: 41
    • View Profile
On My Way :P
« Reply #2 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:)
« Last Edit: November 29, 2008, 05:40:49 PM by DarkMage2303 »

ArticWolve

  • Global Moderators
  • Hero Member
  • *****
  • Posts: 636
    • View Profile
    • http://
On My Way :P
« Reply #3 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.
« Last Edit: December 01, 2008, 09:05:11 AM by Shadow »
Quote
Darker then the darkest shade of night...
    A Rebel at heart... A criminal by mind
    All in the eyes of the beholder... is the truth to life
    But Th---The Only---The One and Only True Master of Death is the Reaper itself
[/color]
[/color]
[div align=\'center\'][img]http://img261.imageshack.us/img261/9411/mydesktopce6.jpg\" border=\"0\" class=\"linked-sig-image\" /][img]http://www.danasoft.com/sig/238153.jpg\" border=\"0\" class=\"linked-sig-image\" /][/div]                     [div align=\'center\']    Click ME for my forums. You know you want to click ME. Come on CLICK ME DAMN IT! But don't click THIS!![/div]

Reason

  • Global Moderators
  • Full Member
  • ***
  • Posts: 193
    • View Profile
    • http://Rev77.net/FailBot/latest.zip
On My Way :P
« Reply #4 on: November 30, 2008, 01:32:58 PM »
*cough give credit where credit is due cough*
Quote
04:37:18 PM | ?Swamp_Demon15@Azeroth? make me 1..?
04:37:28 PM | ?MikeA@Azeroth? can you code in VB6, lol?
04:37:47 PM | ?MikeA@Azeroth? And do you know how to have sex while hanging from your little toe?
04:38:01 PM | ?MikeA@Azeroth? If no to either, I'm sorry, we can't take you.
04:38:11 PM | ?MikeA@Azeroth? Joel taught us all the second one.

Hero

  • Administrator
  • Hero Member
  • *****
  • Posts: 502
    • View Profile
    • http://rev7.net
On My Way :P
« Reply #5 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.
Hero
AKA: HeroAssasin and Mike
- - - - -  - - -
Visit Clan R77
- - - - -  - - -
Please do not PM me with random questions. That is what I made these forums for.

Noob ~Vector

ArticWolve

  • Global Moderators
  • Hero Member
  • *****
  • Posts: 636
    • View Profile
    • http://
On My Way :P
« Reply #6 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.
Quote
Darker then the darkest shade of night...
    A Rebel at heart... A criminal by mind
    All in the eyes of the beholder... is the truth to life
    But Th---The Only---The One and Only True Master of Death is the Reaper itself
[/color]
[/color]
[div align=\'center\'][img]http://img261.imageshack.us/img261/9411/mydesktopce6.jpg\" border=\"0\" class=\"linked-sig-image\" /][img]http://www.danasoft.com/sig/238153.jpg\" border=\"0\" class=\"linked-sig-image\" /][/div]                     [div align=\'center\']    Click ME for my forums. You know you want to click ME. Come on CLICK ME DAMN IT! But don't click THIS!![/div]

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
On My Way :P
« Reply #7 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.
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector

HearthCore

  • Sr. Members
  • Newbie
  • *
  • Posts: 10
    • View Profile
On My Way :P
« Reply #8 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

Vector

  • Administrator
  • Hero Member
  • *****
  • Posts: 550
    • View Profile
    • http://clanmage.phost.ws
On My Way :P
« Reply #9 on: December 03, 2008, 12:58:53 PM »
DSP Origin, Message, Username, vbColor

You have DSP Origin, Message, vbColor ;p
I am an Unofficial StealthBot Technician, an Unofficial StealthBot scripter, among other things. See my about page for more info.

Quote from: ArticWolve
Sorry I went down. Had internet problems with a cracker-jack-licensed driver hitting my internet pole (about 8 of them fell) and drooping my phone and electricity. Sorry ><

Rev77.net Plugins Manager

Proud host of Vector.no-ip.info | VectorJBLS.no-ip.org Status: [img]http://rev77.net/ServerCheck/check.asp?query=check&server=VectorJBLS.no-ip.org_status.png\" border=\"0\" class=\"linked-image\" /]

Shito-Ryu Karate-Do Genbu-Kai Rank: 8th Kyu (White belt, one stripe)

Rev77.Net Remote Support (Double-Click my name only if you were told to)

If the above link doesn't work, or if you use Vista, try this alternate link.

Noob ~Vector

HearthCore

  • Sr. Members
  • Newbie
  • *
  • Posts: 10
    • View Profile
On My Way :P
« Reply #10 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

Hero

  • Administrator
  • Hero Member
  • *****
  • Posts: 502
    • View Profile
    • http://rev7.net
On My Way :P
« Reply #11 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
Hero
AKA: HeroAssasin and Mike
- - - - -  - - -
Visit Clan R77
- - - - -  - - -
Please do not PM me with random questions. That is what I made these forums for.

Noob ~Vector

HearthCore

  • Sr. Members
  • Newbie
  • *
  • Posts: 10
    • View Profile
On My Way :P
« Reply #12 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
« Last Edit: December 05, 2008, 02:17:28 PM by HearthCore »

Hero

  • Administrator
  • Hero Member
  • *****
  • Posts: 502
    • View Profile
    • http://rev7.net
On My Way :P
« Reply #13 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.
« Last Edit: December 07, 2008, 03:01:11 PM by Hero »
Hero
AKA: HeroAssasin and Mike
- - - - -  - - -
Visit Clan R77
- - - - -  - - -
Please do not PM me with random questions. That is what I made these forums for.

Noob ~Vector