Dialog, FileBrowse, FTP Upload

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

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

Dialog, FileBrowse, FTP Upload

Post by CyberCitizen » Mon Sep 26, 2005 12:46 pm

Hello Guy's,

I Need Alot Of Help With This Script, I Am Not Thinking Straight & Would Love Some Ideas.

What I Am Trying To Create Is A Program Which The User Can Upload Only ZIP Or RAR Files No More Than 8 Meg In Size To My FTP Site.

I Am Having Trouble With The FileBrowse & Assigning The Only Allow Files, Can't Make Sense Of The Help File.


Dialog>DemoLocation
Caption=Demo Uploader
Width=445
Height=250
Top=115
Left=16
Label=[UA] CyberCitizen Demo Upload Tool,8,8,true
Label=Demo Location (RAR Or Zip Files Only),8,32,true
Edit=FilePath,8,48,337,
Button=Locate File,352,48,75,25,3,
FileBrowse=Locate File,FilePath,,open
Default=Locate File
EndDialog>DemoLocation

Show>DemoLocation,r

MessageModal>%DemoLocation.FilePath%

Day>the_day
Month>the_month
Year>the_year
Sec>Seconds
Min>Minutes
Hour>Hour
Let>FTPFILE=Hacker%the_year%%the_month%%the_day% %Hour%%Minutes%%Seconds%

FTPPutFile>HIDDENHOST,HIDDENUSERNAME,HIDDENPASSWORD,21,%DemoLocation.FilePath%,/public_html/hacker_demos/FTPFILE,A

MessageModal>%FTP_RESULT%


I Have Used The Date & Time As A Way Of Making Sure That The Files Are Unique, However Would Perfer To Use The The FileName That The User Has Selected.

Any Help Would Be Great.
FIREFIGHTER

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

Post by CyberCitizen » Wed Sep 28, 2005 7:38 am

What No Help Or Suggestions???
FIREFIGHTER

User avatar
JRL
Automation Wizard
Posts: 3529
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Sep 28, 2005 5:12 pm

I'd like to help but I'm also stumped trying to set the masks for the filebrowse. I've never used it before but the help seemed straight forward enough. Except that using a mask for anything, even the sample from help for text files, doesn't work for me. I've inserted a mask into the dialog portion of your script. When I call this dialog and go to filebrowse I only see directories, however, the mask choices do show up under "Files of type".

I just looked and I'm still using version 7.4.004 on my home computer, It'll take me a while but I'll get the latest version installed and see if that makes any difference.

The green highlighted section is what I added to your originally posted script. I don't know what is wrong with it, only know that it isn't working.

Dialog>DemoLocation
Caption=Demo Uploader
Width=445
Height=250
Top=115
Left=16
Label=[UA] CyberCitizen Demo Upload Tool,8,8,true
Label=Demo Location (RAR Or Zip Files Only),8,32,true
Edit=FilePath,8,48,337,
Button=Locate File,352,48,75,25,3,
FileBrowse=Locate File,FilePath,
*.*|All Files|*.rar|Rar Files|*.zip|Zip Files,open
Default=Locate File
EndDialog>DemoLocation

Show>DemoLocation,r



Later,
Dick

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Wed Sep 28, 2005 5:24 pm

:oops: The help file example has the extensions and descriptions the wrong way round! So it should be like this:

Dialog>Dialog1
Caption=Dialog1
Width=445
Height=157
Top=114
Left=16
Label=Filename:,24,16,true
Edit=msEdit1,24,40,273,msEdit1
Button=Browse,304,40,75,25,0
Button=OK,24,80,75,25,10
Button=Cancel,120,80,75,25,2
FileBrowse=Browse,msEdit1,All Files|*.*|Rar Files|*.rar|Zip Files|*.zip,open
EndDialog>Dialog1

Show>Dialog1,r

Sorry! Will get it fixed in next release!
MJT Net Support
[email protected]

User avatar
JRL
Automation Wizard
Posts: 3529
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Sep 29, 2005 12:33 am

Thank you Support, works much better that way.

CyberCitizen,
Try this. No guarantee but it should get you close. I did not test any of the FTP stuff.

Dialog>DemoLocation
Caption=Demo Uploader
Width=445
Height=250
Top=115
Left=16
Label=[UA] CyberCitizen Demo Upload Tool,8,8,true
Label=Demo Location (RAR Or Zip Files Only),8,32,true
Edit=FilePath,8,48,337,
Button=Locate File,352,48,75,25,0
Button=OK,168,160,75,25,3
FileBrowse=Locate File,FilePath,Zip and Rar Files|*.zip;*.rar|Zip Files|*.zip|Rar Files|*.rar|All Files|*.*,open
Default=Locate File
EndDialog>DemoLocation

Show>DemoLocation

//MessageModal>%DemoLocation.FilePath%

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

Label>exit

