Jump to content
UBot Underground

$Replace Using $Spin Function


Recommended Posts

Hi,

 

Can someone take a look at this code for me? I have been trying to work this one out for a while!

set(#Text_To_Replace, "We\'ve done #LINK# everything we can to make 
UBot Studio as easy #LINK# to learn as possible. 
Now it\'s up to you. Make an investment into
yourself. Start small #LINK# with a few hours 
of training and watch as your potential 
unfolds.", "Global")
set(#Links, "\{<a href=\"http://link1.com\">link1</a>|<a href=\"http://link2.com\">link2</a>|<a href=\"http://link3.com\">link3</a>|<a href=\"http://link4.com\">link4</a>|<a href=\"http://link5.com\">link5</a>\}", "Global")
set(#Text_To_Replace, $replace(#Text_To_Replace, "#LINK#", $spin(#Links)), "Global")
load html("<p>
{#Text_To_Replace}
</p>")

What I am trying to do is replace the #LINK# placeholder with a link from the spintax links, my problem is that they are always the same links.

 

I want the links to be random or all different "NOT ALL THE SAME!". 

 

Is there a better way to accomplish this??

 

Cheers 

 

Carl

 

 

Link to post
Share on other sites

set(#Text_To_Replace, "We\'ve done #LINK# everything we can to make
UBot Studio as easy #LINK# to learn as possible.
Now it\'s up to you. Make an investment into
yourself. Start small #LINK# with a few hours
of training and watch as your potential
unfolds.", "Global")
set(#new text, "", "Global")
clear list(%text to replace)
add list to list(%text to replace, $list from text(#Text_To_Replace, " #LINK#"), "Don\'t Delete", "Global")
set(#Links, "\{<a href=\"http://link1.com\">link1</a>|<a href=\"http://link2.com\">link2</a>|<a href=\"http://link3.com\">link3</a>|<a href=\"http://link4.com\">link4</a>|<a href=\"http://link5.com\">link5</a>\}", "Global")
loop($list total(%text to replace)) {
set(#new text, "{#new text} {$next list item(%text to replace)} {$spin(#Links)} ", "Global")
}
load html("<p>
{#new text}
</p>")

Link to post
Share on other sites


set(#Text_To_Replace, "We\'ve done #LINK# everything we can to make
UBot Studio as easy #LINK# to learn as possible.
Now it\'s up to you. Make an investment into
yourself. Start small #LINK# with a few hours
of training and watch as your potential
unfolds.", "Global")
set(#new text, "", "Global")
clear list(%text to replace)
add list to list(%text to replace, $list from text(#Text_To_Replace, " #LINK#"), "Don\'t Delete", "Global")
set(#Links, "\{<a href=\"http://link1.com\">link1</a>|<a href=\"http://link2.com\">link2</a>|<a href=\"http://link3.com\">link3</a>|<a href=\"http://link4.com\">link4</a>|<a href=\"http://link5.com\">link5</a>\}", "Global")
loop($subtract($list total(%text to replace), 1)) {
set(#new text, "{#new text} {$next list item(%text to replace)} {$spin(#Links)} ", "Global")
}
set(#new text, "{#new text} {$next list item(%text to replace)}", "Global")
load html("<p>
{#new text}
</p>")

 

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