How to make a vbs spam bot? - vbscript

I'm trying to make a spam bot, the basic function works fine but the counter isn't. It should go from and imputed number [i] and stop at another [count] and if count < i; it should count backwards. But it is not stopping at count, it keeps going, It won't count backwards either.
set shl = createobject("wscript.shell")
spam = inputbox("What do you want to spam?")
if spam = "/count" then
i = inputbox("Start at what number?")
count = inputbox("Stop at what number?")
wscript.sleep 2500
if count > i then
do while count > i
shl.sendkeys i
wscript.sleep 10
shl.sendkeys "{ENTER}"
wscript.sleep 10
i = i + 1
loop
elseif count < i then
do while count < i
shl.sendkeys i
wscript.sleep 10
shl.sendkeys "{ENTER}"
wscript.sleep 10
i = i - 1
loop
else
shl.sendkeys i
end if
end if
else
count = inputbox("How many times?")
wscript.sleep 2500
do while count > 0
shl.sendkeys spam
wscript.sleep 10
shl.sendkeys "{ENTER}"
wscript.sleep 10
count = count - 1
loop
end if
I'm also going to make a function where you can send multiple lines. Any other ideas?

set shell = createobject ("wscript.shell")
strtext = inputbox ("Write down your message you like to spam")
strtext2 = inputbox ("Message 2")
strtext3 = inputbox ("Message 3")
strtext4 = inputbox ("Message 4")
strtext5 = inputbox ("Message 5")
strtimes = inputbox ("How many times do you like to spam? Type in 1 less than the amount of msgs you want to spam. eg; if want to spam 1000, type 999.Max no.1999")
strspeed = inputbox ("Type 1000 for 1 msg per second 100 for 10 msg per second etc type 1 for fastest")
strtimeneed = inputbox ("How many SECONDS do you need to get to your victims input box? Click where you want to spam.")
If not isnumeric (strtimes & strspeed & strtimeneed) then
msgbox "You entered something else then a number on Times, Speed and/or Time need. shutting down"
wscript.quit
End If
strtimeneed2 = strtimeneed * 1000
do
msgbox "You have " & strtimeneed & " seconds to get to your input area where you are going to spam."
wscript.sleep strtimeneed2
for i=0 to strtimes
shell.sendkeys (strtext & "{enter}")
shell.sendkeys (strtext2 & "{enter}")
shell.sendkeys (strtext3 & "{enter}")
shell.sendkeys (strtext4 & "{enter}")
shell.sendkeys (strtext5 & "{enter}")
wscript.sleep strspeed
Next
wscript.sleep strspeed * strtimes / 10
returnvalue=MsgBox ("Want to spam again?",36)
If returnvalue=6 Then
End If
If returnvalue=7 Then
msgbox "Spambox is shutting down"
wscript.quit
End IF
strtext = inputbox ("Write down your message you like to spam")
strtimes = inputbox ("How many times do you like to spam? Type in 1 less than the amount of msgs you want to spam. eg; if want to spam 1000, type 999")
strspeed = inputbox ("Type 1000 for 1 msg per second 100 for 10 msg per second etc type 1 for fastest")
strtimeneed = inputbox ("How many SECONDS do you need to get to your victims input box? Click where you want to spam")
loop
This is my edit of a code I found online that allows for multiple lines

I think on the countdown you put else if, instead of Elseif, i have also changed some of the indentation to make it easier to read

Related

Single Line Input VBS Autotyper

I am currently trying to make an autotyper in VBS and I cannot figure out how to easily input what is to be typed. Right now, this is what my code has to look like:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.AppActivate "notepad"
WScript.sleep 10000
WshShell.SendKeys "H"
WScript.Sleep 100
WshShell.SendKeys "e"
WScript.Sleep 100
WshShell.SendKeys "l"
WScript.Sleep 100
WshShell.SendKeys "l"
WScript.Sleep 100
WshShell.SendKeys "o"
But I really want my code to have all the text that will be auto-typed in just one line instead of me having to repeat the SendKeys for every letter.
I made for you a little example that can type letter by letter as a Typewriter.
Hope this what you are looking for !
strText="Hello ! How are you mate ? Hope that everything is OK !" & vbCrlf &_
"This vbscript is made by Hackoo !"
Call AutoTypeWriter(strText)
'------------------------------------------
Sub AutoTypeWriter(strText)
intPause = 150
Set Ws = CreateObject("WScript.Shell")
'To start Notepad maximized
Ws.Run "Notepad",3
WScript.Sleep 1000
intTextLen = Len(strText)
For x = 1 to intTextLen
strTempText = Mid(strText,x,1)
Ws.Sendkeys strTempText
WScript.Sleep intPause
Next
End Sub
'------------------------------------------
This works for me .. here
strtext = inputbox ("Message (Auto-typer made/coded by bolts)")
strtimes = inputbox ("Message Amount (Amount of messages)")
If not isnumeric (strtimes) then
msgbox "Hint: Use numbers."
wscript.quit
End If
strspeed = inputbox ("Message Speed (How many per second. 1000 = 1 message per second, 100 = 10 messages per second)")
If not isnumeric (strspeed) then
msgbox "Hint: Use numbers."
wscript.quit
End If
strtimeneed = inputbox ("How long before the typing starts. (Seconds)")
If not isnumeric (strtimeneed) then
msgbox "Hint: Use numbers."
wscript.quit
End If
strtimeneed2 = strtimeneed * 1000
do
msgbox "You have " & strtimeneed & " seconds to get to your text area where you are going to type."
wscript.sleep strtimeneed2
shell.sendkeys ("" & "{enter}")
for i=0 to strtimes
shell.sendkeys (strtext & "{enter}")
wscript.sleep strspeed
Next
shell.sendkeys ("" & "{enter}")
wscript.sleep strspeed * strtimes / 10
returnvalue=MsgBox ("Want to type again with the same message, ammount, speed and time?",36)
If returnvalue=6 Then
msgbox "Ok typing will start again in a few seconds."
End If
If returnvalue=7 Then
msgbox "Bolts' lazy auto-typing program is going to sleep."
wscript.quit
End IF
loop

