Jump to content
UBot Underground

Spun Content from File?


Recommended Posts

Hi,

I just bought Ubot this week so i'm pretty fresh. I've watched the videos but can't find any info on this.

 

I'm looking to insert spun content into fields from multiple .txt files that have spun formatted content already written...also having the script randomly select among the different files every time.

 

 

In essence I would like to have multiple text files such as...

 

spin-1.txt

 

{hey|what's up|hi|hello} {person|human|humanoid|alien}

 

spin-2.txt

 

{dogs|cats|goats|sheep|} {rule|eat|sleep|gamble}

 

spin-3.txt

 

{cars|trucks|planes|scooters} {crash|race|drive|swerve}

 

 

and have 1 of these files inserted into a text field randomly every time, so I can create unique content with different writing styles. My goal is to have about 10 different article "styles" or "structures" written in spun format in 10 different text files and have the script pull from 1 of these every time.

 

Is this possible? I can't find any info on this or how to go about doing it? Would someone mind giving me some pointers?

 

Thanx so much

 

:lol: :rolleyes:

Link to post
Share on other sites

I've attached a bot for you, with clearly labeled subs and nodes. Look it over and if you need any more help, let us know. Enjoy! :)

 

Hey Crazy,

thanx so much for that, that is truly awesome of you. I'm finding myself slightly baffled over it though. I appreciate your labels and everything...guess i'm still just really green to it all. Would you mind giving a crash course to what you did exactly? My brain is fried :blink:

Link to post
Share on other sites

Hey Crazy,

thanx so much for that, that is truly awesome of you. I'm finding myself slightly baffled over it though. I appreciate your labels and everything...guess i'm still just really green to it all. Would you mind giving a crash course to what you did exactly? My brain is fried :blink:

 

No problem at all, I had that same feeling when I first got started. Alright, here is a walkthrough of what you're looking at (I'll go in the same order of the file I uploaded)

 

http://img411.imageshack.us/img411/3671/runsub.jpg<- That is going to command uBot to run that sub. Without that node, the bot would never do anything, because a sub won't run unless it is "called upon" by a "run sub" command.

 

 

 

http://img697.imageshack.us/img697/8550/clearlist.jpg <- That simply clears the list to make sure we're not adding to a list that already has content in it. This is not very important in this particular example, but if you were to run this bot over and over again without that node (and without refreshing the bot, closing or reopening it), it would just continuously add the same content to the same list over and over and over again (leaving you with a giant list of repeated content).

 

 

 

http://img192.imageshack.us/img192/184/setparameter.jpg <- This sets a parameter for use later on in the bot.

 

You can set these to anything (words, numbers, etc.). In this case, we're setting it to a number for use later on (more on that below). That $rand means it is to randomly select a number from the following choices - 1,2 or 3

 

 

 

 

 

http://img691.imageshack.us/img691/3033/ifcommand.jpg <- Since this node has multiple parts, I'll go over them bit-by-bit.

 

The "if" part of it, means simply that. It is saying to uBot "If what comes before the then node is true, then do what is inside of the then node. If what comes before the then node is false, then skip over the then node all together and go on to commands that come after this IF node."

 

 

Evaluate Node -> That is what the "IF" command is checking. So, those "if" and "evaluate" nodes are saying the following to uBot "If the "#what file to select" parameter is = 1 then do what is inside of the "then" node. If it isn't, move onto the commands that come after this "if" node.

 

 

Then Node -> And finally, the then node. What the bot does in the event that the "if" part has returned as true.

 

First is "Add to List" <- That means that we'll be adding something to the %selected spun content list

 

After I select "add to list" inside of uBot, a window opens that asks what I want to add to that list.

 

You then right click on a "sub-parameter" (you'll understand if you just do what this says) go to "text constants" and then click on "$spin"

 

One last window will open up asking you to input some text in "spin" format.

 

You mentioned earlier that you have a bunch of .TXT files with text already in {spin|format}. So, one last time, you'll right click on "sub parameter", then click on "variable constants", then click on "read file"...then you simply select the file that has the spun content inside of it.

 

Now, there are 3 "if" nodes, and each one has an "evaluate" node. We set "#what file to select" to 1,2 or 3 (it is randomly selected).

 

That means that one of those 3 "if" nodes is going to return as true, and it will in turn select the file that you chose in that node (and each "if" node has a different file to open).

 

So, all in all, you end up having uBot randomly select from 3 different files, each containing it's own style of spun content.

 

You can do this for a limitless amount of files.

  • Like 3
Link to post
Share on other sites

dont forget u will actually have to have 3 open file fields and pre load the files before you run the bot...if u want to keep ur ui uncluttered just put them in a ui window

Link to post
Share on other sites

Thank you so much crazy...i really appreciate your concise help. I do understand it a lot better now. I do have a few questions that are still leaving me hanging if you don't mind.

 

1) i'm confused on the whole "list" concept. Why do i have to add content to a list if the content already exists in files?

 

2) For the list name ("%selected spun content file"), is this a new file i'm creating? Or is this one of my pre-existing .txt files that i select?

 

3) What do i put for the command when you say "what file to select" under "Set" and do i have to "set" every .txt file that i create?

 

