I really only wrote this to upload scripts to the scripts section of my website xP
Honestly, I'm posting it because I'm looking for some help.
This is only my second dialog, and I'm still not so good with them.
When I hit the "send" button, it uploads the title fine, but only uploads one line of the script.
Anyone know how to help?
The FTP script was taken from [M]ike's Simple File Uploader (FTP); and is tweaked a bit.
The dialog is entirely mine.
alias script {
if !$exists(scriptsftp.ini) {
echo -a Cannot find FTP configuration settings (scriptsftp.ini); To set them, type /scriptftp
halt
}
if ($1- == $null) {
echo -a Specify which file to upload
halt
}
if !$exists($1-) {
echo -a Unable to find $1- $+ . Make sure it's in the same directory as this script. Otherwise, specify the directory.
halt
}
else {
if $exists(scripts.bat) {
remove scripts.bat
}
set %ftp_scriptlocation http://www. $+ $readini(scriptsftp.ini, n, ftp, host) $+ $readini(scriptsftp.ini, n, ftp, dir)
if (public_html isin %ftp_scriptlocation) {
set %ftp_uploadlocation $remove(%ftp_scriptlocation,public_html)
}
write scripts.bat open $readini(scriptsftp.ini, n, ftp, host)
write scripts.bat $readini(scriptsftp.ini, n, ftp, user)
write scripts.bat $readini(scriptsftp.ini, n, ftp, pass)
write scripts.bat cd $readini(scriptsftp.ini, n, ftp, dir)
write scripts.bat send $1-
write scripts.bat bye
/echo -a Uploading $nopath($1-) to %ftp_scriptlocation $+ ...
/echo -a Please wait.
run -n ftp -s $+ : $+ scripts.bat
.timer1 1 20 /echo -a Upload Complete.
.timer2 1 20 /echo -a File: %ftp_scriptlocation $+ $nopath($1-) $+
.timer3 1 20 unset %ftp_scriptlocation
}
}
alias scriptftp {
if $exists(scriptsftp.ini) {
/echo -a Your FTP settings have already been set.
}
else {
/writeini -n scriptsftp.ini ftp host $input(Enter Host:,eod,Script Uploader)
/writeini -n scriptsftp.ini ftp user $input(Enter FTP Username:,eod,Script Uploader)
/writeini -n scriptsftp.ini ftp pass $input(Enter FTP Password:,eod,Script Uploader)
/writeini -n scriptsftp.ini ftp dir $input(Directory To Upload To: (public_html may be required),eod,Script Uploader)
/echo -a FTP Settings Configured, you may now use /Scripts
}
}
alias viewscriptftp {
if !$exists(scriptsftp.ini) {
echo -a Cannot find FTP configuration settings. (scriptsftp.ini); To set them, type /scriptftp
halt
}
else {
window -laCdo -t15,30 @FTP-Settings -1 -1 250 125
aline @FTP-Settings Host: $readini(scriptsftp.ini, n, ftp, host)
aline @FTP-Settings Username: $readini(scriptsftp.ini, n, ftp, user)
aline @FTP-Settings Password: $readini(scriptsftp.ini, n, ftp, pass)
aline @FTP-Settings Directory: $readini(scriptsftp.ini, n, ftp, dir)
}
}
alias f7 {
/dialog -m script script
}
menu * {
.Script { /dialog -m Script Script }
}
dialog Script {
title "Script FTP Uploader"
size -1 -1 200 245
option dbu
text "[Script Title]", 2, 84 3 50 50
edit "", 3, 60 10 80 10, center
text "[Your Script]", 4, 84 22 50 50
edit "", 5, 10 29 180 200, multi return hsbar vsbar autohs autovsr
button "Send", 6, 84 230 37 12
}
on *:DIALOG:Script:sclick:6: { set %script <font color=red> $did(Script,3) <br> <font color=silver> $did(Script,5) <br> | write mirc.html %script | script mirc.html | timer 1 10 unset %script }