Author Topic: not safelist  (Read 1504 times)

speedy

  • Newbie
  • *
  • Posts: 19
    • View Profile
not safelist
« on: December 09, 2008, 09:17:35 AM »
Simple script it is necessary that the boat wrote to those at каго is not present safelist /w &username&
 [20:15:33] -- me [140ms] has joined the channel
 [20:15:34] /w me you not saflist!!

ArticWolve

  • Global Moderators
  • Hero Member
  • *****
  • Posts: 636
    • View Profile
    • http://
not safelist
« Reply #1 on: December 09, 2008, 09:46:48 AM »
Speedy, This script will likely make your bot drop. I can make a script like this, but it will not be effective if you have many users entering and exiting the channel. Please give me time to get part of this script together so they may look it over.

Everyone else: Please allow me to at least attempt this as soon as I figure out how to check to see if a user has entered the channel in the last 60 minutes. If he/she has, then it does not whisper that user... Also, it waits if the user stays in the channel for more then 10 seconds. Please and thank you.

So basically, my idea o making this:
.SafeGreet <On/Off/Status>
Turns the safegreet on; off; or displays the status of it.
"If IsSafelisted(Username) Then Exit Sub" will check to see if the user is safelisted. If so, he/she will not be told the safegreet.
"User" Joined within last 60 minutes, AND WAS TOLD the whisper, he/she is not greeted.
Script should queue the greets for at least 3 to 5 seconds.

What I need to know:
How to make a script remember if a user joined and was whispered the safegreet. (Dictionaries maybe?)
How to make a script queue itself.

Hero: After I set this up, will you input the two missing parts?

Edit: Speedy, will your bot have ops?
« Last Edit: December 09, 2008, 10:16:12 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]

Hero

  • Administrator
  • Hero Member
  • *****
  • Posts: 502
    • View Profile
    • http://rev7.net
not safelist
« Reply #2 on: December 09, 2008, 01:17:58 PM »
Shadow - Look at my GD plugin. - You have permission to edit  it in this case for safelist checking.
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://
not safelist
« Reply #3 on: December 09, 2008, 02:03:21 PM »
Thank you! Semi tested.... Sends the message you wanted and won't greet the same user that joined within 30 minutes. Prevents flooding.

Code: [Select]
'GD
'4.3
'&Greet Delay Safelist:Hero (Edit by Shadow)
'*
'*
'*
'*
'*StealthBot Enhancement

'// Added UserTalk sub ~Vector

Public gd_Message
'// The greet message has been moved to a settings file and can now be edited by using a command


'// %% Variables %%

'// %u = User
'// %t = Time
'// %d = Date
'// %pi = Ping
'// %pr = Product
'// %ch = Current Channel
'// %ho = Home Channel
'// %ct = User's clan tag
'// %l = Level
'// %an = Numerical Access
'// %af = Flagged Access
'// %cc = Amount of people in the channel
'// %nl = Newline - Will start a second message

'// Default access to set the greet
Const gd_acc = 90

Const gd_Delay = 15
'// Delay in seconds
'// Ex. gd_Delay = 15
'// A greet will be sent every 15 seconds instead of instantly

Const gd_Between = 30
'// Time between joins by the same person to not greet with, in minutes
'// Ex. gd_Between = 30
'// Each user will only be greet once every 50 minutes

Const gd_NoClan = "NONE"
'// What to replace clan tag with if they are in no clan.

Const gd_NoIcon = "None"
'// What to replace icon with if they have no icon

'/// /// /// /// /// /// /// ///
'/// The script starts here ////
'/// /// /// /// /// /// /// ///

Public gd_GreetDic, gd_j, gd_TimeDic
Set gd_GreetDic = CreateObject("Scripting.Dictionary")
Set gd_TimeDic = CreateObject("Scripting.Dictionary")

Public dblTab
dblTab = vbTab & vbTab & vbTab

Sub gd_Event_Load
  AddChat vbYellow, "Loading GD..."
  TimerInterval "gd", "Greet", CInt(gd_Delay)
  TimerEnabled "gd", "Greet", True
  AddChat vbYellow, "Checking if your built-in greet is enabled..."
  If GetConfigEntry("Other", "UseGreets", "config.ini") = "Y" Then
    AddChat vbRed, "Your built-in greet message is enabled!"
    AddChat vbYellow, "Disabling..."
    Command BotVars.Username, "/greet off", True
    AddChat vbGreen, "Disabled!"
  Else
    AddChat vbGreen, "Your built-in greet messages are disabled!"
  End If
  AddChat vbYellow, "Retrieving settings..."
  If GetConfigEntry("Main", "Running", "GD.Settings.ini") = vbNullString Then
    Call gd_WriteDefaultSettings
    AddChat vbGreen, "Created settings file and wrote default settings!"
  End If
  gd_Message = GetConfigEntry("Main", "Greet Message", "GD.Settings.ini")
  AddChat vbGreen, "Retrieved!"

  AddChat vbGreen,  "Greet Delay by Hero loaded!"
  WriteConfigEntry "Main", "Running", "True", "GD.Settings.ini"
