You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts/nickCrashHelper.js
+9-6Lines changed: 9 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@
21
21
22
22
registerPlugin({
23
23
name: 'Nick Crash Helper',
24
-
version: '1.3',
24
+
version: '1.4',
25
25
description: 'This script removes the awful "1" after the nickname (This can happen when the bot crashes) - Sinusbot version 0.9.12.2-58b509d or higher needed.',
26
26
author: 'Luigi M. - xDefcon (xdefconhd@gmail.com)',
27
27
vars: {
@@ -45,6 +45,9 @@ registerPlugin({
45
45
46
46
47
47
function(sinusbot,config){
48
+
varengine=require('engine');
49
+
varbackend=require('backend');
50
+
48
51
if(typeofconfig.checkTime=='undefined'){
49
52
config.checkTime=60;
50
53
debug("Check Time set to 60 seconds.");
@@ -55,18 +58,18 @@ registerPlugin({
55
58
56
59
functiondebug(msg){
57
60
if(config.debugSwitch==1){
58
-
sinusbot.log("[DEBUG] "+msg);
61
+
engine.log("[DEBUG] "+msg);
59
62
}
60
63
}
61
64
62
65
setInterval(nickCheck,config.checkTime*1000);
63
66
64
67
functionnickCheck(){
65
-
varnick=sinusbot.getNick(),
66
-
realNick=sinusbot.getActualNick();
68
+
varnick=backend.getNick(),
69
+
realNick=backend.getBotClient().nick();
67
70
if(nick!=realNick){
68
-
sinusbot.setNick(nick);
69
-
debug("Nick changed from "+realNick+" to "+nick);
71
+
engine.setNick(nick);
72
+
debug("Nick changed from '"+realNick+"' to '"+nick+"'");
0 commit comments