Board Logo
« voice and download »

Welcome Guest. Please Login or Register.
Nov 24th, 2017, 6:18pm


Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Please use the forums Search feature before asking.
Please post code using the code box described in Format Your Messages.
This will keep indentation, separate it better form the message and prevent gibberish.
If the code is too long for one post or additional files are needed, upload a ZIP archive to the Just BASIC Files Archive Site.

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: voice and download  (Read 623 times)
code
Member in Training
ImageImage


member is offline

Avatar




Homepage PM


Posts: 22
xx voice and download
« Thread started on: Sep 30th, 2016, 08:34am »


Hi,

Here some code which download a file from http://wwwswftools.org
Also the code run a file that can 'speak'...
Maybe i do some more coding so that there will be flash output..
Thats it for now...

Greetings,

Frederik Pot
Code:



    WindowWidth=480
    WindowHeight=400
    nomainwin

 button #scr, "  Download file...", [b1], UL, 5, 40
button #scr, "  Open html file...", [b2], UL, 300, 40

    open "Software studio..." for graphics_nsb as #scr

    print #scr, "fill darkred"
    print #scr, "flush"

 result = mkdir( "c:\prog")
    if result <> 0 then

    end if
result2 = mkdir( "c:\prog2")
    if result2 <> 0 then

end if


open "c:\prog\voice.vbs" for output as #tfsv

print #tfsv, "Dim message, sapi"

print #tfsv, "message="+chr$(34)+"Welcome to this software studio . Greeting from Frederik Pot country Holland or as some will say the netherlands    bye bye   "+chr$(34)+" "
print #tfsv, "Set sapi=CreateObject("+chr$(34)+"sapi.spvoice"+chr$(34)+")"
print #tfsv, "sapi.Speak message"
close #tfsv

RUN "wscript c:\prog\voice.vbs"
    wait

    [b1]




open "c:\prog\sound.vbs" for output as #tfs


print #tfs, "Dim oPlayer"
print #tfs, "Set oPlayer = CreateObject("+chr$(34)+"WMPlayer.OCX"+chr$(34)+")"


print #tfs, "oPlayer.URL = "+chr$(34)+"C:\windows\media\tada.wav"+chr$(34)+" "
print #tfs, "oPlayer.controls.play "
print #tfs, "While oPlayer.playState <> 1 "
 print #tfs, " WScript.Sleep 100"
print #tfs, "Wend"


print #tfs, "oPlayer.close"
close #tfs
open "c:\prog\fin.vbs" for output as #tfsvf

print #tfsvf, "Dim message, sapi"

print #tfsvf, "message="+chr$(34)+"Downloading finished    bye bye  for now "+chr$(34)+" "
print #tfsvf, "Set sapi=CreateObject("+chr$(34)+"sapi.spvoice"+chr$(34)+")"
print #tfsvf, "sapi.Speak message"
close #tfsvf





    open "c:\prog\teken.bat" for output as #tf


print #tf, "COLOR f0 "
print #tf, "TITLE Software studio... "


print #tf, "bitsadmin.exe /transfer 'programs...' http://www.swftools.org/swftools-0.9.0.exe  C:\prog2\swftools-0.9.0.exe "
print #tf, "wscript c:\prog\sound.vbs"

    print #tf,"TIMEOUT /T 4 "


print #tf, "wscript c:\prog\sound.vbs"
print #tf, "wscript c:\prog\fin.vbs"


    close #tf









dim info$(1, 1)


