Script Example: FTP Game Cheater Demo Upload Script

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

Post Reply
User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Script Example: FTP Game Cheater Demo Upload Script

Post by CyberCitizen » Wed May 08, 2013 3:36 am

Years ago when I was using MS in its early days as well as mine, I was a game admin for EGN Australia, who were an online games network and LANing community between 2003 and 2009.

In the early days we were looking for a way that users could submit demos of cheaters to us so we could action them in a timely manner. We eventually went to a web submission system, however this tool ran as the primary submission tool for many years.

This is how the EGN Demo uploader was born & also the hiding of FTP passwords in the FTP Status window, after complaining to Marcus. Given MS's advanced features now days, I would do this code very different, including zipping both the info file and demo file together as well as having alot more of the code encrypted.

In this example I have commented out the version check. Originally the program would check the http server for a file, check the version of that file & if it was incorrect, would force the user to download the latest version.

Meant that if I ever made changes to the code & uploaded them, it forced the existing standalone apps to update. I also placed a limitation on file size & how many could be uploaded per day to prevent anyone from submitting multiple files or large files in an attempt to fill the FTP server.

Once the user had submitted a demo, the program stored the user information in the registry to save time when submitting other demos, I think this is what helped make this tool so popular, the user only needed to submit the basic information.

Example Screen On Program
Image

Example Of File Uploaded For Documentation Purposes

Code: Select all

Date: 08/05/2013
Time: 12:39:42
Gamers Name: SteamCheater
Gamers SteamID: STEAM:123456
Server Name: EGN VIC CS:S #3
Reason For Demo: Cheating
Game Type: Counter-Strike Source
Uploaders Name: Michael Allen
Uploaders Email Address: [email protected]
File Uploaded: CSS-20130508123942-Michael Allen.zip
Uploaders IP-Address: 10.23.42.36
Original File Name: M:\MProFont.zip

### Comments ### - Version: v2.7
Wall Cheats
Basically on the server I could pull a directory listing to see if any new files were listed, it also allowed me to process them in order, as they were sorted in game time, followed by date.

· CSS-20130508123942-Michael Allen.txt
· CSS-20130508123942-Michael Allen.zip
· GameType-Date(AmericanFormat)-UploadersName

Using This Tool We Processed Hundreds Of Demos, Keeping Our Game Servers One Of The Primary In Australia That Were Cheater Free.

Code: Select all

Let>APP_TITLE=EGN Demo Upload Tool

//Current Version Information
Let>Version=Version: v2.7

/*
//Checks For Update
HTTPRequest>http://cybercitizen.egn.com.au/EGNDEMOUPLOADERVERSION.txt,,GET,,WebVer,,,,
If>%Version%=%WebVer%,Start,UpdateDemoUploader

Label>UpdateDemoUploader
Let>MSG_HEIGHT=210
Let>MSG_WIDTH=350
MessageModal>Hello%CRLF%%CRLF%The EGN Demo Uploader Is Out Of Date.%CRLF%%CRLF%You Will Now Be Forced To Download The Newest Version.
Let>FTP_STATUS=1
Let>FTP_TIMEOUT=30
Let>INPUT_BROWSE=2
Input>NewDownloadLocation,Please Select A New Location To%CRLF%Download The EGN Demo Uploader,
If>NewDownloadLocation=,Exit
FTPGetFile>cybercitizen.XXXX.com.au,XXXXX,XXXXX,21,%NewDownloadLocation%/EGN Demo Uploader.exe,/public_html/EGN Demo Uploader.exe,I
MessageModal>New Version Of The Demo Uploader Has Been Downloaded%CRLF%%NewDownloadLocation%EGN Demo Uploader.exe%CRLF%%CRLF%Now Executing The New Version.%CRLF%--%CRLF%Regards%CRLF%CyberCitizen
Run Program>%NewDownloadLocation%\EGN Demo Uploader.exe
Goto>Exit
*/

Label>Start
//Get Upload Count
RegistryReadKey>HKEY_CURRENT_USER,Software\EGN Ban Tool,Uploads,Count
RegistryReadKey>HKEY_CURRENT_USER,Software\EGN Ban Tool,Date,Today
//if not already set, set Date
If>Today=
Day>DD
Month>Today
Year>YY
Concat>Today,%DD%%YY%
RegistryWriteKey>HKEY_CURRENT_USER,Software\EGN Ban Tool,Date,Today
Else
//Set Today
Day>DD
Month>Date_Today
Year>YY
Concat>Date_Today,%DD%%YY%
If>Date_Today<>Today
Let>Count=0
RegistryWriteKey>HKEY_CURRENT_USER,Software\EGN Ban Tool,Date,Date_Today
EndIf
EndIf
//If Not Already Set, Set Count
If>Count=
Let>Count=0
Endif