4)How would i get this script to interact with a text field (where i'm normally doing "change chosen attributes-->value")?

 

5)Would you mind explaining how to preload the files that natureboy said i must do? I couldn't find any command on this.

 

Right now i have 3 .txt files setup so that birds=1, cats=2, dogs=3

 

Sorry for all the noob questions...i'm finally grasping the bigger picture, just the nuances that are tripping me up. Thanx again for all your help, i really didn't expect someone to go through the motions the way you have, that's extremely kind of you. :)

Link to post
Share on other sites

1) i'm confused on the whole "list" concept. Why do i have to add content to a list if the content already exists in files?

 

uBot can read files, but it can't "manipulate them" directly. (I guess that's the best way to put it). To do something other than just read a file, you have to add what's in that file to a "virtual list" in uBot. What I mean is, lets say you had a list of 10 URL's in a .txt file, but you wanted to visit the 5th one in the list first. You can do this by running the command "navigate to -> list item 5" because you've "translated" that .txt file into a language that makes sense to uBot. It doesn't create a new file, just makes "virtual" list that uBot stores in it's memory for later use.

 

2) For the list name ("%selected spun content file"), is this a new file i'm creating? Or is this one of my pre-existing .txt files that i select?

 

No, that isn't a new file you're creating. That is the name of the "virtual list" you'll be adding the content to from your .TXT file. So, you have a .TXT file that has your spun content. It's name is "spin file 1" (because you said you have 10). You would - "Add to list -> %spin file 1 -> documents\spun file\spin file 1.TXT" Now, you haven't created a whole new file on your computer or anything, you've just translated your .TXT file into a "virtual list" for use by uBot and uBot alone.

 

3) What do i put for the command when you say "what file to select" under "Set" and do i have to "set" every .txt file that i create?

 

"Set -> What File to Select" is setting the variable "#what file to select" to a random number from 1 to 3. Later on, during the "if" commands, it references that number to determine which file it will be adding to it's virtual list. So, let's say you have 3 .TXT file on your computer, all containing different writing styles of spun content and you wanted to randomly select 1 of those files to add to the list "%selected spun content"

 

It would look like this:

 

Clear List -> %selected spun content

 

Set "#What File to Select" to -> $Random Number from 1 to 3 (now #"what file to select" is set to either 1, 2 or 3.)

 

If "#What File to Select" = 1 Then

Add to List -> %Selected Spun Content -> $Spin Text -> Spin File 1

 

If "#What File to Select" = 2 Then

Add to List -> %Selected Spun Content -> $Spin Text -> Spin File 2

 

If "#What File to Select" = 3 Then

Add to List -> %Selected Spun Content -> $Spin Text -> Spin File 3

 

4)How would i get this script to interact with a text field (where i'm normally doing "change chosen attributes-->value")?

 

Alright, after everything above happens (in less than a second), the list "%Selected Spun Content" now contains the content from one of 3 files on your computer in a readable format (it has "spun" the text).

 

So you still use "change chosen attribute" (there is more to it than this, but we'll wait until you're at this road before you try to cross it).

 

5)Would you mind explaining how to preload the files that natureboy said i must do? I couldn't find any command on this.

 

I'm not sure what he meant by that. It loads the files "on the fly" so to speak because the location of each file is hardcoded into the program. Just follow the example I gave above.

 

Right now i have 3 .txt files setup so that birds=1, cats=2, dogs=3

 

I don't quite get that...

 

Sorry for all the noob questions...i'm finally grasping the bigger picture, just the nuances that are tripping me up. Thanx again for all your help, i really didn't expect someone to go through the motions the way you have, that's extremely kind of you. :)

 

Don't worry about it. We've all got to get started somewhere, and I'm happy to help :)

 

(and thanks for the compliment)

  • Like 1
Link to post
Share on other sites

aweeesome! i totally get it now.

 

So now that the list contains the spun content I chose my text field and did "change chosen attributes" with the Value field left blank. I then inserted the list but then it crashed my ubot lol. Is this how you were going to do it?

Link to post
Share on other sites

Alright, now that you're all set up and all that makes sense, now for the next part. Are you looking to insert a sentence, a paragraph or an entire article into the text field in question?

 

Reason I ask is because the method for doing the first two options and then the last are different.

 

If you're looking to insert a sentence/paragraph, you'd do it like this:

 

Choose by Attribute (choose where the spun text is going)

 

Change Chosen Attribute -> Next List Item from -> List %Selected Spun Content

 

Now, if you're looking to insert an entire article, it is a little trickier. Just go ahead and post exactly what you're looking to do (if you don't end up figuring it out on your own that is).

  • Like 1
Link to post
Share on other sites

Alright, now that you're all set up and all that makes sense, now for the next part. Are you looking to insert a sentence, a paragraph or an entire article into the text field in question?

 

Reason I ask is because the method for doing the first two options and then the last are different.

 

If you're looking to insert a sentence/paragraph, you'd do it like this:

 

Choose by Attribute (choose where the spun text is going)

 

Change Chosen Attribute -> Next List Item from -> List %Selected Spun Content

 

Now, if you're looking to insert an entire article, it is a little trickier. Just go ahead and post exactly what you're looking to do (if you don't end up figuring it out on your own that is).

 

generally each one is about 3-4 paragraphs long, so i guess they're "article" worthy

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...