Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Prix, 2014.07.24, 0.3
- //
- //Urgent exit: run Task Manager and kill process wscript.exe
- //
- //Settings
- var iterations = 1;
- var url = "http://192.168.0.41:5557";
- var user = "user1";
- var password = "passAx17sa2Rw";
- var fromAccount = "bittrex";
- var toAddress = "SDid48TEECEu7kaGFtH1i3jHEoJkiGXqPk";
- var amount = 5.3;
- var interval = 60000;
- var logFileName = "coin_sender.log";
- //The wallet .conf file example:
- //rpcuser=user1
- //rpcpassword=passAx17sa2Rw
- //rpcallowip=192.168.0.*
- //rpcport=5557
- //listen=1
- //daemon=1
- //server=1
- //
- if(toAddress == "SDid48TEECEu7kaGFtH1i3jHEoJkiGXqPk") {
- WScript.Echo("You should change the address to their");
- WScript.Quit();
- }
- var httpRequest = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
- var fso = new ActiveXObject("Scripting.FileSystemObject");
- var logFile = fso.CreateTextFile(logFileName, true);
- var status;
- var done;
- do {
- httpRequest.open("POST", url, false);
- httpRequest.setCredentials(user,password, 0);
- httpRequest.send("{\"id\":\"ce1cfe61-6142-4466-835c-3e6ca2a57d00\",\"method\":\"sendfrom\",\"params\":[\"" + fromAccount + "\",\"" + toAddress + "\"," + amount + "]}");
- status = httpRequest.Status;
- done = false;
- switch (status)
- {
- case 200:
- done = true;
- break;
- case 401:
- WScript.Echo("Error: requires user and password");
- break;
- default:
- WScript.Echo("Error: unexpected request status - " + status);
- }
- logFile.writeLine(httpRequest.Status + ": " + httpRequest.StatusText);
- logFile.write(httpRequest.GetAllResponseHeaders());
- logFile.writeLine(httpRequest.ResponseText + "\r\n");
- if(done) {
- WScript.Sleep(interval);
- }
- } while(done && --iterations > 0);
- logFile.close();
Advertisement
Add Comment
Please, Sign In to add comment