How to add pastebin to sensitivity calculator command

I’m lost on how to add a paste bin to a command I have already made. The command I have is used to calculate cm/360 in game currently setup like this $(eval Math.round((360/(0.022*$(1)*$(2))2.54)100)/100.0)cm/360, but this will only work for apex. I want to add a paste bin to this to support multiple games. In the command 0.022 is the m_yaw the game uses and is different for every game I have a small paste bin I’ve made already Sensitivity increments - Pastebin.com and would like to be able to specify a game as a variable for the increment I.E !calc cod 4 2000 would result in 360/(0.006642000)*2.54. sorry if my explanation is a little everywhere if needed I can try to clarify more and thank you for any help

Hey @mysticpurple!

If you had put a little bit more care to your post I would have answered you sooner, I’ve postponed reading you just because of how it looks, yet the solution to your problem is simple.

I even have a better solution than what you’re currently thinking of, what about a command that automatically set the correct value for your m_yaw variable depending on the game you’re playing, no need to specify it when you call the command? So basically you keep using the command like you already do, no need to change your habits, and less typing.

Okay, so, thanks to the $(twitch) variable we can fetch the current game you’re playing, next we can store all the values for your m_yaw variable into a JSON which keys are the games’ names.
So your command would now look like this:

$(eval game = '$(twitch $(channel) "{{game}}")'; mYaw = $(urlfetch json https://pastebin.com/raw/XXXXXXXX)[game]; `${Math.round((360 / (mYaw * $(1) * $(2)) * 2.54) * 100) / 100.0} cm/360`;)

And your Pastebin like so (the games must match the casing of how Twitch writes them):

{
  "Apex Legends": 0.022,
  "Call of Duty": 0.0066,
  "VALORANT": 0.06996
}

Please note that you have to replace XXXXXXXX in the commands by your paste ID.
Also, it’s not guaranteed that I got your calculation right due to the poor formatting of your post.

thank you for the response either way and sorry for the poor formatting on the original post. your command worked perfectly. Only change I did make was so user can select what game to calculate from so it can be used in discord as well through a separate command name. Thank you again

1 Like

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