RegistryReadKey>HKEY_CURRENT_USER,Software\EGN Ban Tool,Name,DName
RegistryReadKey>HKEY_CURRENT_USER,Software\EGN Ban Tool,Email,DEmail

If>Count<5
Dialog>DemoLocation
   Caption=EGN Demo Uploader - %Version%
   Width=378
   Height=397
   Top=CENTER
   Left=CENTER
   Max=0
   Min=0
   Close=1
   Resize=0
   Label=[UA] CyberCitizen Demo Upload Tool,8,8,true
   Label=Enter Your Real Name,8,32,true
   Label=Enter Your Email Address So That You Can Be Advised Of The Outcome,8,72,true
   Label=Gamers Name,8,112,true
   Label=Gamers SteamID,192,112,true
   Label=Ban Reason,8,152,true
   Label=Game Type,192,152,true
   Label=Server Name,8,192,true
   Edit=Name,8,48,353,%DName%
   Edit=Email,8,88,353,%DEmail%
   Edit=GamersName,8,128,169,
   Edit=GamersSteamID,192,128,169,
   ComboBox=BanReason,8,168,169, %CRLF%Abusive%CRLF%Cheating%CRLF%Exploits%CRLF%Other (Comments Required)%CRLF%Racism%CRLF%Team Killing
   ComboBox=GameType,192,168,169, %CRLF%Counter-Strike v1.6%CRLF%Counter-Strike Source
   ComboBox=ServerName,8,208,353, %CRLF%EGN VIC CS:S #1%CRLF%EGN VIC CS:S #2%CRLF%EGN VIC CS:S #3%CRLF%EGN VIC CS:S #4%CRLF%EGN VIC CS:S #5%CRLF%EGN VIC CS:S #6%CRLF%EGN WA CS:S #1%CRLF%EGN WA CS:S #2%CRLF%EGN WA CS:S #3%CRLF%EGN WA CS:S #4%CRLF%EGN WA CS:S #5%CRLF%EGN WA CS:S #6%CRLF%EGN WA CS:S #7%CRLF%EGN VIC CS #1%CRLF%EGN VIC CS #2%CRLF%EGN WA CS #1%CRLF%EGN WA CS #2%CRLF%Other (Comments Required)
   Memo=Comments,8,248,353,41,
   Edit=FilePath,8,312,353,
   Button=Locate File,288,336,73,25,0
   Button=Submit Demo,8,336,83,25,3
   Button=Exit,96,336,83,25,2
   Label=Comments,8,232,true
   Label=Demo Location (RAR or ZIP Files Only - 8 Meg Maximum),8,296,true
   Label=%Version%,296,8,true
   Default=Locate File
   FileBrowse=Locate File,FilePath,ZIP and RAR Files|*.zip;*.rar|ZIP Files|*.zip|RAR Files|*.rar|All Files|*.*,open
EndDialog>DemoLocation

Show>DemoLocation

Label>ActionLoop
GetDialogAction>DemoLocation,r
if>r=3,Process
if>r=2,Exit
Goto>ActionLoop

Label>Process
If>%DemoLocation.Name%=,BlankFields
If>%DemoLocation.Email%=,BlankFields
If>%DemoLocation.GamersName%=,BlankFields
If>%DemoLocation.GamersSteamID%=,BlankFields
If>%DemoLocation.BanReason%= ,BlankFields
If>%DemoLocation.GameType%= ,BlankFields
If>%DemoLocation.ServerName%=,BlankFields
If>%DemoLocation.FilePath%=,BlankFields

FileSize>DemoLocation.FilePath,FileSz
Length>DemoLocation.FilePath,Len
Let>Len=Len-2
Midstr>DemoLocation.FilePath,Len,3,Ext
If>{(%Ext%="rar")OR(%Ext%="zip")AND(%FileSz%<8000000)},Continue,Rerun

Label>Rerun
Let>r=0
MDL>%DemoLocation.FilePath%%CRLF%Is not a ZIP or RAR file or it is larger than 8 Meg !!!
ResetDialogAction>DemoLocation
GoTo>ActionLoop

Label>BlankFields
MessageModal>You Have Left One Field Blank%CRLF%%CRLF%Please Check All Fields & Try Again
ResetDialogAction>DemoLocation
Goto>ActionLoop

