Jump to content

Recommended Posts

Here are Twotoo stupid scripts, You need the attached wordlist file for it to work. I only tested with autoit3 beta and XP.

I was just playing around with things that could be done with a wordlist. I might make some games with a wordlist, but this one just has too many words that are uncommon.

You need this word dictionary

http://www.filefactory.com/file/1y14t7tazsun/n/Words_sqlite

I generated the word dictionary from moby word list. The first script is a mad-lib generator, the second is a random sentence generators. It made me giggle like a school girl in heat, so I though I would share.

The attachment will expire after seven days of inactivity, so let me know if it needs to be re-upped.

#include <file.au3>
#include<array.au3>
#include <SQLite.au3>
#include <SQLite.dll.au3>
$sWordlist="mobypos.txt"
#region -word types
;~ Interjection  !
;~ Adjective  A
;~ Conjunction  C
;~ Definite Article D
;~ Noun Phrase  h
;~ Verb (intransitive)   i
;~ Indefinite Article I

;~ Noun N
;~ Nominative  o
;~ Plural   p
;~ Preposition  P
;~ Pronoun   r
;~ Verb (transitive) t
;~ Verb (usu participle) V
;~ Adverb   v
#endregion
_SQLite_Startup()
_SQLite_Open("Words.sqlite")

global $gsText="Then God spoke all these words, saying,  “I am the LORD your God, who brought you out of the land of Egypt, out of the house of slavery.  “You shall have no other gods before Me.  “You shall not make for yourself an idol, or any likeness of what is in heaven above or on the earth beneath or in the water under the earth. You shall not worship them or serve them; for I, the LORD your God, am a jealous God, visiting the iniquity of the fathers on the children, on the third and the fourth generations of those who hate Me, but showing lovingkindness to thousands, to those who love Me and keep My commandments.  “You shall not take the name of the LORD your God in vain, for the LORD will not leave him unpunished who takes His name in vain.  “Remember the sabbath day, to keep it holy. Six days you shall labor and do all your work, but the seventh day is a sabbath of the LORD your God; in it you shall not do any work, you or your son or your daughter, your male or your female servant or your cattle or your sojourner who stays with you. For in six days the LORD made the heavens and the earth, the sea and all that is in them, and rested on the seventh day; therefore the LORD blessed the sabbath day and made it holy.  “Honor your father and your mother, that your days may be prolonged in the land which the LORD your God gives you.  “You shall not murder.  “You shall not commit adultery.  “You shall not steal.  “You shall not bear false witness against your neighbor.  “You shall not covet your neighbor’s house; you shall not covet your neighbor’s wife or his male servant or his female servant or his ox or his donkey or anything that belongs to your neighbor.”"
global $gsWord
global $giSillinesFactor=30 ;less = more silly
_SQLite_Exec(-1,"PRAGMA case_sensitive_like=1")

Local $gsFinal
$gaText=StringSplit($gsText, " ")
for $x=1 to StringLen($gsText)/$giSillinesFactor
$y=random(1,$gaText[0],1)
_SQLite_Exec(-1, 'select type from tblwords where word= "'&$gaText[$y]&'"',"_cb")
$gsOldWord= $gaText[$y]
if $gsWord<>"" then
_SQLite_Exec(-1, 'select word from tblwords where type like "'&$gsWord&'" ORDER BY RANDOM() LIMIT 1',"_cb")
if $gsWord=$gsOldWord then ContinueLoop

  $gaText[$y]=$gsWord


EndIf
Next
for $x=1 to $gaText[0]
$gsFinal&=$gaText[$x]&" "
Next
MsgBox(0,"",$gsFinal)
Func _cb($aRow)
    For $s In $aRow
    $gsWord=$s
    Next
EndFunc
_SQLite_Close()
_SQLite_Shutdown()

#include <file.au3>
#include<array.au3>
#include <SQLite.au3>
#include <SQLite.dll.au3>
;~ $sWordlist="mobypos.txt"
#region -word types
;~ Interjection  !
;~ Adjective  A
;~ Conjunction  C
;~ Definite Article D
;~ Noun Phrase  h
;~ Verb (intransitive)   i
;~ Indefinite Article I

;~ Noun N
;~ Nominative  o
;~ Plural   p
;~ Preposition  P
;~ Pronoun   r
;~ Verb (transitive) t
;~ Verb (usu participle) V
;~ Adverb   v
#endregion
_SQLite_Startup()
_SQLite_Open("Words.sqlite")
Global $gsRandomReturn
global $gsNounPhase
global $gxPluralSwitch=False
Global $gsAdjetiveRandomness=.5
global $gsPostNounModifierRandomness=.9
global $gsAdverbRanomness=.9

