Jump to content
UBot Underground

Using variables withing $spin


Recommended Posts

So I'm trying to to spin text with 3 different variables using $spin ex:

 

{My {#variable1} | Your {#variable2} | His {#variable3}}

 

It seems like having curly braces within curly braces is breaking the variable so it shows as text ex: your #variable or His #variable

 

would appreciate any help,

 

thanks

 

  

Link to post
Share on other sites

I have just tried this piece of code and it works ! No problem with curly braces :

set(#variable1, "car", "Global")
set(#variable2, "house", "Global")
set(#variable3, "tv", "Global")
set(#spinned_text, $spin("\{My {#variable1}|Your {#variable2}|His {#variable3}\}"), "Global")
ui stat monitor("Spinned text:", #spinned_text)

Link to post
Share on other sites

 

I have just tried this piece of code and it works ! No problem with curly braces :

set(#variable1, "car", "Global")
set(#variable2, "house", "Global")
set(#variable3, "tv", "Global")
set(#spinned_text, $spin("\{My {#variable1}|Your {#variable2}|His {#variable3}\}"), "Global")
ui stat monitor("Spinned text:", #spinned_text)

 

thanks for the reply but I've tried that and the results are not consistent if you mess around with $spin too much, ex: click to edit $spin and then hit ok after your done, it will sometimes break the variables inside, its wierd. Still looking for a solution

Link to post
Share on other sites

You have the option to drag'n'drop the variables in Node View (which will let UBS to take care of the escaping for the curly brackets where needed,
or else,

when in Code view, you have to make sure that the curlies from the $spin command ARE escaped, while the ones surrounding the variable names are not <<< as clearly depicted by danoctav's code...while obviously, yours is wrong.

Link to post
Share on other sites

You have the option to drag'n'drop the variables in Node View (which will let UBS to take care of the escaping for the curly brackets where needed,

or else,

when in Code view, you have to make sure that the curlies from the $spin command ARE escaped, while the ones surrounding the variable names are not <<< as clearly depicted by danoctav's code...while obviously, yours is wrong.

 

I have done it in node view (dragging them over) but like I said, it breaks the variables if I open to edit and save, as for code view, I dont have pro. Any other ideas?

 

thanks

Link to post
Share on other sites

Well I found a way to get it done, if I save the changes I made in $spin by pressing the ok button it will break the variables inside BUT, if I leave it open and instead press ok on the node inwhich the $spin node is located, it will save the changes and wont break the variables :)

  • Like 1
Link to post
Share on other sites
  • 2 weeks later...

Well I found a way to get it done, if I save the changes I made in $spin by pressing the ok button it will break the variables inside BUT, if I leave it open and instead press ok on the node inwhich the $spin node is located, it will save the changes and wont break the variables :)

I can confirm this is the way it is... something is screwy when editing the spin function itself when you hit ok, but as he says, if you first edit the "set" command (or wherever it is being used) and then edit the spin function, and click the ok on the "set" node it works. this is clearly a bug in ubot node view... if you will notice daveconor only has standard version and unable to edit at the code level so this becomes a pretty big issue when node view is not properly formatting the syntax.

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