ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Silly Idea? A program that counts out loud

<< < (2/4) > >>

Conquer:
Lmfao I actually made it! Still fixing minor bugs

mouser:
gimme!  :up:

fowmow:
Ever since reviewing ronriel's nifty little r4r media player, I have found a renewed love for AutoIt.

Here is that application in only 5 lines of AutoIt.


--- Code: AutoIt ---$o = ObjCreate("SAPI.SpVoice")For $i = 1 To 10        $o.Speak($i)        Sleep(50)Next
Oh, I forgot to mention I am running AutoIt 3.2.4.9 and Windows XP SP2.

Cpilot:
In FBSL

--- Code: Text ---$apptype consoleDim %tDim oSpeak = CreateObject("SAPI.SpVoice")?"Close console to quit......."for t = 0 to 15CallMethod(oSpeak,".Speak %d",t)nextReleaseObject(oSpeak)Pause
Here it is with the dreaded Microsoft agent:

--- Code: Text ---'$apptype console dim %oAgent,%oCharacter,%objRequest,%t oAgent = CreateObject("Agent.Control.2")PutValue(oAgent,".Connected %b",TRUE)CallMethod(oAgent,".Characters.Load %s,%s","Merlin","merlin.acs")oCharacter = GetValue("%o",oAgent,".Characters.Character %s","Merlin") CallMethod(oCharacter,".Show")CallMethod(oCharacter,".MoveTo %d,%d",500,300) CallMethod(oCharacter,".Play %s","Confused")For t = 0 to 15CallMethod(oCharacter,".Speak %s",$t)nextCallMethod(oCharacter,".Hide")While GetValue("%d",oCharacter,"Visible")Sleep(250)WendReleaseObject(oCharacter)ReleaseObject(oAgent)

fowmow:
Following Cpilot's lead, the *dreaded* Microsoft Agent, Merlin.

I mixed it up a bit with the Sleep()'s so it didn't appear as if he paused too long.  And for the record... I believe I could have done this with events, but honestly, I was too lazy to read any more of the Agent SDK.  So it could definitely be done better.


--- Code: AutoIt ---$o = ObjCreate("Agent.Control.2")$o.Connected = "True"$o.Characters.Load("Merlin", @WindowsDir & "\msagent\chars\merlin.acs")$c = $o.Characters.Character("Merlin")$c.Show()$c.Play("Confused")Sleep(3000)$c.Speak("Count to 10?")Sleep(6000)For $i = 1 To 10        $c.Speak("" & $i & "")        Sleep(1500)NextSleep(2500)$c.Think("Well... that was weird.")Sleep(3000)$c.Hide()Sleep(2000)
All of the Sleep()'s are necessary to allow Merlin enough time to speak.  And for those of you who might go, "Hey, I thought these guys were supposed to speak?"

You need a Text-To-Speech engine and SAPI 4.0.

I sat there myself for a time thinking, "Why won't Merlin talk to me?"

*sigh*

Hey Cpilot, they have a code block for FBSL too (in case you didn't already know).

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version