StealthBot.net: Add que to messages in script to avoid ip ban - StealthBot.net

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Add que to messages in script to avoid ip ban

#1 User is offline   dhadowxl Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: October-16 16

Posted October 17, 2016 - 04:21 AM

This is made to use as an open trade for members/friends, works great but need the messages to be delayed so there will not be a ip ban.
Below is the script.

'fm
'1.0


Const FWD_OWNER = "%o"
Const FWD_FRIEND = "%f"
Const MSGBOX_TITLE = "Forward Whisper Script - StealthBot"

Set RegexTrade = new RegExp

With RegexTrade
.Pattern = "^/t.{0,}$"
.IgnoreCase = False
.Global = True
End With

Sub fm_event_Load()
' create menu item
CreateObj "Menu", "mnuSetUser"
mnuSetUser.Caption = "Set Forward Whisper User"
End Sub

Sub mnuSetUser_Click()
Dim ForwardTo, InputMsg
InputMsg = _
"Set the user to forward all whispers to." & vbNewLine & _
"Use " & UCase(FWD_OWNER) & " to whisper the bot's current owner." & vbNewLine & _
"Use " & UCase(FWD_FRIEND) & " to whisper the bot's current friends." & vbNewLine & _
"Leave blank or hit Cancel to cancel."
ForwardTo = LCase(Trim(GetSettingsEntry("ForwardTo")))
If Len(ForwardTo) = 0 Then ForwardTo = FWD_OWNER
ForwardTo = InputBox(InputMsg, MSGBOX_TITLE, ForwardTo)
If Len(Trim(ForwardTo)) = 0 Then ForwardTo = FWD_OWNER
If ForwardTo <> vbNullString Then WriteSettingsEntry "ForwardTo", ForwardTo
End Sub

Sub fm_event_WhisperFromUser(Username, Flags, Message, Ping)
ReceivedWhisper Username, Message
End Sub

' call this subroutine when a whisper to be forwarded according to this script's settings is received
Sub ReceivedWhisper(Username, Message)
Dim fwduser, fwdmsg, I
' get the user to receive the whisper from setting
fwduser = LCase(Trim(GetSettingsEntry("ForwardTo")))



' if the message is a login/dc/joining it will junk them
if RegexTrade.Test(Message) then
'remove the cmd at the begening of the whisper
Message = Replace(Message, "/t", "")
' get the message format from settings, if an advanced user has stored it
fwdmsg = GetSettingsEntry("ForwardFormat")
' default format to "Whisper from <name>: <message>"
If Len(fwdmsg) = 0 Then fwdmsg = "Whisper from %u: %m"
' replace %u and %m
fwdmsg = Replace(fwdmsg, "%u", Username)
fwdmsg = Replace(fwdmsg, "%m", Message)
fwdmsg = Replace(fwdmsg, "%t", Time())
fwdmsg = Replace(fwdmsg, "%d", Date())
' default receiver to owner
If Len(fwduser) = 0 Then fwduser = FWD_OWNER
' if user to send to = %O, replace with bot owner
If fwduser = FWD_OWNER Then fwduser = BotVars.BotOwner
' if user to send to = %F
If fwduser = FWD_FRIEND Then
' send to f l
AddQ "/f m " & fwdmsg
Else
' user to receive whisper is sending the whisper, don't mimic
If fwduser = LCase(Username) Then Exit Sub
' check if receiver is on f l
For I = 1 To Friends.Count
If LCase(Friends(I).Name) = LCase(fwduser) Then
' yes? check if they are offline, don't send
If Not Friends(I).IsOnline Then Exit Sub
End If
Next
' send it
AddQ "/w " & fwduser & " " & fwdmsg
End If
End If
End Sub

#2 User is online   Pyro Icon

  • Militant Asshole
  • Icon
  • Group: Administrators
  • Posts: 682
  • Joined: July-31 09

Posted October 23, 2016 - 07:44 AM

The bot shouldn't let you get IP banned unless you've tweaked the settings. If you're having a problem you can manually change the queue settings for the whole bot using config.ini overrides.

See: http://www.stealthbo...i/Message_queue
Pyro, AKA Davnit
  • StealthBot Developer
  • Host of pyro.no-ip.biz

Website: https://davnit.net/
BNETDocs Discord: https://discord.gg/u87WVeu

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users