Code:
#NoEnv
SetWorkingDir, %A_ScriptDir%
SendMode, Input
successes = 0
msgbox Huggies Bot 0.2 Beta by nick761 | Mango12 IRC only!`n`nYou'll need to create an account at enjoytheriderewards.com to use this bot.`nThe browser on the settings window is just the browser you used to create your master account to look more legit.`n`nReport any bugs you find and enjoy.
InputBox, mindelay, Huggies Bot Beta, Enter your minimum delay in milliseconds. It uses this right after inviting someone (as if a person is checking their email) and right after finishing registration (waiting until inviting another person).
InputBox, maxdelay, Huggies Bot Beta, Enter your maximum delay in milliseconds.
InputBox, usetooltips, Huggies Bot Beta, Do you want status tooltips? TRUE for yes. Anything else or blank for no.
if usetooltips = true
showtooltips = 1
InputBox, password, Enter the password for the new accounts. You don't need to remember this.
Goto, SettingsGUI
return
;--------------------
SettingsGUI:
;--------------------
; The intial GUI seen when the program is launched
Gui, Add, Text, x12 y15 w60 h20 , Email:
Gui, Add, Text, x12 y42 w60 h20 , Password:
Gui, Add, Text, x12 y72 w60 h20 , Browser:
Gui, Add, Text, x12 y100 w60 h20 , Limit:
Gui, Add, Edit, x75 y13 w140 h20 vAusername,
Gui, Add, Edit, x75 y39 w140 h20 vApassword Password,
Gui, Add, DropDownList, x74 y68 w140 h21 vAbrowser, Internet Explorer|Firefox|Chrome|Safari|Opera
Gui, Add, Edit, x74 y99 w40 h20 vLimit, 20
Gui, Add, Button, x137 y98 w70 h23 Default gLogin, Start
Gui, Show, x127 y87 h132 w222, [Witty name here]
return
;--------------------
Login:
;--------------------
; Submit and hide the GUI
Gui, Submit
Gui, Destroy
; See which browser the user chose
if Abrowser = Internet Explorer
AuserAgent := "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)"
else if Abrowser = Firefox
AuserAgent := "Mozilla/5.0 (Windows; U; Windows NT 6.1; it; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6"
else if Abrowser = Chrome
AuserAgent := "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML,like Gecko) Chrome/4.0.249.43 Safari/532.5"
else if Abrowser = Safari
AuserAgent := "Mozilla/5.0 (Windows; U; Windows NT 6.1; ko-KR) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10)"
else if Abrowser = Opera
AuserAgent := "Opera/9.63 (Windows NT 6.1; U; en) Presto/2.1.1"
else ; If not specified, default to IE
AuserAgent := "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)"
; Generate a random used in some URLs
Random, Arand, 1000, 9999
if (showtooltips)
ToolTip, Fetching main page...
; Fetch the main page
RunWait, curl.exe --insecure --user-agent "%AuserAgent%" --referer http://enjoytheriderewards.com/ --cookie-jar Acookies.txt --output Amain.htm --url "https://enjoytheriderewards.com/default.aspx?c=us&bhcp=1",,Hide
if (showtooltips)
ToolTip, Waiting 10000 milliseconds...
; Wait as if Flash is loading
Sleep, 10000
if (showtooltips)
ToolTip, Submitting your login information...
; Submit the user's login information
;Ausername := UrlEncode(Ausername)
post = <request> <email>%Ausername%</email> <password>%Apassword%</password></request>
RunWait, curl.exe --insecure --user-agent "%auserAgent%" --referer http://assets.securepromotion.com/KC/Loyalty/preloader_en.swf --cookie-jar Acookies.txt --cookie Acookies.txt --output Alogin.htm --header "content-type: text/xml" --url https://enjoytheriderewards.com/Login.ashx?cache=%arand% --data "%post%",,Hide
FileRead, alogin, alogin.htm
IfNotInString, alogin, SUCCESS
{
MsgBox, An error has occured logging you in. Please check your username and password and try again.
Goto, SettingsGUI
}
Goto, Main
return
;--------------------
Main:
;--------------------
Gosub, GenerateRandoms
Gosub, InviteAccount
Random, delay, %mindelay%, %maxdelay%
if (showtooltips)
ToolTip, Waiting %delay% milliseconds...
Sleep, %delay%
Goto, StartRegister
return
;--------------------
GenerateRandoms:
;--------------------
if (showtooltips)
ToolTip, Generating randoms...
; Generate a user agent string
Random, browser, 1, 5
if browser = 1 ; Internet Explorer
userAgent := "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)"
if browser = 2 ; Firefox
userAgent := "Mozilla/5.0 (Windows; U; Windows NT 6.1; it; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6"
if browser = 3 ; Chrome
userAgent := "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML,like Gecko) Chrome/4.0.249.43 Safari/532.5"
if browser = 4 ; Safari
userAgent := "Mozilla/5.0 (Windows; U; Windows NT 6.1; ko-KR) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10)"
if browser = 5 ; Opera
userAgent := "Opera/9.63 (Windows NT 6.1; U; en) Presto/2.1.1"
; Choose the page to grab (for female or male names)
Random, gender, 1, 2
if gender = 1
page = male
if gender = 2
page = female
if (showtooltips)
ToolTip, Grabbing identity from FakeNameGenerator...
; Fetch the fake name generator page
UrlDownloadToFile, http://www.fakenamegenerator.com/gen-%page%-us-us.php, fng.htm
FileRead, fng, fng.htm
if (showtooltips)
ToolTip, Parsing FakeNameGenerator identity...
; Parse out the fake name generator identity
regex = (?<=/vcard.php\?identity=).*?(?=">)
pos := RegExMatch(fng, regex, info)
StringReplace, info, info, --, /, All ; Workaround to allow AHK to use a string instead of a character as a delimiter in a parse loop
Loop, Parse, info, /
{
if A_Index = 1
firstName = %A_LoopField%
if A_Index = 2
lastName = %A_LoopField%
if A_Index = 3
street = %A_LoopField%
if A_Index = 4
zipCode = %A_LoopField%
if A_Index = 5
state = %A_LoopField%
if A_Index = 6
city = %A_LoopField%
if A_Index = 7
phone = %A_LoopField%
if A_Index = 8
birthDay = %A_LoopField%
if A_Index = 9
birthMonth = %A_LoopField%
if A_Index = 10
birthYear = %A_LoopField%
if A_Index = 11
email = %A_LoopField%
}
; Generate some more information needed
Random, retailer, 50, 80
Random, huggies, 1, 10
Random, pampers, 1, 10
Random, domain, 1, 10
if domain = 1
emaildomain = gmail.com
if domain = 2
emaildomain = hotmail.com
if domain = 3
emaildomain = yahoo.com
if domain = 4
emaildomain = ymail.com
if domain = 5
emaildomain = aol.com
if domain = 6
emaildomain = aim.com
if domain = 7
emaildomain = live.com
if domain = 8
emaildomain = comcast.net
if domain = 9
emaildomain = prodigy.net
if domain = 10
emaildomain = sbcglobal.net
; Format the information correctly
if gender = 1
prefix = Mr
if gender = 2
prefix = Mrs
StringReplace, phone, phone, -,, All
StringReplace, email, email, text2re.com, %emaildomain%, All
StringReplace, email, email, `%23, @, All
return
;--------------------
InviteAccount:
;--------------------
; Clean up
GoSub, ACleanup
if (showtooltips)
ToolTip, Inviting a new email address...
; Add the email to your account
post = <request> <email1>%email%</email1> <email2/> <email3/> <email4/> <email5/></request>
RunWait, curl.exe --insecure --user-agent "%auserAgent%" --referer http://assets.securepromotion.com/KC/Loyalty/preloader_en.swf --cookie-jar Acookies.txt --cookie Acookies.txt --output Ainvite.htm --header "content-type: text/xml" --url https://enjoytheriderewards.com/AddTAF.ashx?cache=%arand% --data "%post%",,Hide
FileRead, ainvite, ainvite.htm
IfNotInString, ainvite, SUCCESS
{
MsgBox, An error was returned`n%ainvite%
Goto, Main
}
return
;--------------------
StartRegister:
;--------------------
; Clean up
Gosub, Cleanup
if (showtooltips)
ToolTip, Grabbing the main page...
; Fetch the main page
RunWait, curl.exe --insecure --user-agent "%userAgent%" --referer http://enjoytheriderewards.com/ --cookie-jar cookies.txt --output main.html --url "https://enjoytheriderewards.com/default.aspx?c=us&bhcp=1",,Hide
if (showtooltips)
ToolTip, Waiting 10000 milliseconds...
; Wait as if Flash is loading
Sleep, 10000
; Get the Captcha
GoSub, GetCaptcha
return
;--------------------
GetCaptcha:
;--------------------
if (showtooltips)
ToolTip, Grabbing the Captcha...
; Fetch the registration Captcha
Random, rand, 1000, 9999
RunWait, curl.exe --insecure --user-agent "%userAgent%" --referer http://assets.securepromotion.com/KC/Loyalty/preloader_en.swf --cookie-jar cookies.txt --cookie cookies.txt --output captcha.swf --url https://enjoytheriderewards.com/GenShield.ashx?cache=%rand%,,Hide
if (showtooltips)
ToolTip, Converting the Captcha...
; Convert the Captcha into a JPG
RunWait, swfextract.exe -j 1 -o captcha.jpg captcha.swf,,Hide
if (showtooltips)
ToolTip, Waiting for you to enter the Captcha...
; Show the enter Captcha window
Gui, 2:Destroy
Gui, 2:Add, Picture, x12 y10 w300 h50, captcha.jpg
Gui, 2:Add, Button, x242 y70 w70 h20 Default gDoRegister, Enter
Gui, 2:Add, Button, x12 y70 w70 h20 gGetCaptcha, Refresh
Gui, 2:Add, Edit, x92 y70 w140 h20 vcaptchaResponse,
Gui, 2:Show, x127 y87 h105 w328, Enter Captcha
return
;--------------------
DoRegister:
;--------------------
; Submit and hide the Captcha window
Gui, 2:Submit
if (showtooltips)
ToolTip, Submitting the first registration form...
; Submit the first registration form
post = <request> <email>%email%</email> <confirmEmail>%email%</confirmEmail> <password>%password%</password> <confirmPassword>%password%</confirmPassword> <birthdate>%birthYear%-%birthMonth%-%birthDay%</birthdate> <country>US</country> <provState>%state%</provState> <securityCode>%captchaResponse%</securityCode> <terms>1</terms></request>
RunWait, curl.exe --insecure --user-agent "%userAgent%" --referer http://assets.securepromotion.com/KC/Loyalty/preloader_en.swf --cookie-jar cookies.txt --cookie cookies.txt --output registration1.htm --header "content-type: text/xml" --url https://enjoytheriderewards.com/QualifyUser.ashx?cache=%rand% --data "%post%",,Hide
FileRead, registration1, registration1.htm
IfNotInString, registration1, SUCCESS
{
IfInString, registration1, CODE
{
Goto, GetCaptcha
}
MsgBox An error was returned`n%registration1%
Goto, Main
}
if (showtooltips)
ToolTip, Submitting the final registration form...
; Submit the final registration form
post = <request> <email>%email%</email> <confirmEmail>%email%</confirmEmail> <password>%password%</password> <confirmPassword>%password%</confirmPassword> <birthdate>%birthYear%-%birthMonth%-%birthDay%</birthdate> <country>US</country> <provState>%state%</provState> <securityCode>%captchaResponse%</securityCode> <terms>1</terms> <responseCode>SUCCESS</responseCode> <prefix>%prefix%</prefix> <firstName>%firstName%</firstName> <lastName>%lastName%</lastName> <address1>%street%</address1> <address2/> <city>%city%</city> <postalZip>%zipCode%</postalZip> <phoneNumber>%phone%</phoneNumber> <mobileNumber/> <languageCode>EN</languageCode> <regRetailerId>%retailer%</regRetailerId> <expecting>No</expecting> <expectingDate/> <haveChildren>No</haveChildren> <regRetailerOther/> <hiddenRetailer/> <netPromoterHuggies>%huggies%</netPromoterHuggies> <netPromoterPampers>%pampers%</netPromoterPampers> <brandOptin/> <newsLetterOptin/> <mobileOptin/></request>
RunWait, curl.exe --insecure --user-agent "%userAgent%" --referer http://assets.securepromotion.com/KC/Loyalty/preloader_en.swf --cookie-jar cookies.txt --cookie cookies.txt --output registration2.htm --header "content-type: text/xml" --url https://enjoytheriderewards.com/AddUser.ashx?cache=%rand% --data "%post%",,Hide
FileRead, registration2, registration2.htm
IfNotInString, registration2, SUCCESS
{
MsgBox An error was returned`n%registration2%
Goto, Main
}
else
successes += 1
; Log out
RunWait, curl.exe --insecure --user-agent "%userAgent%" --referer http://assets.securepromotion.com/KC/Loyalty/preloader_en.swf --cookie-jar cookies.txt --cookie cookies.txt --output registration2.htm --header "content-type: text/xml" --url https://enjoytheriderewards.com/Logout.ashx?cache=%rand% --data "<request/>",,Hide
; Delays and limits
points := successes
points *= 5
if successes = %limit%
{
MsgBox, Successfully created %successes% accounts under your referral, getting you %points% points.
ExitApp
}
else
{
Random, delay, %mindelay%, %maxdelay%
ToolTip, You just got 5 points!`n%points% points total!
if (showtooltips)
ToolTip, Waiting %delay% milliseconds..,
Sleep, %delay%
Goto, Main
}
return
;--------------------
Cleanup:
;--------------------
FileDelete, captcha.jpg
FileDelete, captcha.swf
FileDelete, cookies.txt
FileDelete, fng.htm
FileDelete, main.htm
FileDelete, registration1.htm
FileDelete, registration2.htm
return
;--------------------
ACleanup:
;--------------------
FileDelete, Amain.htm
FileDelete, Alogin.htm
FileDelete, Ainvite.htm
return
;--------------------
GuiClose:
;--------------------
GoSub, Cleanup
GoSub, ACleanup
FileDelete, Acookies.txt
ExitApp
;--------------------
Gui2Close:
;--------------------
Goto, GetCaptcha
return
;--------------------
; Functions
;--------------------
UrlEncode( String )
{
OldFormat := A_FormatInteger
SetFormat, Integer, H
Loop, Parse, String
{
if A_LoopField is alnum
{
Out .= A_LoopField
continue
}
Hex := SubStr( Asc( A_LoopField ), 3 )
Out .= "%" . ( StrLen( Hex ) = 1 ? "0" . Hex : Hex )
}
SetFormat, Integer, %OldFormat%
return Out
}