End Sub

Sub gd_Event_Close
  AddChat vbYellow, "GD Saving settings..."
  WriteConfigEntry "Main", "Greet Message", gd_Message, "GD.Settings.ini"
  WriteConfigEntry "Main", "Running", "False", "GD.Settings.ini"
  AddChat vbGreen, "Saved!"
End Sub

Sub gd_Event_PressedEnter(Text)
  If Not Left(LCase(Text), 4) = "/gd " Then Exit Sub
  
  Arg = Split(Trim(Mid(Text, 2)))
  
  Select Case LCase(Arg(1))
    Case "setgreet"
      If UBound(Arg) < 2 Then
        AddChat vbRed, "You must specify a new greet message"
        AddChat vbYellow, "Your current greet message is: " & vbNewLine & dblTab & gd_Message
      Else
        For i = 2 To UBound(Arg)
          newMessage = newMessage & Arg(i) & " "
        Next
        newMessage = Trim(newMessage)
        gd_Message = newMessage
        AddChat vbGreen, "New greet message set."
      End If
      VetoThisMessage
    Case "greet"
      If UBound(Arg) < 2 Then
        AddChat vbGreen, "Your current greet message is: " & vbNewLine & dblTab & gd_Message
      Else
        For i = 2 To UBound(Arg)
          newMessage = newMessage & Arg(i) & " "
        Next
        newMessage = Trim(newMessage)
        gd_Message = newMessage
        AddChat vbGreen, "New greet message set."
      End If
      VetoThisMessage
    Case "var", "variables"
      strVariables = "GD Variables: " & vbNewline _
                     & dblTab & "%u = User" & vbNewLine _
                     & dblTab & "%t = Time" & vbNewLine _
                     & dblTab & "%d = Date" & vbNewLine _
                     & dblTab & "%pi = Ping" & vbNewLine _
                     & dblTab & "%pr = Product" & vbNewLine _
                     & dblTab & "%ch = Current Channel" & vbNewLine _
                     & dblTab & "%ho = Home Channel" & vbNewLine _
                     & dblTab & "%ct = User's clan tag" & vbNewLine _
                     & dblTab & "%l = Level" & vbNewLine _
                     & dblTab & "%an = Numerical Access" & vbNewLine _
                     & dblTab & "%af = Flagged Access" & vbNewLine _
                     & dblTab & "%cc = Amount of people in the channel" & vbNewLine _
                     & dblTab & "%nl = Newline - Will start a second message"
      AddChat vbGreen, strVariables  
      VetoThisMessage
    Case "cmds", "commands"
      strCommands =  "GD Commands: " & vbNewLine _
                       & dblTab & "/gd setgreet " & vbNewLine _
                       & dblTab & " - Changes the GD greet message" & vbNewLine _
                       & dblTab & "/gd greet" & vbNewLine _
                       & dblTab & " - Says you current greet message" & vbNewLine _
                       & dblTab & "/gd var   or   /gd variables" & vbNewLine _
                       & dblTab & " - Tells you all of the current greet message variables" ' & vbNewLine _
'                    & dblTab & "/gd restore yes" & vbNewLine _
'                    & dblTab & " - Will restore the default settings"
      AddChat vbGreen, strCommands
      VetoThisMessage
  End Select
End Sub

Sub gd_Event_UserTalk(Username, Flags, Message, Ping)
  If Left(Message, Len(BotVars.Trigger)) <> BotVars.Trigger Then Exit Sub

  GetDBEntry Username, a, f
  If a < gd_acc Then Exit Sub

  Arg = Split(Trim(Mid(Message, Len(BotVars.Trigger) + 1)))
  If Not Lcase(Arg(0)) = "gd" Then Exit Sub

  Select Case LCase(Arg(1))
    Case "setgreet", "greet"
      If UBound(Arg) < 2 Then
        AddQ "You must specify a new greet message"
        AddQ "Your current greet message is: " & gd_Message
      Else
        For i = 2 To UBound(Arg)
          newMessage = newMessage & Arg(i) & " "
        Next
        newMessage = Trim(newMessage)
        gd_Message = newMessage
        AddQ "New greet message set."
      End If
      VetoThisMessage
  End Select
