Jump to content
UBot Underground

How Do I Turn Spintax Into Txt Results?


Recommended Posts

Hi

 I am in need of a bot that could turn this:

{I|We} {like|love} {Ubot|UbotStudio}.

 

Into this:

I love UbotStudio.

 

First upload a txt file and it has spintax {|} text in each line.

Then save as.

Then click start button.

Then results will be in txt file to save.

 

I don't know where to start. Any suggestions?

Link to post
Share on other sites

I dont get what exactly you mean by the buttons but to get original spintax,to spinned ready to be saved as a file

 

set(#original,"\{I|We\} \{like|love\} \{Ubot|UbotStudio\}","Global")
save to file("something.txt",$spin(#original))

 

if this needed to be in a button,just drag this into a button

Link to post
Share on other sites

Ok I kind of got it. But do you know of a way to set how many can be saved into each txt file for the results?

Example results can be one line per txt file and the txt file has it's own name like 1.txt, 2.txt, 3.txt and so on.

Link to post
Share on other sites

yes so,find each combination,and save them to a file 1.txt 2.txt etc

 

set(#original,"\{We|they\} \{like|love\} \{Ubot|UbotStudio\}","Global")
set(#list count,0,"Global")
loop while($comparison(#list count,"<",1000)) {
    add item to list(%spin,$spin(#original),"Delete","Global")
    set(#list total a,$list total(%spin),"Global")
    if($comparison(#list total a,">",#list total b)) {
        then {
            set(#list total b,#list total a,"Global")
            save to file("C:\\Users\\somewhere//{#list total a}.txt",$list item(%spin,$subtract(#list total a,1)))

 set(#list count,0,"Global")
        }
        else {
            increment(#list count)
        }
    }
}

 

Woudn't be a commercial standard solution but if your just testing your spintax will work fine,and will work well with much bigger combinations,it justs adds each item,and will count to a thousand until it finds a new combination,and resets the counter to zero once it does,once it hits a thousand without finding a new combination it stops

Link to post
Share on other sites
  • 3 weeks later...

Hey Deliter,

 Ok, I'm trying to do this. Create a ui open file, select the file with the spintax, then a ui save to file, then select a choosen file, then a ui button that says start. Once I click start it will generate it. Can you do this?

Link to post
Share on other sites

ui open file("open file",#open)
set(#read file,$read file(#open),"Global")
set(#list count,0,"Global")
loop while($comparison(#list count,"<",1000)) {
    add item to list(%spin,"{$spin(#read file)}{$new line}","Delete","Global")
    set(#list total a,$list total(%spin),"Global")
    if($comparison(#list total a,">",#list total b)) {
        then {
            set(#list total b,#list total a,"Global")
            set(#list count,0,"Global")
        }
        else {
            increment(#list count)
        }
    }
}
save to file($replace regular expression(#open,"\\.","result."),%spin)

 

 

This has the UI open,and will generate a save file in the same folder as the opened file with result,and every spintax on a new line in the one file

so open spintax.txt

result= spintaxresult.txt saved in the same folder

  • Like 1
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...