|
You last visited: Today at 05:58
Advertisement
[request] Nt leecher im channel
Discussion on [request] Nt leecher im channel within the Diablo 2 Programming forum part of the Diablo 2 category.
07/16/2010, 12:18
|
#1
|
elite*gold: 0
Join Date: May 2009
Posts: 564
Received Thanks: 40
|
[request] Nt leecher im channel
yoyo die damen
Das Problem^^: Beim leechbotten oder Cobaalen, geht ya die bot nach dem game in den channel und wenn dann der Leader offline geht..sendet er eine fehlermeldung und restartet (also so ist es bei mir) .. und das immer wieder bis der leader wieder online ist
Request: Es wäre nett wenn jemand, es irgendwie umscripten könnte, dass der leechbot einfach im channel wartet und weiterhin ``/f l `` eingibt, bist der leader wieder da ist und ins nxt game joint etc.
Code:
//Say('Locating the leader : '+leaderAccountName);
Say('/f l');
Delay(ChatFLDelay);
if(chat = controlData.get(controlData.controls.lobby.chat.textBox.channelText))
{
var errors = '';
var found_leader = false;
lines = chat.GetText();
for (var friend = 0; friend < lines.length; friend++)
{
if (lines[friend].lastIndexOf(': '+leaderAccountName+',') > -1)
{
game = '';
found_leader = true;
var regOfflineEnglish=/^\d\s?:\s?(\w*)\s?,\s?offline\s*$/gi;
var regGameNameEnglish=/^\s*(the\s)?(game\s)?([\w\s-]*\w)\s\(private\)\.\s*$/gi;
var regGameNameFrench=/^\s*(la\s)?(partie\s)?([\w\s-]*\w)\s\(priv[^\)]*\)\.\s*$/gi;
var regGameNameGerman=/^\s*(Destruction\s)?(in\s)?(das\s)?(Spiel\s)?\'([\w\s-]*\w)\'\s\(privat[^\)]*\)\.\s*$/gi;
if (lines[friend].match(regOfflineEnglish))
{
[B]errors += (errors == '' ? '' : ' ') + 'leader is [/B]offline';
// if (joinChannelInChat)
// Say('Leader is offline, delay 10 sec.');
// Delay(5000);
} //err starts here
if (lines[friend + 1].match(regGameNameEnglish) && lines[friend+1].substr(1, 1) != ':')
{
game = lines[friend + 1].replace(regGameNameEnglish, "$3");
thx im vorraus
|
|
|
07/16/2010, 15:28
|
#2
|
Administrator
elite*gold: 41624
Join Date: Jan 2010
Posts: 22,728
Received Thanks: 12,654
|
Quote:
Originally Posted by CmP-Kasu
yoyo die damen
Das Problem^^: Beim leechbotten oder Cobaalen, geht ya die bot nach dem game in den channel und wenn dann der Leader offline geht..sendet er eine fehlermeldung und restartet (also so ist es bei mir) .. und das immer wieder bis der leader wieder online ist
Request: Es wäre nett wenn jemand, es irgendwie umscripten könnte, dass der leechbot einfach im channel wartet und weiterhin ``/f l `` eingibt, bist der leader wieder da ist und ins nxt game joint etc.
Code:
//Say('Locating the leader : '+leaderAccountName);
Say('/f l');
Delay(ChatFLDelay);
if(chat = controlData.get(controlData.controls.lobby.chat.textBox.channelText))
{
var errors = '';
var found_leader = false;
lines = chat.GetText();
for (var friend = 0; friend < lines.length; friend++)
{
if (lines[friend].lastIndexOf(': '+leaderAccountName+',') > -1)
{
game = '';
found_leader = true;
var regOfflineEnglish=/^\d\s?:\s?(\w*)\s?,\s?offline\s*$/gi;
var regGameNameEnglish=/^\s*(the\s)?(game\s)?([\w\s-]*\w)\s\(private\)\.\s*$/gi;
var regGameNameFrench=/^\s*(la\s)?(partie\s)?([\w\s-]*\w)\s\(priv[^\)]*\)\.\s*$/gi;
var regGameNameGerman=/^\s*(Destruction\s)?(in\s)?(das\s)?(Spiel\s)?\'([\w\s-]*\w)\'\s\(privat[^\)]*\)\.\s*$/gi;
if (lines[friend].match(regOfflineEnglish))
{
[B]errors += (errors == '' ? '' : ' ') + 'leader is [/B]offline';
// if (joinChannelInChat)
// Say('Leader is offline, delay 10 sec.');
// Delay(5000);
} //err starts here
if (lines[friend + 1].match(regGameNameEnglish) && lines[friend+1].substr(1, 1) != ':')
{
game = lines[friend + 1].replace(regGameNameEnglish, "$3");
thx im vorraus
|
Die in Kurzform geschriebene if-Anweisung sieht syntaktisch nicht ganz sauber aus. Hast du da was geändert oder war das schon so?
Das hier wäre die syntaktisch richtige Variante:
Code:
errors += ((!errors)?[COLOR=DimGray] ""[/COLOR]:[COLOR=DimGray]" "[/COLOR]) + [COLOR=DimGray]"leader is offline"[/COLOR];
Lg
Muddy
|
|
|
07/16/2010, 15:50
|
#3
|
elite*gold: 0
Join Date: May 2009
Posts: 564
Received Thanks: 40
|
Quote:
Originally Posted by Muddy_Waters
Die in Kurzform geschriebene if-Anweisung sieht syntaktisch nicht ganz sauber aus. Hast du da was geändert oder war das schon so?
Das hier wäre die syntaktisch richtige Variante:
Code:
errors += ((!errors)?[COLOR=DimGray] ""[/COLOR]:[COLOR=DimGray]" "[/COLOR]) + [COLOR=DimGray]"leader is offline"[/COLOR];
Lg
Muddy
|
die war so
ich hab da nix geändert und werde es mal so ausprobieren
ich danke dir
€: ich werde das weiter geben, credits to u^^
|
|
|
07/16/2010, 19:25
|
#4
|
elite*gold: 0
Join Date: May 2009
Posts: 564
Received Thanks: 40
|
hat nicht geholfen
der restartted immernoch
|
|
|
07/16/2010, 21:26
|
#5
|
Administrator
elite*gold: 41624
Join Date: Jan 2010
Posts: 22,728
Received Thanks: 12,654
|
Quote:
Originally Posted by CmP-Kasu
hat nicht geholfen
der restartted immernoch
|
Mir fehlt so ein bisschen der Kontext... 
Aber wenn ich mir den Ausschnitt so anschaue, könnte der Fehler auch durch eine Indexüberschreitung des Arrays lines[] zustande kommen. Wenn man versucht über ein undefiniertes Element auf Attribute zuzugreifen, führt das zu einem Ausnahmefehler mit Neustart.
Um das zu umgehen müsstest du einfach mal in den kritischen if-Anweisungen eine entsprechende Abfrage einbauen, die überprüft, ob das Element am entsprechenden Index definiert ist.
Ein Beispiel:
Code:
[COLOR=Green]// Aus:[/COLOR]
[B][COLOR=Navy][I]if[/I][/COLOR][/B](lines[friend + [COLOR=Red]1[/COLOR]].match(regGameNameEnglish) && lines[friend+[COLOR=Red]1[/COLOR]].substr([COLOR=Red]1[/COLOR], [COLOR=Red]1[/COLOR]) != [COLOR=DimGray]':'[/COLOR])
[COLOR=Green]// wird:[/COLOR]
[COLOR=Navy][B][I]if[/I][/B][/COLOR](lines[friend + [COLOR=Red]1[/COLOR]] && lines[friend + 1].match(regGameNameEnglish) && lines[friend+[COLOR=Red]1[/COLOR]].substr([COLOR=Red]1[/COLOR], [COLOR=Red]1[/COLOR]) != [COLOR=DimGray]':'[/COLOR])
Durch die UND-Verknüpfung werden die nachfolgenden Ausdrücke ignoriert, wenn schon der erste Ausdruck false wird. Und der boolesche Wert von undefined entspricht false. Somit umgehst du eine eventuelle Zugriffsverletzung.
Alternativ könnte man aber auch schauen ob der Index die Größe des Arrays überschreitet. Würde aber zum selben Ergebnis führen, nur mit mehr Schreibaufwand.
Lg
Muddy
|
|
|
07/16/2010, 22:45
|
#6
|
elite*gold: 0
Join Date: May 2009
Posts: 564
Received Thanks: 40
|
Quote:
Originally Posted by Muddy_Waters
Mir fehlt so ein bisschen der Kontext... 
Aber wenn ich mir den Ausschnitt so anschaue, könnte der Fehler auch durch eine Indexüberschreitung des Arrays lines[] zustande kommen. Wenn man versucht über ein undefiniertes Element auf Attribute zuzugreifen, führt das zu einem Ausnahmefehler mit Neustart.
Um das zu umgehen müsstest du einfach mal in den kritischen if-Anweisungen eine entsprechende Abfrage einbauen, die überprüft, ob das Element am entsprechenden Index definiert ist.
Ein Beispiel:
Code:
[COLOR=Green]// Aus:[/COLOR]
[B][COLOR=Navy][I]if[/I][/COLOR][/B](lines[friend + [COLOR=Red]1[/COLOR]].match(regGameNameEnglish) && lines[friend+[COLOR=Red]1[/COLOR]].substr([COLOR=Red]1[/COLOR], [COLOR=Red]1[/COLOR]) != [COLOR=DimGray]':'[/COLOR])
[COLOR=Green]// wird:[/COLOR]
[COLOR=Navy][B][I]if[/I][/B][/COLOR](lines[friend + [COLOR=Red]1[/COLOR]] && lines[friend + 1].match(regGameNameEnglish) && lines[friend+[COLOR=Red]1[/COLOR]].substr([COLOR=Red]1[/COLOR], [COLOR=Red]1[/COLOR]) != [COLOR=DimGray]':'[/COLOR])
Durch die UND-Verknüpfung werden die nachfolgenden Ausdrücke ignoriert, wenn schon der erste Ausdruck false wird. Und der boolesche Wert von undefined entspricht false. Somit umgehst du eine eventuelle Zugriffsverletzung.
Alternativ könnte man aber auch schauen ob der Index die Größe des Arrays überschreitet. Würde aber zum selben Ergebnis führen, nur mit mehr Schreibaufwand.
Lg
Muddy
|
was heißt das für non scripter?^^
|
|
|
07/17/2010, 00:37
|
#7
|
Administrator
elite*gold: 41624
Join Date: Jan 2010
Posts: 22,728
Received Thanks: 12,654
|
Quote:
Originally Posted by CmP-Kasu
was heißt das für non scripter?^^
|
Also eigentlich war das schon die allgemein verständliche Version...
Prinzipiell musst du auch nur deine if-Blöcke analog zum Beispiel anpassen, das sollte so schwer nicht sein. Also, auf auf, selbst ist der Mann.
Lg
Muddy
|
|
|
07/17/2010, 20:52
|
#8
|
elite*gold: 0
Join Date: Jan 2009
Posts: 7,310
Received Thanks: 2,205
|
ich machs mal wieder einfach g*
mom..edit kommt.....
scheisse.. wie lang braucht dei leader bis er wieder im chanell steht?
meiner is so schnell das 10 sec. eigentlich reichen.
ach.. ich kopier einfach mal den oberen teil..du siehst an den zeiten was anders is und kannst selber rumprobieren.. eigentlich geht nur ums fl schreiben bis er checkt das sein boss nimmer da is.
funzt soweit ganz gut bei mir.. ich hab aber auch ned den zwang das ich schnellstens in ein game muss... weil... pw game is.
Code:
// DONT EDIT ANYTHING BELOW THIS
// D2NT Manager Command
const D2NT_MGR_LOADING = 1;
const D2NT_MGR_READY = 2;
const D2NT_MGR_LOGIN = 3;
const D2NT_MGR_CREATE_GAME = 4;
const D2NT_MGR_INGAME = 5;
const D2NT_MGR_RESTART = 6;
const D2NT_MGR_CHICKEN = 7;
const D2NT_MGR_PRINT_STATUS = 8;
const D2NT_MGR_PRINT_LOG = 9;
var lastGameMade = GetTickCount();
var lastGameStatus = 0;
var nextGameMake = 0;
var inGameAt = 0;
var chatActionsDone = false;
var lastGameFailed = false;
Include("libs/controlInfo.ntl");
//Include("joinBotSettings.ntl");
var controlData = new controlInfo();
var game = '';
function NTMain()
{
Delay(1000);
var _ingame = false;
controlData.clickDelay = clickDelay;
controlData.textDelay = textDelay;
controlData.clickDelayRandom = clickDelayRandom;
controlData.textDelayRandom = textDelayRandom;
while(1)
{
if(me.ingame)
{
if(!inGameAt)
inGameAt = GetTickCount();
if(!_ingame)
{
if(Load("NTBot/NTBotGame.ntj"))
{
_ingame = true;
sendEventToOOG(D2NT_MGR_INGAME, "In Game", 0);
lastGameStatus = 2; // in game successful
}
}
Delay(1000);
}
else
{
if(_ingame)
{
_ingame = false;
sendEventToOOG(D2NT_MGR_READY, "", 0);
}
locationAction(controlData.getLocation());
Delay(500);
}
}
}
function locationAction(location)
{
switch(location.id)
{
case 3: // Lobby Chat
if(!chatActionsDone)
{
chatActionsDone = true;
Delay(Random(waitInChatBeforeActionsMin, waitInChatBeforeActionsMax));
if(joinRandomChannel || joinChannelInChat != "")
{
Say("/join " + (joinRandomChannel ? getRandomString(Random(3,10)) : joinChannelInChat));
Delay(6000);
if(check == 1)
{
sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);
outputGameLength();
lastGameStatus = 0;
setNextGameMake();
sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
check = check + 1;
}
}
}
if(JoinFromChat){
game = '';
if (joinChannelInChat)
Delay (1200);
Say('Locating the leader : '+leaderAccountName);
Say('/f l');
Delay(9000);
if(chat = controlData.get(controlData.controls.lobby.chat.textBox.channelText))
{
var errors = '';
var found_leader = false;
lines = chat.GetText();
for (var friend = 0; friend < lines.length; friend++)
{
if (lines[friend].lastIndexOf(': '+leaderAccountName+',') > -1)
{
game = '';
found_leader = true;
var regOfflineEnglish=/^\d\s?:\s?(\w*)\s?,\s?offline\s*$/gi;
var regGameNameEnglish=/^\s*(the\s)?(game\s)?([\w\s-]*\w)\s\(private\)\.\s*$/gi;
var regGameNameFrench=/^\s*(la\s)?(partie\s)?([\w\s-]*\w)\s\(priv[^\)]*\)\.\s*$/gi;
var regGameNameGerman=/^\s*(Destruction\s)?(in\s)?(das\s)?(Spiel\s)?\'([\w\s-]*\w)\'\s\(privat[^\)]*\)\.\s*$/gi;
if (lines[friend].match(regOfflineEnglish))
{
errors += (errors == '' ? '' : ' ') + 'leader is offline';
if (joinChannelInChat)
Say('Leader is offline, delay 10 sec.');
Delay(15000);
}
if (lines[friend + 1].match(regGameNameEnglish) && lines[friend+1].substr(1, 1) != ':')
{
game = lines[friend + 1].replace(regGameNameEnglish, "$3");
}
if (!game && lines[friend + 1].match(regGameNameFrench) && lines[friend+1].substr(1, 1) != ':')
{
game = lines[friend + 1].replace(regGameNameFrench, "$3");
}
if (!game && lines[friend + 1].match(regGameNameGerman) && lines[friend+1].substr(1, 1) != ':')
{
game = lines[friend + 1].replace(regGameNameGerman, "$5");
}
if (!game && lines[friend + 1].match(regGameNameFrench) && lines[friend+1].substr(1, 1) != ':')
{
game = lines[friend + 1].replace(regGameNameFrench, "$3");
}
if (game != '' && game != samegame)
{
if (joinChannelInChat)
Delay(500);
Say('I found him! In the game ' + game);
controlData.click(controlData.controls.lobby.button.join);
Delay (200);
}
else
{
if(!errors)
{
errors = 'leader is not in game.';
}
}
}
}
if (!found_leader && joinChannelInChat)
{
if (errors)
Say('Errors : ' + errors);
else
Say('I couldn\'t find the leader in my friend list.');
Delay(1500);
}
}
else
{
if (joinChannelInChat)
Say('I can\'t read the chat!');
Delay(1500);
}
}
errors = '';
if(game != '')
samegame = game;
break;
case 1: // Lobby
|
|
|
07/18/2010, 14:59
|
#9
|
elite*gold: 0
Join Date: May 2009
Posts: 564
Received Thanks: 40
|
Quote:
Originally Posted by kal_el
ich machs mal wieder einfach g*
mom..edit kommt.....
scheisse.. wie lang braucht dei leader bis er wieder im chanell steht?
meiner is so schnell das 10 sec. eigentlich reichen.
ach.. ich kopier einfach mal den oberen teil..du siehst an den zeiten was anders is und kannst selber rumprobieren.. eigentlich geht nur ums fl schreiben bis er checkt das sein boss nimmer da is.
funzt soweit ganz gut bei mir.. ich hab aber auch ned den zwang das ich schnellstens in ein game muss... weil... pw game is.
Code:
// DONT EDIT ANYTHING BELOW THIS
// D2NT Manager Command
const D2NT_MGR_LOADING = 1;
const D2NT_MGR_READY = 2;
const D2NT_MGR_LOGIN = 3;
const D2NT_MGR_CREATE_GAME = 4;
const D2NT_MGR_INGAME = 5;
const D2NT_MGR_RESTART = 6;
const D2NT_MGR_CHICKEN = 7;
const D2NT_MGR_PRINT_STATUS = 8;
const D2NT_MGR_PRINT_LOG = 9;
var lastGameMade = GetTickCount();
var lastGameStatus = 0;
var nextGameMake = 0;
var inGameAt = 0;
var chatActionsDone = false;
var lastGameFailed = false;
Include("libs/controlInfo.ntl");
//Include("joinBotSettings.ntl");
var controlData = new controlInfo();
var game = '';
function NTMain()
{
Delay(1000);
var _ingame = false;
controlData.clickDelay = clickDelay;
controlData.textDelay = textDelay;
controlData.clickDelayRandom = clickDelayRandom;
controlData.textDelayRandom = textDelayRandom;
while(1)
{
if(me.ingame)
{
if(!inGameAt)
inGameAt = GetTickCount();
if(!_ingame)
{
if(Load("NTBot/NTBotGame.ntj"))
{
_ingame = true;
sendEventToOOG(D2NT_MGR_INGAME, "In Game", 0);
lastGameStatus = 2; // in game successful
}
}
Delay(1000);
}
else
{
if(_ingame)
{
_ingame = false;
sendEventToOOG(D2NT_MGR_READY, "", 0);
}
locationAction(controlData.getLocation());
Delay(500);
}
}
}
function locationAction(location)
{
switch(location.id)
{
case 3: // Lobby Chat
if(!chatActionsDone)
{
chatActionsDone = true;
Delay(Random(waitInChatBeforeActionsMin, waitInChatBeforeActionsMax));
if(joinRandomChannel || joinChannelInChat != "")
{
Say("/join " + (joinRandomChannel ? getRandomString(Random(3,10)) : joinChannelInChat));
Delay(6000);
if(check == 1)
{
sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);
outputGameLength();
lastGameStatus = 0;
setNextGameMake();
sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
check = check + 1;
}
}
}
if(JoinFromChat){
game = '';
if (joinChannelInChat)
Delay (1200);
Say('Locating the leader : '+leaderAccountName);
Say('/f l');
Delay(9000);
if(chat = controlData.get(controlData.controls.lobby.chat.textBox.channelText))
{
var errors = '';
var found_leader = false;
lines = chat.GetText();
for (var friend = 0; friend < lines.length; friend++)
{
if (lines[friend].lastIndexOf(': '+leaderAccountName+',') > -1)
{
game = '';
found_leader = true;
var regOfflineEnglish=/^\d\s?:\s?(\w*)\s?,\s?offline\s*$/gi;
var regGameNameEnglish=/^\s*(the\s)?(game\s)?([\w\s-]*\w)\s\(private\)\.\s*$/gi;
var regGameNameFrench=/^\s*(la\s)?(partie\s)?([\w\s-]*\w)\s\(priv[^\)]*\)\.\s*$/gi;
var regGameNameGerman=/^\s*(Destruction\s)?(in\s)?(das\s)?(Spiel\s)?\'([\w\s-]*\w)\'\s\(privat[^\)]*\)\.\s*$/gi;
if (lines[friend].match(regOfflineEnglish))
{
errors += (errors == '' ? '' : ' ') + 'leader is offline';
if (joinChannelInChat)
Say('Leader is offline, delay 10 sec.');
Delay(15000);
}
if (lines[friend + 1].match(regGameNameEnglish) && lines[friend+1].substr(1, 1) != ':')
{
game = lines[friend + 1].replace(regGameNameEnglish, "$3");
}
if (!game && lines[friend + 1].match(regGameNameFrench) && lines[friend+1].substr(1, 1) != ':')
{
game = lines[friend + 1].replace(regGameNameFrench, "$3");
}
if (!game && lines[friend + 1].match(regGameNameGerman) && lines[friend+1].substr(1, 1) != ':')
{
game = lines[friend + 1].replace(regGameNameGerman, "$5");
}
if (!game && lines[friend + 1].match(regGameNameFrench) && lines[friend+1].substr(1, 1) != ':')
{
game = lines[friend + 1].replace(regGameNameFrench, "$3");
}
if (game != '' && game != samegame)
{
if (joinChannelInChat)
Delay(500);
Say('I found him! In the game ' + game);
controlData.click(controlData.controls.lobby.button.join);
Delay (200);
}
else
{
if(!errors)
{
errors = 'leader is not in game.';
}
}
}
}
if (!found_leader && joinChannelInChat)
{
if (errors)
Say('Errors : ' + errors);
else
Say('I couldn\'t find the leader in my friend list.');
Delay(1500);
}
}
else
{
if (joinChannelInChat)
Say('I can\'t read the chat!');
Delay(1500);
}
}
errors = '';
if(game != '')
samegame = game;
break;
case 1: // Lobby
|
aber was ist wenn der leader mal 30min offline ist,wegen was auch immer
|
|
|
 |
Similar Threads
|
Leecher lol?
05/01/2010 - Off Topic - 4 Replies
Hey ich hab mal ne frage.Z.b sagen die guardians oder so immer leecher deswegen hab ich das mal nachgeschlagen.Aber was können leecher dafür das wir nix programmieren können O.o???Wir können die hacks ja nur downloaden wir können das halt net..
|
Leecher!!!
12/27/2009 - Conquer Online 2 - 9 Replies
its rly sucks to be a leecher !i had enough with being a leecher!
any advises!!!!?
|
Request for war channel translations/translator
03/20/2008 - Cabal Online - 1 Replies
Hey hi war channel is out for me now..
Anyway, is it possible to create a program or somesuch that will translate the messages to normal english? Or possibly a program that will take the message, translate it and show what is being said in a new window?
I'm willing to help in any way that I can, but I have no knowledge of programming, scripting or anything of the sort. I can however type out messages and try to see if it is somehow actually 'encrypted' or the symbols are just replaced...
|
All times are GMT +1. The time now is 05:59.
|
|