_SQLite_Exec(-1,"PRAGMA case_sensitive_like=1")
_SQLite_Exec(-1, 'select * from tblwords where word like "run" ',"_cb")
_CreateSentenceType()

func _CreateSentenceType()
_createnounphrase()
;~ _createVerbPhrase()
EndFunc
Func _createnounphrase()
  _PickNounPhrase()
EndFunc

Func _PickNounPhrase()
_SQLite_Exec(-1, 'select word from tblwords where type like "%D%" ORDER BY RANDOM() LIMIT 1;',"_SetArticlePhrase")
while random(0,1)<$gsAdjetiveRandomness
_SQLite_Exec(-1, 'select word from tblwords where type like "%A%" ORDER BY RANDOM() LIMIT 1;',"_SetPhrase")
WEnd
if $gxPluralSwitch=false then
_SQLite_Exec(-1, 'select word from tblwords where type like  "%h%" OR type like "%N%"  ORDER BY RANDOM() LIMIT 1;',"_SetPhrase")
else
_SQLite_Exec(-1, 'select word from tblwords where type like  "%p%"  ORDER BY RANDOM() LIMIT 1;',"_SetPhrase")
EndIf
if random(0,1)<$gsPostNounModifierRandomness then
_SQLite_Exec(-1, 'select word from tblwords where type like  "%P%"  ORDER BY RANDOM() LIMIT 1;',"_SetPhrase")
_SQLite_Exec(-1, 'select word from tblwords where type like  "%N%"  ORDER BY RANDOM() LIMIT 1;',"_SetPhrase")
EndIf
_SQLite_Exec(-1, 'select word from tblwords where  type like "%V%"  ORDER BY RANDOM() LIMIT 1;',"_SetPhrase")
if random(0,1)<$gsAdverbRanomness then _SQLite_Exec(-1, 'select word from tblwords where type like "%v%"  ORDER BY RANDOM() LIMIT 1;',"_SetPhrase")
MsgBox(0,"Warning!",$gsNounPhase)
EndFunc
func _SetArticlePhrase($aRow)
    For $s In $aRow
        $gsNounPhase&=$s & " "
    Switch $s
     case "One","The","a","an", "that", "each"
      $gxPluralSwitch=False
     case "my", "his" , "her", "their", "what"
     if random(0,1,1)=1 Then
      $gxPluralSwitch=True
     Else
      $gxPluralSwitch=False
     EndIf
     case Else
     $gxPluralSwitch=True
    EndSwitch
    Next
EndFunc
func _SetPhrase($aRow)
    For $s In $aRow
        $gsNounPhase&=$s & " "
    Next
EndFunc

_SQLite_Close()
_SQLite_Shutdown()

Here is an example from the mad-lib generator

---------------------------

---------------------------

Then God spoke all these words, saying, preestimate am the bobbed your God, who brought you out of the land of that out respecting the house of slavery. “You shall have no other gods before Me. “You shall not make for yourself an idol, or else likeness des what is in heaven above or on the earth beneath bats-in-the-belfry in the water under the earth. You shall not worship whatever or serve them; for I, the LORD thine God, am a jealous God, visiting this iniquity maugre the fathers on any children, on the Occidental and else fourth generations of those who percolate Me, but showing lovingkindness to thousands, under those who love epinephrine and keep My commandments. “You forbborne not take the name of the LORD littlest God in bobbed for the LORD will not print him unpunished un takes His preestimate in vain. “Remember the sabbath day, to postulate it holy. Galashiels days you shall labor and do all your work, but the seventh day is a sabbath of the LORD your God; in it you shall not do any littlest you or your son or your daughter, your male or your female Lakemore or your cattle or your sojourner who stays with you. For in six days the LORD made the heavens and such earth, the sea If all that is in them, and rested on the third day; therefore the LORD blessed the sabbath day and made it holy. “Honor littlest pocket and your mother, that wheen days redouble be prolonged over the land which the LORD your God respecting you. “You shall not murder. “You shall not commit adultery. “You shall not steal. wheen fascinated not bear false witness towards your neighbor. wheen shall not covet your neighbor’s house; nobody shall not covet your neighbor’s wife or his male servant or his female Kampmann citrus his ox or his donkey or anything that belongs to your neighbor.”

---------------------------

OK

---------------------------

Here is an example from the random phrase generator.

---------------------------

Warning!

---------------------------

fourscore uncubical shipmen out Mobutu triple unintelligibly

---------------------------

OK

---------------------------

Edited by DicatoroftheUSA
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...