How to run two do loops at the same time on VBScript

I'm trying to make it so my code runs 2 do loops at a time so it can run the open disk drive code and spam caps lock code at the same time. Any way I could do this?
Set oWMP = CreateObject("WMPlayer.OCX.7")
Set colCDROMs = oWMP.cdromCollection
x=msgbox("Keyboard error with key CAPS LOCK",0,"Critical Error")
x=msgbox("Error with CD Drive",0,"Critical Error")
Set wshShell =wscript.CreateObject("WScript.Shell")
message= "Critical Disk Drive Error Alert Call Microsoft Support at 0 3 4 4 8 0 0 2 4 0 0 to resolve the issue"
message1= "Caps Lock key Error"
Dim message, sapi
Set sapi=CreateObject("sapi.spvoice")
sapi.Speak message
sapi.Speak message1
do
if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count -1
colCDROMs.Item(i).Eject
Next
For i = 0 to colCDROMs.Count -1
colCDROMs.Item(i).Eject
Next
End If
wscript.sleep 100
wshshell.sendkeys "{CAPSLOCK}"
wscript.sleep 100
loop
Take a look at the below example:
CheckTask ' always at the begining of the script
LaunchTask "EjectCdRoms" ' friendly keep CD-ROMs opened
LaunchTask "MsgA" ' friendly show the message A
LaunchTask "MsgB" ' friendly show the message B
LaunchTask "Speak" ' friendly speak
' procedures to be launched asynchronously
Sub EjectCdRoms()
Dim i
On Error Resume Next
Do
With CreateObject("WMPlayer.OCX.7").cdromCollection
For i = 0 To .Count - 1
.Item(d).Eject
Next
End With
WScript.Sleep 500
Loop
End Sub
Sub MsgA()
Do
WScript.Sleep 3000
MsgBox "Critical Disk Drive Error Alert Call Microsoft Support at 03448002400 to resolve the issue", 48, "Blah"
Loop
End Sub
Sub MsgB()
Do
WScript.Sleep 5000
MsgBox "Caps Lock key Error", 48, "Blah"
Loop
End Sub
Sub Speak()
Do
With CreateObject("SAPI.SpVoice")
WScript.Sleep 4000
.Speak "Critical Disk Drive Error Alert Call Microsoft Support at 0 3 4 4 8 0 0 2 4 0 0 to resolve the issue"
WScript.Sleep 4000
.Speak "Caps Lock key Error"
End With
Loop
End Sub
' utility procedures, do not modify
Sub CheckTask()
If WScript.Arguments.Named.Exists("task") Then
On Error Resume Next
Execute WScript.Arguments.Named.Item("task")
WScript.Quit
End If
End Sub
Sub LaunchTask(sTaskName)
CreateObject("WScript.Shell").Exec """" & WScript.FullName & """ """ & WScript.ScriptFullName & """ ""/task:" & sTaskName & """"
End Sub

Turn off a VBScript program while it is running

(This is a .vbs program) I am trying to make a message bot for a program but I came up with a problem where if you set the time for too long, and set number of messages too high, you can't stop the program easily and have to deal with your message being typed over and over again until it is finished. Is there a way to add an option while it is running to stop the message from being typed?
Here is the code:
set shell = createobject ("wscript.shell")
strtext = inputbox ("Type the message you like to type")
strtimes = inputbox ("How many times would you like to type this message?")
strspeed = inputbox ("How fast do you like to message? (1000 = one per sec, 100 = 10 per sec etc)")
strtimeneed = inputbox ("How many SECONDS do you need to get to your input box?")
If not isnumeric (strtimes & strspeed & strtimeneed) then
msgbox "You entered something else then a number on Times, Speed and/or Time need. Closing program"
wscript.quit
End If
strtimeneed2 = strtimeneed * 1000
do
msgbox "You have " & strtimeneed & " seconds to get to your input area where you are going to message."
wscript.sleep strtimeneed2
shell.sendkeys ("Hello" & "{enter}")
for i=0 to strtimes
shell.sendkeys (strtext & "{enter}")
wscript.sleep strspeed
Next
shell.sendkeys ("Bye" & "{enter}")
wscript.sleep strspeed * strtimes / 10
returnvalue=MsgBox ("Want to send the messages again with the same info?",36)
If returnvalue=6 Then
Msgbox "Ok Messagebot will activate again"
End If
If returnvalue=7 Then
msgbox "Messaging is shutting down"
wscript.quit
End IF
loop
You can just set up a shortcut to terminate all running wscript.exe processes. Click right mouse button on the desktop, in context menu choose New - Shortcut:
Enter %comspec% /c taskkill /f /im wscript.exe as location and click Next:
Enter a name you like and click Finish:
Also you may assign hot keys in shortcut properties.

How can I end a Do Loop after some sort of user input?

Any kind of user input will do. Here's the code I have so far.
Set WshShell = WScript.CreateObject("WScript.Shell")
Dim Account
Account = 111111
WScript.Sleep 5000
Do
WScript.Sleep 400
WshShell.SendKeys "drill "
WshShell.SendKeys Account
WshShell.SendKeys "{ENTER}"
Account = Account + 1
Loop
Basically it's a code guesser (for a game) and I want to be able to interrupt it with any kind of user input.
I don't think we have any direct solution. Below code seeks for user interaction after 50 iterations. If yes, control exits from do loop. You can play around with other ways to interrupt the loop and of course you can change the counter as per your need.
Set WshShell = WScript.CreateObject("WScript.Shell")
Dim counter
Dim Account
Dim msgResult
counter = 0
Account = 111111
WScript.Sleep 5000
Do
WScript.Sleep 400
WshShell.SendKeys "drill "
WshShell.SendKeys "drill "
WshShell.SendKeys Account
WshShell.SendKeys "{ENTER}"
Account = Account + 1
If counter = 50 Then 'get user input after 50 iterations
msgResult = MsgBox("Do you want to exit?", vbYesNo)
If msgResult = vbYes Then 'if yes
Exit Do
End If
End If
counter = counter + 1
If counter > 101 then
counter =0
End If
Loop

VBScript to Display Countdown using Vbscript Graphical Elements

I wanted to display a MessageBox which displays countdown from 10 to 1 and autocloses after 10 seconds. As Msgbox in vbscript passes code execution untill the user acts on it i tried it using Popup in Wscript Shell Object
Dim counter
Dim oShell
counter = 10
Set oShell= CreateObject("Wscript.Shell")
While counter > 0
oShell.Popup " Left " & counter & " Seconds",1,"Remind"
counter = counter-1
Wend
But it auto-closes for every second and opens a new popup is there any way i can display the countdown and autoclose using the available GUI elements in vb script
Afraid not, the popup is modal & can't be interacted with while its displayed so there is no way to update its existing content.
If you want a more flexible UI you will need to use something different, the console or HTML in an HTA.
You can use Internet Explorer to create a non-modal display.
Set oIE = CreateObject("InternetExplorer.Application")
With oIE
.navigate("about:blank")
.Document.Title = "Countdown" & string(100, chrb(160))
.resizable=0
.height=200
.width=100
.menubar=0
.toolbar=0
.statusBar=0
.visible=1
End With
' wait for page to load
Do while oIE.Busy
wscript.sleep 500
Loop
' prepare document body
oIE.document.body.innerHTML = "<div id=""countdown"" style=""font: 36pt sans-serif;text-align:center;""></div>"
' display the countdown
for i=10 to 0 step -1
oIE.document.all.countdown.innerText= i
wscript.sleep 1000
next
oIE.quit
I have a code, but it might not help
dTimer=InputBox("Enter timer interval in minutes","Set Timer") 'minutes
do until IsNumeric(dTimer)=True
dTimer=InputBox("Invalid Entry" & vbnewline & vbnewline & _
"Enter timer interval in minutes","Set Timer") 'minutes
loop
flop=InputBox("What do you want to set the timer for?")
if dTimer<>"" then
do
WScript.Sleep dTimer*60*1000 'convert from minutes to milliseconds
Set Sapi = Wscript.CreateObject("SAPI.spVoice")
Sapi.speak "Time's up."
t=MsgBox(flop & vbnewline & vbnewline & "Restart Timer?", _
vbYesNo, "It's been " & dTimer &" minute(s)")
if t=6 then 'if yes
'continue loop
else 'exit loop
exit do
end if
loop
end if
please excuse my weird variable names.
This code is from https://wellsr.com/vba/2015/vbscript/vbscript-timer-with-wscript-sleep/
It actually is possible to edit the countdown, very easily for VBScript, so I don't understand what the problem is.
Here's the code:
Dim counter
Dim oShell
counter =InputBox("")
#if you add =InputBox you can have the choice to type in the amount of times the popup repeats#
Set oShell= CreateObject("Wscript.Shell")
While counter > 0
oShell.Popup " Time until shutdown " & counter & " Seconds",(1),"[3]Critical Viruses Detected
#and if you change the (1) to whatever number you want then you can change how fast the popup repeats and if you join this with the "open command" then you can make a gnarly nondangerous virus#
counter = counter-1
Wend

Resources