Label>Process
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%Rerun
Let>r=0
MDL>%DemoLocation.FilePath%%CRLF%Is not a ZIP or RAR file or it is%CRLF%larger than 8 Meg
ResetDialogAction>DemoLocation
goto>ActionLoop

Label>Continue
CloseDialog>DemoLocation

Day>the_day
Month>the_month
Year>the_year
Sec>Seconds
Min>Minutes
Hour>Hour
Let>FTPFILE=Hacker%the_year%%the_month%%the_day% %Hour%%Minutes%%Seconds%

FTPPutFile>HIDDENHOST,HIDDENUSERNAME,HIDDENPASSWORD,21,%DemoLocation.FilePath%,/public_html/hacker_demos/FTPFILE,A

MessageModal>%FTP_RESULT%

Label>Exit

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

Post by CyberCitizen » Thu Sep 29, 2005 7:35 am

Hey Guy's,

Thanks For The Help.

I Was Playing Around With The Help File For Ages & Couldn't Work Out Why It Was Not Working.

Thanks For The Script Examples As Well. I Will Test Them When I Get Home & Post My Results.
FIREFIGHTER

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

Post by CyberCitizen » Thu Sep 29, 2005 10:29 pm

Thanks For Your Help Everyone.

I Now Have The Script Working, Had To Make A Few Adjustments. Will Post The Script As Soon As I Get A Chance.
FIREFIGHTER

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

Post by CyberCitizen » Tue Jan 09, 2007 11:54 am

Could Use Some More Help If Anyone Has Any Suggestions.

Since The New Version Of MS The Counting & Limiting Of The Uploads Has Stopped Working After 3 Uploads It Errors Instead Of Displaying An Error Message.

Anyone Have Any Ideas?

Code: Select all

Let>APP_TITLE=EGN Demo Upload Tool

//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>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<3>DemoLocation
   Caption=EGN Demo Uploader
   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 Name So That You Receive Recognition For The Demo,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 / IP Address,8,192,true
   Label=Server Location,256,192,true
   Label=Comments,8,232,true
   Label=Demo Location (RAR or ZIP Files Only - 8 Meg Maximum),8,296,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%Racist%CRLF%Team Killing
   ComboBox=GameType,192,168,169, %CRLF%Counter-Strike%CRLF%Counter-Strike Source
   Edit=ServerName,8,208,233,
   ComboBox=ServerLocation,256,208,105, %CRLF%VIC%CRLF%WA
   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
   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.ServerLocation%= ,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>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
HTTPRequest>http://checkip.dyndns.org/,,GET,,HTMLResponse
MidStr>%HTMLResponse%,77,15,IPAddress
StringReplace>%IPAddress%,/,,IPAddress
StringReplace>%IPAddress%,<IPAddress>%IPAddress%, ,,IPAddress
StringReplace>%IPAddress%,b,,IPAddress
StringReplace>%IPAddress%,o,,IPAddress
StringReplace>%IPAddress%,d,,IPAddress
StringReplace>%DemoLocation.Name%,|,,DemoLocation.Name
StringReplace>%DemoLocation.Name%,<DemoLocation>%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

Day>the_day
Month>the_month
Year>the_year
Sec>Seconds
Min>Minutes
Hour>Hour
Let>FTPFILE=%DemoLocation.Name%-%the_year%-%the_month%-%the_day%-%Hour%-%Minutes%-%Seconds%

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 / IP Address: %DemoLocation.ServerName% - %DemoLocation.ServerLocation%%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 ###%CRLF%%DemoLocation.Comments%

Let>FTP_STATUS=1
FTPPutFile>######,######,######,21,%DemoLocation.FilePath%,/public_html/hacker_demos/%FTPFILE%.%Ext%,I
Let>FTP_STATUS=0
FTPPutFile>######,######,######,21,%TEMP_DIR%%FTPFILE%.txt,/public_html/hacker_demos/%FTPFILE%.txt,I
DeleteFile>%TEMP_DIR%%FTPFILE%.txt
MessageModal>FTP Result: %FTP_RESULT%
//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
FIREFIGHTER

User avatar
JRL
Automation Wizard
Posts: 3529
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Jan 09, 2007 4:00 pm

This is tough to diagnose since we can't run it to test but I see a glaring problem on the first line of your "DemoLocation" dialog. It currently says:

If>CountDemoLocation

I don't know if this is your code or if the forum software rewrote your post but this can't be correct.

Later,
Dick

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

Post by CyberCitizen » Tue Jan 09, 2007 7:56 pm

Nah Thats The Script, It Worked Fine Under MS8, Yes You Really Need An FTP Location To Test The Script.
FIREFIGHTER

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

Post by CyberCitizen » Mon Jan 15, 2007 6:32 am

All Good, Corrupt Script File, Restored From Backup & All Good Now.

Having Another Issue With An Update, But Can't Post That One Cause Without The FTP Access This One Can Not Be Replicated. Will Have To Deal With Support.
FIREFIGHTER

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