Label>Continue
CloseDialog>DemoLocation
//Users IP Address & Removes Formatting
HTTPRequest>http://checkip.dyndns.org/,,GET,,HTMLResponse
MidStr>%HTMLResponse%,77,15,IPAddress
StringReplace>%IPAddress%,/,,IPAddress
StringReplace>%IPAddress%,<,,IPAddress
StringReplace>%IPAddress%, ,,IPAddress
StringReplace>%IPAddress%,b,,IPAddress
StringReplace>%IPAddress%,o,,IPAddress
StringReplace>%IPAddress%,d,,IPAddress
StringReplace>%DemoLocation.Name%,|,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,<,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,>,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,{,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,},,DemoLocation.Name
StringReplace>%DemoLocation.Name%,[,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,],,DemoLocation.Name
StringReplace>%DemoLocation.Name%,.,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,:,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,;,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,',,DemoLocation.Name
StringReplace>%DemoLocation.Name%,",,DemoLocation.Name
StringReplace>%DemoLocation.Name%,/,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,\,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,-,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,=,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,!=,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,@,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,#,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,$,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,%,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,^,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,&,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,*,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,(,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,),,DemoLocation.Name

//Captures Date For Upload
Day>the_day
Month>the_month
Year>the_year
Sec>Seconds
Min>Minutes
Hour>Hour
If>%DemoLocation.GameType%=Counter-Strike v1.6
Let>FTPFILE=CS-%the_year%%the_month%%the_day%%Hour%%Minutes%%Seconds%-%DemoLocation.Name%
Else
Endif

If>%DemoLocation.GameType%=Counter-Strike Source
Let>FTPFILE=CSS-%the_year%%the_month%%the_day%%Hour%%Minutes%%Seconds%-%DemoLocation.Name%
Else
Endif

//Creates Upload Information
WriteLn>%TEMP_DIR%%FTPFILE%.txt,result,Date: %the_day%/%the_month%/%the_year%%CRLF%Time: %Hour%:%Minutes%:%Seconds%%CRLF%Gamers Name: %DemoLocation.GamersName%%CRLF%Gamers SteamID: %DemoLocation.GamersSteamID%%CRLF%Server Name: %DemoLocation.ServerName%%CRLF%Reason For Demo: %DemoLocation.BanReason%%CRLF%Game Type: %DemoLocation.GameType%%CRLF%Uploaders Name: %DemoLocation.Name%%CRLF%Uploaders Email Address: %DemoLocation.Email%%CRLF%File Uploaded: %FTPFILE%.%Ext%%CRLF%Uploaders IP-Address: %IPAddress%%CRLF%Original File Name: %DemoLocation.FilePath%%CRLF%%CRLF%### Comments ### - %Version%%CRLF%%DemoLocation.Comments%
Wait>0.5
ReadFile>%TEMP_DIR%%FTPFILE%.txt,UploadDetails

//Sets FTP Info
Let>FTP_TIMEOUT=60
Let>FTP_STATUS=1
Let>FTP_PASSIVE=1

//Uploads Text File With Info
FTPPutFile>cybercitizen.XXXX.com.au,XXXXX,XXXXX,21,%TEMP_DIR%%FTPFILE%.txt,/public_html/hacker_demos/%FTPFILE%.txt,I
Let>UploadResult1=%FTP_RESULT%
DeleteFile>%TEMP_DIR%%FTPFILE%.txt
Wait>1

//Uploads Demo File
FTPPutFile>cybercitizen.XXXX.com.au,XXXXX,XXXXX,21,%DemoLocation.FilePath%,/public_html/hacker_demos/%FTPFILE%.%Ext%,I

//Sets Display Message For Uploader
Let>MSG_HEIGHT=500
Let>MSG_WIDTH=600
MessageModal>[FTP Result Information]%CRLF%%UploadResult1%%CRLF%%CRLF%[FTP Result Demo]%CRLF%%FTP_RESULT%%CRLF%%CRLF%[Information Uploaded]%CRLF%%UploadDetails%

//Increment Upload Count
Let>Count=Count+1
RegistryWriteKey>HKEY_CURRENT_USER,Software\EGN Ban Tool,Uploads,Count
RegistryWriteKey>HKEY_CURRENT_USER,Software\EGN Ban Tool,Name,%DemoLocation.Name%
RegistryWriteKey>HKEY_CURRENT_USER,Software\EGN Ban Tool,Email,%DemoLocation.Email%

Else
MessageModal>Daily Upload Limit Reached%CRLF%%CRLF%Please Try Again Tomorrow
Endif

Label>Exit
This is more of a historic post to show you how far MS has come over the years not to mention my scripting. If I was to re-write the script, I would include zip functions, so the user only had to select the demo file, then the program would save the text information, zip that file as well as the demo file, upload to the FTP site and maybe include email notification using Gmail or Push Notifications on iOS or Android.
FIREFIGHTER

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts