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: Reason
« on: November 21, 2008, 04:29:09 PM »

Its

Code: [Select]
ClanTags = Array("gay", "hi", "you", "by")
Posted by: de80
« on: November 21, 2008, 12:11:20 PM »

Code: [Select]
ClanTags = Array("", "", "", "")
It this how you write it?

Code: [Select]
ClanTags = Array("clan gay", "clan hi", "clan you", "clan by")
??
Posted by: Vector
« on: November 20, 2008, 09:51:07 PM »

lol, oops. I forgot to mention you can't create an array as a constant!

Code: [Select]
'cb
'0.1
'&Clan ban:Vector

'// Add the clans you want banned here.
Public ClanTags
ClanTags = Array("", "", "", "")

Sub cb_Event_UserJoins(Username, Flags, Message, Ping, Product, Level, OriginalStatString)
  userClan = GetInternalDataByUsername(Username, 0)
  If userClan = "" Then Exit Sub

  If InArray(ClanTags, GetInternalDataByUsername(Username, 0)) Then
    Command BotVars.Username, "/shitadd " & Username & " Clan banned", True
  End If
End Sub

Function InArray(arr, Item)
  For i=0 to Ubound(arr)
    If Lcase(arr(i)) = Lcase(Item) Then
      InArray = True
      Exit Function
    End If
  Next

  '// If this line is reached, the user's clan is not banned.
  InArray = False
End Function

That works.
Posted by: de80
« on: November 20, 2008, 07:48:42 PM »

Code: [Select]
[10:48:25 PM] UserJoins Call Error On File> C:\Program Files\Stealth Bot 4\plugins\Cb.txt
 [10:48:25 PM] Error Number: 13   Description: Type mismatch
Posted by: Ace
« on: November 20, 2008, 06:00:18 PM »

AddQ "-shitadd " & Username & " Clan banned"


Quote
Would this shit list them?

Yes, see above.
Posted by: de80
« on: November 20, 2008, 05:56:37 PM »

Code: [Select]
'cb
'0.1
'&Clan ban:Vector

'// Add the clans you want banned here.
Const ClanTags = Array("", "", "", "")

Sub cb_Event_UserJoins(Username, Flags, Message, Ping, Product, Level, OriginalStatString)
  If InArray(ClanTags, GetInternalDataByUsername(Username, 0)) Then
    AddQ "-shitadd " & Username & " Clan banned"
  End If
End Sub

Function InArray(arr, Item)
  For i=0 to Ubound(arr)
    If Lcase(arr(i)) = Lcase(Item) Then
      InArray = True
      Exit Function
    End If
  Next

  '// If this line is reached, the user's clan is not banned.
  InArray = False
End Function

Would this shit list them?
Posted by: Vector
« on: November 20, 2008, 04:51:23 PM »

Yes, this is complicated for a beginner.

Shadow, GetInternalDataByUsername(Username, 0) will get the clan tag of the user that joined.

If you need any help, just ask me what each function does.

Consider this:

Code: [Select]
'cb
'0.1
'&Clan ban:Vector

'// Add the clans you want banned here.
Const ClanTags = Array("", "", "", "")

Sub cb_Event_UserJoins(Username, Flags, Message, Ping, Product, Level, OriginalStatString)
  If InArray(ClanTags, GetInternalDataByUsername(Username, 0)) Then
    AddQ "/ban " & Username & " Clan banned"
  End If
End Sub

Function InArray(arr, Item)
  For i=0 to Ubound(arr)
    If Lcase(arr(i)) = Lcase(Item) Then
      InArray = True
      Exit Function
    End If
  Next

  '// If this line is reached, the user's clan is not banned.
  InArray = False
End Function

I don't have the patience to explain exactly how you do this. Please ask me, and I will answer any questions you may have.
Posted by: ArticWolve
« on: November 20, 2008, 04:39:31 PM »

The beta does this already. I have no clue on how to do that one......
Posted by: de80
« on: November 20, 2008, 04:34:56 PM »

Ok, well now i want to try something, im gona need help but this is what i want to do, i do

-shitaddclan (clan name)

And it will shitlist every buddy in that clan, im gona probly need some help
Posted by: ArticWolve
« on: November 20, 2008, 04:27:42 PM »

He edited it after I reposted. It was wrong but oh well. I guess
Quote
This post has been edited by de80: Today, 07:08 PM
means nothing. Anyways, good job De80.
Posted by: Vector
« on: November 20, 2008, 04:17:37 PM »

There is nothing syntaxically wrong with de's post though.

Your third line is still the same.

yours is:
Code: [Select]
'& by de80
Should be:

Code: [Select]
'&Hi:de80:Says "hi u" when user says a message with "hi" in it
Posted by: de80
« on: November 20, 2008, 04:04:41 PM »

Code: [Select]
'Hi
'.01
'& By de80

Sub  Hi_Event_UserTalk(Username, Flags, Message, Ping)
    
    If InStr(Lcase(Message), "hi") Then
    
    AddQ "hi u"
  
  End If

  End Sub
Posted by: ArticWolve
« on: November 20, 2008, 04:04:16 PM »

Quote from: Vector
[code]AddQ & Username & " Hi "
  /code]
 
  Vector: Lol at your error
 
  De80: He means this:
  [div class='codetop']CODE[/div][div class='codemain' style='height:200px;white-space:pre;overflow:auto']'Hi
  '.01
  '& Hi Script:De80
 
  Sub  Hi_Event_UserTalk(Username, Flags, Message, Ping)
 
   If InStr(Lcase(Message), "hi") Then
      AddQ "Hello " & Username
    End If

 
  End Sub[/div]

Corrected your mistakes in red ><
Posted by: Vector
« on: November 20, 2008, 03:59:41 PM »

Sub Hi_Event_UserTalk

not Sub Hi_UserTalk

This line:

Code: [Select]
AddQ & Username & " Hi "
will execute each time someone talks, because it is not contained within an If block.
Posted by: de80
« on: November 20, 2008, 03:55:03 PM »

Code: [Select]
'Hi
'.01
'& By de80

Sub  Hi_UserTalk(Username, Flags, Message, Ping)
    
    AddQ & Username & " Hi "
    If InStr(Lcase(Message), "hi") Then
    AddQ "hi u"
  End If

  End Sub