End Sub

Sub gd_Event_Userjoins(Username, Flags, Message, Ping, Product, Level, OriginalStatString, Banned)

  If GetInternalDataByUsername(Username, 2) = 32 Then Exit Sub
  If IsSafelisted(Username) Then Exit Sub
  GetDBEntry Username, Access, Flags
    If myFlags = "S" or myFlags = "s" Then Exit Sub
  Msg = gd_ParseMessage(Username, Flags, Message, Ping, Product, Level, OriginalStatString)
  gd_GreetDic.Item(Username) = Msg

End Sub


Sub gd_Greet_Timer()
  If Not gd_GreetDic.Count = 0 Then
    For Each user In gd_GreetDic.Keys
      If gd_TimeDic.Exists(user) Then
        Last = gd_TimeDic.Item(user)
      Else
        Last = Now()
      End If
      Current = Now()
      Difference = DateDiff("S", Last, Current)
      If gd_UserInChannel(user) Then
        If Difference >= CInt(gd_Between * 60) OR Difference = 0 Then
          gd_TimeDic.Item(user) = Current
          Messages = gd_GreetDic.Item(user)
          For i = 0 To UBound(Messages)
            Dsp 3, Trim(Messages(i)), user, vbGreen
          Next
        End If  
        gd_GreetDic.Remove(user)
        Exit For
      End If
    Next
  End If
End Sub

Function gd_UserInChannel(User)
  Found = False
  For i = 0 To GetInternalUserCount
    If LCase(GetNameByPosition(i)) = LCase(User) Then
      Found = True
    End If
  Next
  gd_UserInChannel = Found
End Function


Function gd_ParseMessage(Username, Flags, Message, Ping, Product, Level, OriginalStatString)
  
  On Error Resume Next
  
  GetDBEntry Username, uNum, uFlags
  ClanTag = GetInternalDataByUsername(Username, 0)

  If ClanTag = vbNullString Then ClanTag = gd_NoClan
  If uNum = -1 Then uNum = 0
  If uFlags = vbNullString Then uFlags = "none"

  StatString = ReverseString(OriginalStatString)
  sStatString = Split(StatString)
      
  If InStr(Product, "3") > 0 AND UBound(sStatString) > 0 AND InStr(gd_Message, "%ico") > 0 Then  
  
    For i = 0 To UBound(sStatString)
      If sStatString(i) = Product Then
        IconInfo = sStatString(i - 1)
      End If
    Next
    
    If IconInfo = "WCPG" Then
      Icon = "WCG ProGamer"
    Else
    
      IconRaceShort = Array("H", "U", "R", "O", "N", "T")
      IconRaceLong = Array("Human", "Undead", "Random", "Orc", "Night Elf", "Tournament")
      IconRace = Mid(IconInfo, 3, 1)
      For i = 0 To UBound(IconRaceShort)
        If IconRace = IconRaceShort(i) Then
          IconRace = IconRaceLong(i)
          Exit For
        End If
      Next
      
      If Not InArray(IconRaceLong, IconRace) Then IconRace = "Unknown"
        
      IconName = Mid(IconInfo, 4, 1)    
      IconNameShort = Array(1, 2, 3, 4, 5, 6)      
      IconNameLong = CreateRacialIconArray(IconRace)        
      For i = 0 To UBound(IconNameShort)
        If CInt(IconName) = IconNameShort(i) Then
          IconName = IconNameLong(i)
          Exit For  
        End If
      Next
        
      Icon = IconRace & " - " & IconName
  
    End If
  Else
    Icon = gd_NoIcon
  End If
  
  Msg = Replace(gd_Message, "%u", Username)
  Msg = Replace(Msg, "%pi", Ping)
  Msg = Replace(Msg, "%pr", Product)
  Msg = Replace(Msg, "%l", Level)
  Msg = Replace(Msg, "%d", Date)
  Msg = Replace(Msg, "%t", Time)
  Msg = Replace(Msg, "%an", uNum)
  Msg = Replace(Msg, "%af", uFlags)
  Msg = Replace(Msg, "%ch", myChannel)
  Msg = Replace(Msg, "%ct", ClanTag)
  Msg = Replace(Msg, "%ho", GetConfigEntry("Main", "HomeChan", "config.ini"))
  Msg = Replace(Msg, "%cc", GetInternalUserCount)
  Msg = Replace(Msg, "%ico", Icon)
  Msg = Split(Msg, "%nl")
  
  gd_ParseMessage = Msg
  
  If Err.Number <> 0 THen
    AddChat vbRed, Err.Source
    AddChat vbRed, Err.Description
    AddChat vbRed, "Statstring: " & StatString
    AddChat vbRed, "Msg: " & Msg
    AddChat vbRed, "Icon Info: " & IconInfo
  End If
