Jump to content
UBot Underground

Output of Javascript into a UBot Variable


Recommended Posts

Pretty sure this has been discussed before but the forum search functions blow and I couldn't find it.

 

So, I need to get the output of a javascript and check it in UBot. How do I get this into a UBot variable?

 

Here's the JS:

 

theDate = new Date();

var smallYear = theDate.getYear().toString().slice(2);

 

So I need to get the value of smallYear (a 2 digit year) into a UBot variable.

 

Thanks in advance!

 

Jonathan

Link to post
Share on other sites

Strike that, found the answer in this thread:

 

http://ubotstudio.com/forum/index.php?/topic/3703-how-do-i-get-output-from-javascript

 

Turns out you can simply stick a javascript into an $eval and it will evaluate into whatever UBot variable you want it to go to. Only trick is you have to end the JS code with just your final resulting variable. My final code looks like this:

 

theDate = new Date();
var smallYear = theDate.getYear().toString().slice(2);

smallYear;

 

Thanks!

 

Jonathan

  • Like 1
Link to post
Share on other sites

Strike that, found the answer in this thread:

 

http://ubotstudio.com/forum/index.php?/topic/3703-how-do-i-get-output-from-javascript

 

Turns out you can simply stick a javascript into an $eval and it will evaluate into whatever UBot variable you want it to go to. Only trick is you have to end the JS code with just your final resulting variable. My final code looks like this:

 

theDate = new Date();
var smallYear = theDate.getYear().toString().slice(2);

smallYear;

 

Thanks!

 

Jonathan

 

 

Nice one!

 

It was helpful, I was also looking for some like this..

 

:)

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