if fileExists("c:\prog2\", "swftools-0.9.0.exe") then

  RUN "c:\prog2\swftools-0.9.0.exe"

 else

    RUN "c:\prog\teken.bat"
end if



function fileExists(path$, filename$)
    files path$, filename$, info$()
    fileExists = val(info$(0, 0))
end function




wait
[b2]


open "c:\prog\link.html" for output as #tfsvft

print #tfsvft, "<a href=http://www.swftools.org/swfc/swfc.html >http://www.swftools.org/swfc/swfc.html</a>"

close #tfsvft
RUN "explorer.exe c:\prog\link.html"


wait
    [exit]
       close #scr



 
User IP Logged

code
Member in Training
ImageImage


member is offline

Avatar




Homepage PM


Posts: 22
xx Re: voice and download
« Reply #1 on: Nov 10th, 2016, 06:33am »

Hello...back again.

As i mentioned above(making a flash output) , i have now a program
developped wich compiles the file Tuto.as into tuto.swf (flash output) . And then run in a browser...
I haven't look that much on the code ... so there could be errors/bugs.

The program uses 2 .vbs files ,one for downloading the zip file on mtasc.org . The other file unzips it.

See for samples:
http://hossy.net/samples/



Code:
WindowWidth=480
    WindowHeight=400
    nomainwin

 button #scr, " First use this button for downloading the zip file...& Unzip...", [b1], UL, 5, 10
button #scr, "  Make html file... & Compile ...", [b2], UL, 240, 40

 texteditor #scr.te, 5, 60, 420, 300

    open "Software ..." for graphics_nsb as #scr

    print #scr, "fill darkred"
    print #scr, "flush"

 print #scr.te,"class Tuto {"
 print #scr.te," static var app : Tuto;"
 print #scr.te,"function Tuto() {"
 print #scr.te,"_root.createTextField( "+chr$(34)+"tf"+chr$(34)+",0,0,0,800,600);"
 print #scr.te,"_root.tf.text = "+chr$(34)+"Justbasic ...!"+chr$(34)+";"
 print #scr.te," _root.createEmptyMovieClip("+chr$(34)+"canvas_mc"+chr$(34)+",1);"
print #scr.te,"_root.canvas_mc.beginFill(0xFF0000, 100);"
print #scr.te,"_root.canvas_mc.moveTo(50,50);"
print #scr.te,"_root.canvas_mc.lineTo(100,50);"
print #scr.te,"_root.canvas_mc.lineTo(100,100);"
print #scr.te,"_root.canvas_mc.lineTo(50,100);"
print #scr.te,"_root.canvas_mc.lineTo(50,50);"
print #scr.te,"_root.canvas_mc.endFill();"
print #scr.te,"_root.canvas_mc._rotation=17;"
print #scr.te," }static function main(mc) {app = new Tuto();}}"


 result = mkdir( "c:\prog")
    if result <> 0 then

    end if
result2 = mkdir( "c:\prog2")
    if result2 <> 0 then

end if



    wait

    [b1]
    open "c:\prog2\download.vbs" for output as #f

    print #f, "dim xHttp: Set xHttp = createobject("+chr$(34)+"Microsoft.XMLHTTP"+chr$(34)+")"
print #f, "dim bStrm: Set bStrm = createobject("+chr$(34)+"Adodb.Stream"+chr$(34)+")"
print #f, "xHttp.Open "+chr$(34)+"GET"+chr$(34)+", "+chr$(34)+"http://www.mtasc.org/zip/mtasc-1.14.zip"+chr$(34)+", False"
print #f, "xHttp.Send"
print #f, " "
print #f, "with bStrm"
print #f, "    .type = 1 "
print #f, "    .open"
print #f, "    .write xHttp.responseBody"
print #f, "    .savetofile "+chr$(34)+"c:\prog2\zipper.zip"+chr$(34)+" , 2 "
print #f, "end with"

close #f
RUN "wscript c:\prog2\download.vbs"



open "c:\prog2\z.vbs" for output as #t

 print #t, "  "
 print #t, "strZipFile = "+chr$(34)+"c:\prog2\zipper.zip"+chr$(34)+""
 print #t, "outFolder = "+chr$(34)+"c:\prog2\"+chr$(34)+""
 print #t, " "

 print #t, "Set objShell = CreateObject( "+chr$(34)+"Shell.Application"+chr$(34)+" )"
 print #t, "Set objSource = objShell.NameSpace(strZipFile).Items()"
 print #t, "Set objTarget = objShell.NameSpace(outFolder)"
 print #t, "intOptions = 256"
 print #t, "objTarget.CopyHere objSource, intOptions"
 print #t, " "

 print #t, "Set WshShell = CreateObject("+chr$(34)+"Wscript.Shell"+chr$(34)+")"
 print #t, "tempfolder = WshShell.ExpandEnvironmentStrings("+chr$(34)+"%temp%"+chr$(34)+")"
 print #t, "Set fso = CreateObject("+chr$(34)+"Scripting.FileSystemObject"+chr$(34)+")"
close #t
RUN "wscript c:\prog2\z.vbs"

wait

[b2]



print #scr.te,"!contents? tex$"

open "c:\prog2\mtasc-1.14\Tuto.as" for output as #f
print #f, ""+tex$
close #f

open "c:\prog2\mtasc-1.14\result.html" for output as #t

 print #t, "<embed src=tuto.swf width=100% height=100% embed> "
close #t


RUN "C:\prog2\mtasc-1.14\mtasc.exe -swf C:\prog2\mtasc-1.14\tuto.swf -main -header 800:600:20 c:\prog2\mtasc-1.14\Tuto.as"

RUN "explorer.exe c:\prog2\mtasc-1.14\result.html"



wait



    [exit]
       close #scr





 
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls