Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //exp poster via dropbox
- //stole some code from hostile handler
- //Originally posted by Greatkhan
- //Edited by OFFR500 so that this would also post current level progress as %, and so that it would post to both the "Character only" file and the "All chars running" file.
- //I take no credit for the scripts used, I stole them from NTExp.ntj which says "Original Concept and Code by petrus2, Modified by Provalone" ^.^
- var MilTime;
- var EXPLogA = "logs/EXPLog/Dropbox/Public/" + me.name + "_XPLog.txt";
- var EXPLogB = "logs/EXPLog/Dropbox/Public/XPLog.txt";
- var TheTime = MyTime();
- var Today = new Date().toLocaleFormat("%d %b");
- var _TotalExp = [0, 0, 500, 1500, 3750, 7875, 14175, 22680, 32886, 44396, 57715, 72144, 90180, 112725, 140906, 176132, 220165, 275207, 344008, 430010, 537513, 671891, 839864, 1049830, 1312287, 1640359, 2050449, 2563061, 3203826, 3902260, 4663553, 5493363, 6397855, 7383752, 8458379, 9629723, 10906488, 12298162, 13815086, 15468534, 17270791, 19235252, 21376515, 23710491, 26254525, 29027522, 32050088, 35344686, 38935798, 42850109, 47116709, 51767302, 56836449, 62361819, 68384473, 74949165, 82104680, 89904191, 98405658, 107672256, 117772849, 128782495, 140783010, 153863570, 168121381, 183662396, 200602101, 219066380, 239192444, 261129853, 285041630, 311105466, 339515048, 370481492, 404234916, 441026148, 481128591, 524840254, 572485967, 624419793, 681027665, 742730244, 809986056, 883294891, 963201521, 1050299747, 1145236814, 1248718217, 1361512946, 1484459201, 1618470619, 1764543065, 1923762030, 2097310703, 2286478756, 2492671933, 2717422497, 2962400612, 3229426756, 3520485254, 0, 0];
- var _ExpToNextLvl = [0, 500, 1000, 2250, 4125, 6300, 8505, 10206, 11510, 13319, 14429, 18036, 22545, 28181, 35226, 44033, 55042, 68801, 86002, 107503, 134378, 167973, 209966, 262457, 328072, 410090, 512612, 640765, 698434, 761293, 829810, 904492, 985897, 1074627, 1171344, 1276765, 1391674, 1516924, 1653448, 1802257, 1964461, 2141263, 2333976, 2544034, 2772997, 3022566, 3294598, 3591112, 3914311, 4266600, 4650593, 5069147, 5525370, 6022654, 6564692, 7155515, 7799511, 8501467, 9266598, 10100593, 11009646, 12000515, 13080560, 14257811, 15541015, 16939705, 18464279, 20126064, 21937409, 23911777, 26063836, 28409582, 30966444, 33753424, 36791232, 40102443, 43711663, 47645713, 51933826, 56607872, 61702579, 67255812, 73308835, 79906630, 87098226, 94937067, 103481403, 112794729, 122946255, 134011418, 146072446, 159218965, 173548673, 189168053, 206193177, 224750564, 244978115, 267026144, 291058498, 0, 0];
- var _startLvl;
- var _startExp;
- var _startTime;
- var _prop = GetXPToLevel();
- function NTMain(){
- Include("libs/common/NTExp.ntl");
- Include("libs/common/NTCommon.ntl");
- NTC_IncludeLibs();
- NTC_IncludeConfig("NTBot/char_configs");
- NT_LoadConfig();
- NTSI_LoadNIPFiles("NTBot/item_configs");
- NTA_Initialize();
- XPLog = FileOpen(EXPLogA, 2);
- //XPLog.WriteLine(Today + " - " + TheTime + " - " + me.name + " (*" + me.account + ") Level " + me.GetStat(12) + " (Current Level Progress " + _prop + "): Stopping at: " + NTConfig_stopLevel);
- //XPLog.WriteLine(Today + " - " + TheTime + " - " + me.name + " (*" + me.account + ") level " + me.GetStat(12) + " (" + me.GetStat(13) + " exp)");
- XPLog.WriteLine(Today + " - " + TheTime + " - " + me.name + " (*" + me.account + ") level " + me.GetStat(12) + " (Current Level Progress " + _prop + ")");
- XPLog.Close(); Delay(Random(100,200));
- XPLog = FileOpen(EXPLogB, 2);
- //XPLog.WriteLine(Today + " - " + TheTime + " - " + me.name + " (*" + me.account + ") level " + me.GetStat(12) + " (Current Level Progress " + _prop + "): Stopping at: " + NTConfig_stopLevel);
- //XPLog.WriteLine(Today + " - " + TheTime + " - " + me.name + " (*" + me.account + ") level " + me.GetStat(12) + " (" + me.GetStat(13) + " exp)");
- XPLog.WriteLine(Today + " - " + TheTime + " - " + me.name + " (*" + me.account + ") Level " + me.GetStat(12) + " (Current Level Progress " + _prop + ")");
- XPLog.Close(); Delay(Random(100,200));
- Say("Posted Exp");
- NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
- }
- function NTE_InitializeStats() {
- _startLvl = me.GetStat(12);
- _startExp = me.GetStat(13);
- if (_startExp < 0 || _startLvl >= 86) { _startExp = (2147483648 + _startExp); }
- if (_startExp < 2147483648 && _startLvl >= 97) { _startExp = (2147483648 + _startExp); }
- _startTime = GetTickCount();
- //Print("Exp = " + _startExp);
- //Print("Level = " + _startLvl);
- }
- function GetXPToLevel()
- {
- var _endLvl = me.GetStat(12);
- var _lvlsGained = _endLvl - _startLvl;
- var _endExp = me.GetStat(13);
- if (_endExp < 0 || _endLvl >= 86) { _endExp = (2147483648 + _endExp); }
- if (_endExp < 2147483648 && _endLvl >= 97) { _endExp = (2147483648 + _endExp); }
- var _endLvlExp = _TotalExp[_endLvl];
- var _expGained = _endExp - _startExp;
- var _endTime = GetTickCount();
- if (_expGained <= 0) { _expGained = '0'; }
- // Calculate percent of Exp obtained toward next level
- // Remaining Exp / Exp needed to level
- var _progressPercent = parseInt(1000 * (_endExp - _endLvlExp) / _ExpToNextLvl[_endLvl],10) / 10;
- if(_progressPercent >= 0) { var _prop = _progressPercent + "%"; } else { var _prop = "0%"; };
- // Estimate number of runs remaining until next level based on Exp gained
- // Remaining Exp needed to level / Exp Gained
- if(_expGained > 0)
- { var _runsToLevel = (100 - _progressPercent) * _ExpToNextLvl[_endLvl] / (100 * _expGained);
- if(_runsToLevel > 10) {_runsToLevel = parseInt(_runsToLevel,10); } else { _runsToLevel = parseInt(100 * _runsToLevel,10) / 100; };
- _runsToLvl = addSeparatorsNF(_runsToLevel, ",", ".", ",")
- }
- else {if(_endLvl == 99) {var _runsToLvl = 'You have reached Level 99';} else {var _runsToLvl = 'NA'}}
- var GameIP = me.gameserverip.split(".")[3];
- if(!GameIP) { GameIP = "Single Player"; }
- var RunTime = parseInt(((_endTime - _startTime) / 60000),10) + "m " + (parseInt(((_endTime - _startTime) / 1000),10) - parseInt(((_endTime - _startTime) / 60000),10) * 60) + "s";
- if(_lvlsGained > 0) var DidGainLvl = COLOR_1 + "\n Levels Gained : " + COLOR_1 + _lvlsGained;
- else if(_lvlsGained < 1) var DidGainLvl = "";
- //----------------------------------
- //petrus2 edit starts here
- //----------------------------------
- var _timeToLvl = (_runsToLevel * (_endTime - _startTime)) ;
- if(_expGained > 0)
- { if (_timeToLvl >= 86400000)
- var TimeToLvl = parseInt((_timeToLvl / 86400000),10) + "d " + (parseInt((_timeToLvl / 3600000),10) - parseInt((_timeToLvl / 86400000),10) * 24) + "h " + (parseInt((_timeToLvl / 60000),10) - parseInt((_timeToLvl / 3600000),10) * 60) + "m " + (parseInt((_timeToLvl / 1000),10) - parseInt((_timeToLvl / 60000),10) * 60) + "s";
- else
- { if (_timeToLvl >= 3600000)
- var TimeToLvl = parseInt((_timeToLvl / 3600000),10) + "h " + (parseInt((_timeToLvl / 60000),10) - parseInt((_timeToLvl / 3600000),10) * 60) + "m " + (parseInt((_timeToLvl / 1000),10) - parseInt((_timeToLvl / 60000),10) * 60) + "s";
- else
- var TimeToLvl = parseInt((_timeToLvl / 60000),10) + "m " + (parseInt((_timeToLvl / 1000),10) - parseInt((_timeToLvl / 60000),10) * 60) + "s";
- }
- }
- else var TimeToLvl = "NA";
- //if(_runsToLvl == 'You have reached Level 99') var LvLProgXP = "";
- //else if(_runsToLvl != 'You have reached Level 99') var LvLProgXP = COLOR_4 + "\n Est. Time Until Next Level: " + COLOR_2 + TimeToLvl + COLOR_4 + "\n Est. Runs Until Next Level: " + COLOR_2 + _runsToLvl + COLOR_4 + "\n Current Level Progress: " + COLOR_2 + _prop + COLOR_4 + "\n Experience Gained: " + COLOR_2 + addSeparatorsNF(_expGained, ",", ".", ",");
- return _prop;
- }
- function MyTime()
- {
- var now = new Date();
- var HR = now.getHours();
- var MM = now.getMinutes();
- var SS = now.getSeconds();
- var MS = now.getMilliseconds();
- var DT;
- if(!MilTime) {
- if (HR < 12) { DT = "AM"; }
- if (HR > 11) { DT = "PM"; }
- if (HR > 12) { HR = HR - 12; }
- if (HR == 0) { HR = 12; }
- }
- if (HR < 10) { HR = "0" + HR; }
- if (MM < 10) { MM = "0" + MM; }
- if (SS < 10) { SS = "0" + SS; }
- if (MS < 10) { MS = "0" + MS; }
- return HR + ":" + MM + " " + DT;
- if(MilTime) TheTime = HR + ":" + MM + ":" + SS + "." + MS;
- else TheTime = HR + ":" + MM + ":" + SS + "." + MS + " " + DT;
- return TheTime;
- }
Advertisement
Add Comment
Please, Sign In to add comment