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
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