End Function


Sub gd_WriteDefaultSettings
  WriteConfigEntry "Main", "Greet Message", "[GD] This is an automated message notifying you that you are NOT safelisted.", "GD.Settings.ini"
  WriteConfigEntry "Variables", "%u", "User", "GD.Settings.ini"  
  WriteConfigEntry "Variables", "%t", "Time", "GD.Settings.ini"
  WriteConfigEntry "Variables", "%d", "Date", "GD.Settings.ini"
  WriteConfigEntry "Variables", "%pi", "Ping", "GD.Settings.ini"
  WriteConfigEntry "Variables", "%pr", "Product", "GD.Settings.ini"
  WriteConfigEntry "Variables", "%ch", "Current Channel", "GD.Settings.ini"
  WriteConfigEntry "Variables", "%ho", "Home Channel", "GD.Settings.ini"
  WriteConfigEntry "Variables", "%ct", "User's clan tag", "GD.Settings.ini"
  WriteConfigEntry "Variables", "%l", "Level", "GD.Settings.ini"
  WriteConfigEntry "Variables", "%an", "Numerical Access", "GD.Settings.ini"
  WriteConfigEntry "Variables", "%af", "Flagged Access", "GD.Settings.ini"
  WriteConfigEntry "Variables", "%cc", "Amount of people in the channel", "GD.Settings.ini"
  WriteConfigEntry "Variables", "%nl", "Newline - Will start a second message", "GD.Settings.ini"
End Sub


Function ReverseString(Str)
  For i = 0 To Len(Str)
    If i <> Len(Str) Then nStr = nStr & Mid(Str, Len(Str) - i, 1)
  Next
  ReverseString = nStr
End Function

Function CreateRacialIconArray(Race)
  Select Case Race
    Case "Human"
      arrLong = Array("Peon", "Rifleman", "Sorceress", "Spellbreaker", "Bloodmage", "Jiana")
    Case "Undead"
      arrLong = Array("Peon", "Crpyt Fiend", "Banshee", "Destroyer", "Crypt Lord", "Sylvanas")
    Case "Random"
      arrLong = Array("Peon", "Myrmidon", "Siren", "Dragon Turtle", "Sea Witch", "Illidan")
    Case "Orc"
      arrLong = Array("Peon", "Troll Headhunter", "Shaman", "Spirit Walker", "Shadow Hunter", "Rexxar")
    Case "Night Elf", "Night Elves"
      arrLong = Array("Peon", "Huntress", "Druid of the Talon", "Dryad", "Keeper of the Grove", "Maiev")
    Case "Tournament", "Unknown"
      arrLong = Array("Peon", "Felguard", "Infernal", "Doomguard", "Pit Lord", "Archimonde")
  End Select
  CreateRacialIconArray = arrLong
End Function

Function InArray(Arr, Item)
  If Not IsArray(Arr) Then
    InArray = False
  Else
    Found = False
    For i = LBound(Arr) To UBOund(Arr)
      If LCase(Arr(i)) = LCase(Item) Then
        Found = True
      End If
    Next
    InArray = Found
  End If
End Function
« Last Edit: December 15, 2008, 04:26:00 PM 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]

Ace

  • Administrators
  • Full Member
  • ***
  • Posts: 227
    • View Profile
    • http://
not safelist
« Reply #4 on: December 15, 2008, 02:14:06 PM »
Missed something, I see just by looking at it.
'GDS
'4.3

Sub gd_Greet_Timer()

Sub gd_Event_Load

How could you test it?
[img]http://zeus.cooltext.com/images/9ff/9fff41541771f1d8f564cabff80fd40cfb587413.jpg\" border=\"0\" class=\"linked-image\" /][img]http://209.85.12.232/13848/49/pip/admin.png\" border=\"0\" class=\"linked-image\" /]

Hero

  • Administrator
  • Hero Member
  • *****
  • Posts: 502
    • View Profile
    • http://rev7.net
not safelist
« Reply #5 on: December 16, 2008, 05:08:17 AM »
I might have edited that
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://
not safelist
« Reply #6 on: December 16, 2008, 07:46:31 AM »
All I know is I didn't put GDS when I posted it....
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
not safelist
« Reply #7 on: December 16, 2008, 08:16:58 AM »
Lol. Use what you did in the AM plugin to exit the sub if the user is safelisted as an example of what you need to do here. Its pretty much the same thing just about.
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