Current IP

Posts your current IP on your navigation panel

  1. // ==UserScript==
  2. // @name Current IP
  3. // @namespace www.fuckboygamers.club
  4. // @version 1.1
  5. // @description Posts your current IP on your navigation panel
  6. // @author Mr Whiskey
  7. // @include *://hackforums.net/*
  8. // @require https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js
  9. // @grant GM_xmlhttpRequest
  10. // @connect *api.ipify.org*
  11. // @connect *bot.
  12. // ==/UserScript==
  13.  
  14. var worked = 0;
  15. var xhttp = new XMLHttpRequest();
  16. xhttp.onreadystatechange = function() {
  17. if (this.readyState == 4 && this.status == 200) {
  18. $(".links").text('Your IP: ' + this.response);
  19. }
  20. else
  21. worked++;
  22. if(worked > 2)
  23. worked = 0;
  24. };
  25. if(worked === 0)
  26. xhttp.open("GET", "//api.ipify.org", true);
  27. if(worked === 1)
  28. xhttp.open("GET", "//icanhazip.com", true);
  29. if(worked === 2)
  30. xhttp.open("GET", "//ipinfo.io/ip", true);
  31. xhttp.send();
  32. console.log(worked);