• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Coding problem[vb script.?]

Status
Not open for further replies.
Level 5
Joined
Apr 17, 2010
Messages
124
I'm trying to make a plugin for my stealthbot, that, when someone joins the channel, it checks if their in the clan, and if they are, it checks their access within the bot, and whether they're in the database or users or not.

And if it isn't above a basic level(which would be 30), it sets it to that, so that I don't have to go in and separately add each person to the database and then set their access' to 30.

I'm very much a beginner when it comes to vbscript; :vw_sad:

The only part I 100% knew how to do, was the person joins the channel event.

:fp: Any help, at all, slight, or completely doing it for me, would be greatly appreciated. And, all credits will be given as needed.

~~DooM
 
Level 15
Joined
Mar 31, 2009
Messages
1,397
I don't know the Stealthbot API, but the code would look something like this

Code:
*Person Joins Chat Event*
Dim name as String = Lcase(*get name*)
For Each listname As String In *userlist*
      If Not name = listname
              ReDim Preserve *userlist*(0 To UBound(*userlist*) + 1) As String
              *userlist*(UBound(*userlist*)) = name
              *set userlevel to 30*
              Exit For
      ElseIf *getnamelevel* < 30
              *set userlevel to 30*
              Exit For
Next


Note, this does Not preserve case, you can do that yourself if you like. Just fiddle around with the Lcase placement

This also assumes the user list is a dynamic array. Which it might not be.
 
Level 5
Joined
Apr 17, 2010
Messages
124
I don't know the Stealthbot API, but the code would look something like this

Code:
*Person Joins Chat Event*
Dim name as String = Lcase(*get name*)
For Each listname As String In *userlist*
      If Not name = listname
              ReDim Preserve *userlist*(0 To UBound(*userlist*) + 1) As String
              *userlist*(UBound(*userlist*)) = name
              *set userlevel to 30*
              Exit For
      ElseIf *getnamelevel* < 30
              *set userlevel to 30*
              Exit For
Next


Note, this does Not preserve case, you can do that yourself if you like. Just fiddle around with the Lcase placement

This also assumes the user list is a dynamic array. Which it might not be.
Thank you, this helped alot.
 
Status
Not open for further replies.
Top