Extending eval commands

I was just wondering on how to extend eval commands, I heard some stuff about pastebin and URLFetch but i’m not sure on how to go about it just wanted to know how to do it.
Please and Thanks <3

@Hiyazcool

The $(eval) variable can be used with the $(urlfetch) variable to manipulate data pulled from remote resources.

A common usage of $(eval) and $(urlfetch) is to output random words/quotes from a list stored on Pastebin.

Another common usage is to grab and execute JavaScript code that exceeds the 500-character limit for commands, like the queue commands that you can set up using this site:

https://vxrl.xyz/commands/queue

@RokettoJanpu can you explain how to grab and execute a simple command using this just some simple because I can’t figure it out. (just like a simple two answer query)

Please and thanks!

The pirate joke generator thread I linked (!8ball Pirate Joke Generator) should give a general example of how to set up a command that uses a $(urlfetch) inside an $(eval) variable.

@RokettoJanpu
Im sorry but I’m not getting how it works so I have my Nighbot command like so
$(eval a=$(urlfetch json https://pastebin.com/raw/eMNpzNvJ))
and this is my Pastebin
[a=$(user);a==‘Hiyaz’ ? “test1” : “test2”]

Note that Nightbot variables don’t work when you pull them from elsewhere. They must already be within the command response. You should set up the command response like so:

$(eval a=`$(user)`;$(urlfetch json https://pastebin.com/raw/eMNpzNvJ))

Then the code on the pastebin file should look like:

a==`Hiyaz`?`test1`:`test2`

Without any brackets on the sides.

@RokettoJanpu
Im sorry to bother you I just need your help fixing this code so here is the nightbot code
$(eval a="$(querystring)"; $(urlfetch json https://pastebin.com/raw/iUwnqPsb))
Pastebin
a?(a==“end”?"Hey guys why don’t you hit the follow button to see when I go live next time! And Join discord to take in part in potential giveaways, see my schedule for the week or just have some fun! its also good to see my announcements on upcoming events!! https://discord.gg/hUxr395 ":(a==“break”?“Don’t Worry I’ll be right back after this short break! In the meantime go get you some popcorn!”:(a==“info”?“You know you should use your Twitch Prime to subscribe and view me without ads or hit that follow button to know when I live! (or join our discord to see our secret section)”:“Enter a Query”))):“Enter a Query”)

If you find something please tell me I’m really trying ;-;

Command response:

$(eval a=decodeURIComponent(`$(querystring)`).toLowerCase();$(urlfetch json https://pastebin.com/raw/iUwnqPsb))

Edit the pastebin file to show this text:

!a?`Enter a Query`:(a==`end`?`Hey guys why don't you hit the follow button to see when I go live next time! And Join discord to take in part in potential giveaways, see my schedule for the week or just have some fun! its also good to see my announcements on upcoming events!! https://discord.gg/hUxr395`:(a==`break`?`Don't Worry I'll be right back after this short break! In the meantime go get you some popcorn!`:(a==`info`?`You know you should use your Twitch Prime to subscribe and view me without ads or hit that follow button to know when I live! (or join our discord to see our secret section)`:`Enter a valid Query`)));

@RokettoJanpu Im still getting this error
Right-hand side of ‘instanceof’ is not an object

The pastebin file is missing the “!” at the start.

@RokettoJanpu
I fixed it but its still doing it i cant find anything ;-;

Should work now.

$(eval a=decodeURIComponent(`$(querystring)`).toLowerCase();$(urlfetch json https://pastebin.com/raw/iUwnqPsb))

facepalm I accidentally deleted a letter in the nightbot command I’m sorry to have bother you Thank you so much <3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.