prix

StealthCoin - transaction generation

Jul 24th, 2014
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Prix, 2014.07.24, 0.3
  2. //
  3. //Urgent exit: run Task Manager and kill process wscript.exe
  4. //
  5. //Settings
  6. var iterations = 1;
  7. var url = "http://192.168.0.41:5557";
  8. var user = "user1";
  9. var password = "passAx17sa2Rw";
  10. var fromAccount = "bittrex";
  11. var toAddress = "SDid48TEECEu7kaGFtH1i3jHEoJkiGXqPk";
  12. var amount = 5.3;
  13. var interval = 60000;
  14. var logFileName = "coin_sender.log";
  15. //The wallet .conf file example:
  16. //rpcuser=user1
  17. //rpcpassword=passAx17sa2Rw
  18. //rpcallowip=192.168.0.*
  19. //rpcport=5557
  20. //listen=1
  21. //daemon=1
  22. //server=1
  23. //
  24.  
  25. if(toAddress == "SDid48TEECEu7kaGFtH1i3jHEoJkiGXqPk") {
  26.     WScript.Echo("You should change the address to their");
  27.     WScript.Quit();
  28. }
  29.  
  30. var httpRequest = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
  31. var fso = new ActiveXObject("Scripting.FileSystemObject");
  32. var logFile = fso.CreateTextFile(logFileName, true);
  33.  
  34. var status;
  35. var done;
  36. do {
  37.     httpRequest.open("POST", url, false);
  38.     httpRequest.setCredentials(user,password, 0);
  39.     httpRequest.send("{\"id\":\"ce1cfe61-6142-4466-835c-3e6ca2a57d00\",\"method\":\"sendfrom\",\"params\":[\"" + fromAccount + "\",\"" + toAddress + "\"," + amount + "]}");
  40.     status =  httpRequest.Status;
  41.     done = false;
  42.     switch (status)
  43.     {
  44.     case 200:
  45.         done = true;
  46.         break;
  47.     case 401:
  48.             WScript.Echo("Error: requires user and password");
  49.             break;
  50.     default:
  51.         WScript.Echo("Error: unexpected request status - " + status);
  52.     }
  53.     logFile.writeLine(httpRequest.Status + ": " + httpRequest.StatusText);
  54.     logFile.write(httpRequest.GetAllResponseHeaders());
  55.     logFile.writeLine(httpRequest.ResponseText + "\r\n");
  56.     if(done) {
  57.         WScript.Sleep(interval);
  58.     }
  59. } while(done && --iterations > 0);
  60.  
  61. logFile.close();
Advertisement
Add Comment
Please, Sign In to add comment