[D2NT Release] Game Announcements im Channel

12/05/2010 12:18 Muddy Waters#106
Quote:
Originally Posted by bot_for_fun_ View Post
bei mir klappt iwas nicht

Code:
/**
*    This file was modified by [Only registered and activated users can see links. Click Here To Register...]                
*    Check the programming section for updates and further scripts                            *
*    Last Update: 05/28/2010                            
*/

var gameMinLength        = 80000;    // time in milliseconds, minimum game length, 180 seconds default (1 game/3 minutes)
var unableToConnectRetry    = 5;        // time in minutes to retry connecting on connection fail (real value is +/- 1 min)
var realmDownRetry        = 5;        // time in minutes to retry connecting on a realm down (default is 300 minutes)
var disconnectedRetry        = 5;        // time in minutes to retry on a disconnection (usually ip ban related)
var cdkeyInUseRetry        = 5;        // time in minutes to retry on a cdkey in use error message (set to 0 to stop)
var connectingToBnetTimeout    = 20000;    // time in milliseconds to wait for a login to time out and click cancel and retry
var characterScreenTimeout    = 10000;    // time in milliseconds to wait for character screen to appear
var pleaseWaitTimeout        = 10000;    // time in milliseconds to wait for a please wait popup
var createGameThreshold        = 3500;        // time in milliseconds to wait between making games
var createGameThresholdRandom    = 5000;        // time in milliseconds to randomly add +/- to the game create time
var createGameTimeout        = 1500;    // time in milliseconds to register a failed to create game
var waitInLineTimeout        = 6000;    // time in milliseconds to wait in lines for a create game (60 second default)
var characterSelectDelay    = 1000;        // time in milliseconds to wait before selecting a character on the char screen
var loginDelay            = 1000;        // time in milliseconds to wait before submitting login information
var clickDelay            = 500;        // wait X milliseconds before next action after a click event
var textDelay            = 500;        // wait X milliseconds before next action after inserting text into a textbox
var clickDelayRandom        = 500;        // random amount of time to add to a click
var textDelayRandom        = 500;        // random amount of time to add to a text set
var gameDoesNotExistDelayMin    = 600000;     // how long to wait when a Game Does Not Exist occurs - minimum - default 10 minutes
var gameDoesNotExistDelayMax    = 900000;     // how long to wait when a Game Does Not Exist occurs - maximum - default 15 minutes
var gameDoesNotExistTimeout    = 30000;    // how long to wait for the dialog to disappear (default 30 seconds, don't change this)
[COLOR=Red]var joinChatAfterLogin        = true;        // join chat after login
var joinRandomChannel        = false;        // if this is true, will join a random channel, otherwise it will use the channel below..[/COLOR]
[COLOR=Red]var joinChannelInChat        = "OP Pornobaal";        // leave blank not to join a private channel
var channelLogin            = true;    // type ".login" once after joining the channel
var channelUsers             = new Array(); // dynamic array that holds channel users
//---------------------------------------------------------------------------------------------------------------------------------------------------------[/COLOR]
[COLOR=Red]// add any char/account here that is supposed to perform chat actions/game announcements or join a private channel
channelUsers.push("someAccountName");
channelUsers.push("someCharName");[/COLOR]    // [B]was soll da denn hin ?[/B] // [COLOR=Green]Lesen kannst du aber schon, oder? --> Dein(e) Char- oder Accountname(n)[/COLOR]
[COLOR=Red]//----------------------------------------------------------------------------------------------------------------------------------------------------------
//These key expressions are replaced that way: %game --> "gamename-",%counter --> number of the next game, %time --> time in seconds till game creation, %password --> game password
//Note that the announcement will start after the first run, so there won't be any anncouncement right after login
var gameAnnouncement        = "Join %game%counter// in %time seconds."; // leave blank not to post a channel announcement
var gameAnnouncementDelay    = 5000;        // wait X milliseconds before posting the announcement message (don't set this too low!)
var gameAnnouncementDelayRandom = 500; // random amount of time to add to a to the announcement delay
//----------------------------------------------------------------------------------------------------------------------------------------------------------[/COLOR]
var waitBeforeEnterChatMin    = 1000;        // min how long to wait before entering chat
var waitBeforeEnterChatMax    = 2000;        // max how long to wait before entering chat
var waitInChatBeforeActionsMin    = 2000;        // min how long to wait before joining channel
var waitInChatBeforeActionsMax    = 3000;        // max how long to wait before joining channel

// 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;
var    joinedChannel = false;
var justJoined = true;

Include("libs/controlInfo.ntl");

var controlData = new controlInfo();

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)
            {
                RunGC(); // run garbage collector between each game

                if(Load("NTBot/NTBotGame.ntj"))
                {
                    _ingame = true;

                    if(me.playtype > 0)
                        sendEventToOOG(D2NT_MGR_INGAME, "In Game [IP:" + me.gameserverip.split(".")[3] + "]", 0);
                    else
                        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(justJoined)
        {
            justJoined = false;
            if(isChannelUser(me.account, me.charname))
            {
                for(var i = 0; i < 3; i++)
                {
                    SetStatusText("ÿc2Chat actions enabled!");    
                    Delay(750);
                    SetStatusText("");    
                    Delay(750);
                }
            }
            else
            {
                for(var i = 0; i < 3; i++)
                {
                    SetStatusText("ÿc1Chat actions disabled!");    
                    Delay(750);
                    SetStatusText("");    
                    Delay(750);
                }
            }
        }
        if(!chatActionsDone && isChannelUser(me.account, me.charname))
        {
            chatActionsDone = true;
            Delay(Random(waitInChatBeforeActionsMin, waitInChatBeforeActionsMax));
            if(!joinedChannel && (joinRandomChannel || joinChannelInChat != ""))
            {
                var rndChannel = getRandomString(Random(3,10));
                SetStatusText("ÿc8Joining Channel " + (joinRandomChannel ? rndChannel : joinChannelInChat) );
                Delay(1000);
                Say("/join " + (joinRandomChannel ? rndChannel : joinChannelInChat));
                joinedChannel = true;
                Delay(1000);
                if(channelLogin)
                {
                    SetStatusText("ÿc8Channel Login...");
                    Say(".login");
                    Delay(1000);
                }
            }
        }
    case 1:    // Lobby
        if(location.id == 1 && joinChatAfterLogin)
        {
            Delay(Random(waitBeforeEnterChatMin, waitBeforeEnterChatMax));
            controlData.click(controlData.controls.lobby.button.enterChat);
            break;
        }
        if(GetTickCount() > nextGameMake)
        {
            var _control;

            lastGameFailed = false;

            switch(lastGameStatus)
            {
            case 0:
                _control = controlData.get(controlData.controls.lobby.button.create);
                if(_control && _control.pressed)
                {
                    controlData.click(controlData.controls.lobby.button.join);
                    Delay(500);
                }

                controlData.click(controlData.controls.lobby.button.create);
                nextGameMake = GetTickCount() + createGameTimeout; // set our timeout
                sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
                break;
            case 1: // game failed, rollover to reset timer
                inGameAt = GetTickCount();
                lastGameFailed = true;
                Delay(5000);
                
            case 2:
                outputGameLength();
                lastGameStatus = 0;
                setNextGameMake();
                if(lastGameFailed)
                {
                    SetStatusText("ÿc1Failed to join!");
                    sendEventToOOG(D2NT_MGR_PRINT_LOG, "ÿE00000Game " + ((getGameCounter(me.gamename, true)) ? ("(" + getGameCounter(me.gamename, true) + ")") : "") + " creation failed!", 0)
                    Delay(2500);
                }
                sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
                break;
            }
        }
        else
        {
            if(joinChannelInChat && gameAnnouncement && me.gamename && isChannelUser(me.account, me.charname))
            {
                var tempDelay = (gameAnnouncementDelay > 5000) ? gameAnnouncementDelay : 5000 + 
                            (gameAnnouncementDelayRandom > 500) ? Random(0, gameAnnouncementDelayRandom) : 500;
                var gameText = gameAnnouncement;
                gameText = gameText.replace("%password", me.gamepassword);
                gameText = gameText.replace("%game", getGameName(me.gamename));
                gameText = gameText.replace("%counter", getGameCounter(me.gamename, false));
                gameText = gameText.replace("%time", parseInt((nextGameMake - GetTickCount() - tempDelay)/1000+3.0));
                if(parseInt((nextGameMake - GetTickCount() - tempDelay)/1000+3.0) > 5)
                {    
                    Delay(tempDelay);
                    Say(gameText);
                }
            }
            timeoutDelay(nextGameMake-GetTickCount(), location, true);
        }
        break;

    case 2: // Waiting In Line
        if(GetTickCount()-lastGameMade > waitInLineTimeout)
            controlData.click(controlData.controls.lobby.inLine.button.cancel);
        break;

    case 4: // Create Game
        if(!controlData.get(controlData.controls.lobby.create.editBox.gameName))
        {
            controlData.click(controlData.controls.lobby.button.join);
            Delay (500);
            controlData.click(controlData.controls.lobby.button.create);
            Delay (500);
        }
        sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);

        locationTimeout(5000, location);

        lastGameMade = GetTickCount();
        lastGameStatus = 1; // pending creation
        break;

    case 5: // Join Game
        break;

    case 6: // Ladder
        break;

    case 7: // Channel List
        break;

    case 8: // Main Menu
        if(controlData.getCurrentRealmIndex() == me.gatewayid)
        {
            outputGameLength();
            controlData.click(controlData.gameTypes[me.playtype]);
        }
        else
            controlData.click(controlData.controls.mainMenu.button.gateway);
        break;

    case 9: // Login
        sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
        Delay(loginDelay);

        controlData.setText(controlData.controls.login.editBox.accountName, me.account);

        sendEventToOOG(D2NT_MGR_LOGIN, location.name, 0);

        locationTimeout(5000, location);
        break;

    case 10: // Login Error (this is a fatal error, so stop)
        sendEventToOOG(D2NT_MGR_RESTART, location.name, 10);
        Delay(3500);
        break;

    case 11: // Unable To Connect
        timeoutDelay(unableToConnectRetry*60*1000, location)
        controlData.click(controlData.controls.login.unableToConnect.button.ok);
        break;

    case 12: // Character Select
        var _time, _control;

        sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);

        for(_time = 0 ; _time < characterScreenTimeout ; _time += 500)
        {
            _control = controlData.get(controlData.controls.characterSelect.textBox.characterInfo[me.charloc]);
            if(_control && _control.GetText() != undefined)
                break;

            Delay(500);
        }

        if(_time < characterScreenTimeout)
        {
            Delay(characterSelectDelay);

            controlData.click(controlData.controls.characterSelect.textBox.characters[me.charloc], 0, 0, 1);
            controlData.click(controlData.controls.characterSelect.textBox.characterInfo[me.charloc], 0, 0, 1);

            // reset last game made, so it doesnt make a game immediately
            inGameAt = 0;
            setNextGameMake();
        }
        else
        {
            controlData.click(controlData.controls.characterSelect.button.exit);
            timeoutDelay(realmDownRetry*60*1000, location);
        }
        break;

    case 13: // Realm Down - Character Select screen
        controlData.click(controlData.controls.characterSelect.button.exit);
        timeoutDelay(realmDownRetry*60*1000, location);
        break;

    case 14: // Character Select - Disconnected
        timeoutDelay(disconnectedRetry*60*1000, location);
        controlData.click(controlData.controls.characterSelect.disconnected.button.ok);
        break;

    case 15: // New Character
        break;    

    case 16: // Character Select - Please Wait popup
        if(!locationTimeout(pleaseWaitTimeout, location))
            controlData.click(controlData.controls.characterSelect.pleaseWait.button.cancel);
        break;

    case 17: // Lobby - Lost Connection - just click okay, since we're toast anyway
        controlData.click(controlData.controls.lobby.lostConnection.button.ok);
        break;

    case 18: // D2 Splash
        controlData.click(controlData.controls.d2Splash.textBox.copyright);
        break;

    case 19: // Login - Cdkey In Use
        timeoutDelay(cdkeyInUseRetry*60*1000, location);
        controlData.click(controlData.controls.login.cdkeyInUse.button.ok);
        break;

    case 20: // Single Player - Select Difficulty
        controlData.click(controlData.singlePlayerDifficulties[me.diff]);
        break;

    case 21: // Main Menu - Connecting
        if(!locationTimeout(connectingToBnetTimeout, location))
            controlData.click(controlData.controls.mainMenu.connecting.button.cancel);
        break;

    case 22: // Login - Invalid Cdkey (classic or xpac)
        sendEventToOOG(D2NT_MGR_RESTART, location.name, 3600);
        Delay(3500);
        break;    

    case 23: // Character Select - Connecting
        if(!locationTimeout(characterScreenTimeout, location))
            controlData.click(controlData.controls.characterSelect.button.exit);
        break;

    case 24: // Server Down - not much to do but wait..
        break;

    case 25: // Lobby - Please Wait
        if(!locationTimeout(pleaseWaitTimeout, location))
            controlData.click(controlData.controls.lobby.pleaseWait.button.cancel);
        break;

    case 26: // Lobby - Game Name Exists
        sendEventToOOG(D2NT_MGR_PRINT_LOG, "ÿE00000Game already exists", 0);
        SetStatusText("ÿc1Game akready exists!");
        inGameAt = 0;
        lastGameStatus = 0;
        setNextGameMake();

        locationTimeout(15000, location);
        break;

    case 27: // Gateway Select
        controlData.clickRealmEntry(me.gatewayid);
        controlData.click(controlData.controls.gateway.button.ok);
        break;

    case 28: // Lobby - Game Does Not Exist
        inGameAt = Random(gameDoesNotExistDelayMin, gameDoesNotExistDelayMax);
        lastGameStatus = 0;
        setNextGameMake();

        locationTimeout(gameDoesNotExistTimeout, location);
        break;
    }
}

function sendEventToOOG(locationId, statusString, pendingTime)
{
    return SendCopyData("D2NT Manager", null, (locationId<<16)|pendingTime, statusString);
}

function setNextGameMake()
{
    lastGameMade = GetTickCount();
    nextGameMake = lastGameMade + createGameThreshold + Random(0-createGameThresholdRandom, createGameThresholdRandom) + inGameAt;
    inGameAt = 0;
    chatActionsDone = false;
}

function outputGameLength()
{
    if(inGameAt)
    {
        duration = GetTickCount() - inGameAt;

        inGameAt = (duration < gameMinLength ? gameMinLength - duration : 0);
    }
}

function locationTimeout(time, location)
{
    endtime = GetTickCount() + time;

    while(controlData.getLocation().id == location.id && endtime > GetTickCount())
    {
        sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name + " (" + parseInt((endtime-GetTickCount())/1000) + "s)", 0);
        Delay(500);
    }

    return (controlData.getLocation().id != location.id);
}

function timeoutDelay(time, location, showNextGameStatus)
{
    if(arguments.length < 3)
        showNextGameStatus = false;
    
    endtime = GetTickCount() + time;

    while(endtime > GetTickCount())
    {
        sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name + " (" + parseInt((endtime-GetTickCount())/1000) + "s)", 0);
        if(showNextGameStatus)
        {
            if(lastGameFailed && parseInt((endtime-GetTickCount())/1000) > 30)
            {
                if(parseInt((endtime-GetTickCount())/1000) % 30 == 0)
                {
                    SetStatusText("ÿc1Last game failed!");
                    Delay(5000);
                }
                if(me.gamename && getGameCounter(me.gamename, false))
                    SetStatusText("ÿc8Next game: " + getGameName(me.gamename) + getGameCounter(me.gamename, false) + " (" + parseInt((endtime-GetTickCount())/1000) + "s)");
                else
                    SetStatusText("ÿc8Game creation pending... (" + parseInt((endtime-GetTickCount())/1000) + "s)");
            }
            else if(parseInt((endtime-GetTickCount())/1000) >= 0)
            {
                if(me.gamename && getGameCounter(me.gamename, false))
                    SetStatusText("ÿc8Next game: " + getGameName(me.gamename) + getGameCounter(me.gamename, false) + " (" + parseInt((endtime-GetTickCount())/1000) + "s)");
                else
                    SetStatusText("ÿc8Game creation pending... (" + parseInt((endtime-GetTickCount())/1000) + "s)");
            }
            if(me.ingame)
                endtime = GetTickCount();
        }
        Delay(1000);
    }
    if(showNextGameStatus)
        SetStatusText("ÿc8Creating game...");
}

function getRandomString(_length)
{
    _retString = "";
    _charSet = "0123456789abcdefghijklmnopqrstuvwxyz";

    while(_length--)
    {
        _retString += _charSet.charAt(Random(0, _charSet.length-1));
        Delay(1);
    }

    return _retString;
}

function getGameName(lastGameString)
{
    if(!lastGameString)
        return "";
    else
        return (lastGameString.substr(0, lastGameString.lastIndexOf('-')+1));
}

function getGameCounter(lastGameString, simple)
{
    var myCount, countString;
    if(!lastGameString)
        return "-1";
    else
    {
        countString = lastGameString.slice(lastGameString.lastIndexOf('-')+1);
            
        switch(countString)
        {
            case "08":
                myCount = 9;
                break;
            case "09":
                myCount = 10;
                break;
            default:
                myCount = parseInt(countString) + 1;
                break;
        }
        if(!simple)
        {
            if(myCount <= 9)
                return ('0' + myCount);
        }
        return myCount;
    }
}

function isChannelUser(accountname, charname)
{
    for(var i = 0; i < channelUsers.length; i++)
    {
        if(accountname.toLowerCase() == channelUsers[i].toLowerCase() || charname.toLowerCase() == channelUsers[i].toLowerCase())
            return true;
    }
    return false;
}
bitte einmal durchgucken danke

wer mir hilft bekommt natürlich ein THX ;) :handsdown::handsdown:
Ich habe es dir mal markiert, an sich steht das auch im Startpost, im Kommentar in der Zeile darüber und man hätte es in ein paar dutzend geposteten Codebeispielen sehen können. ;)

Übrigens ist die Version hier veraltet, wobei ich nicht gedenke, diese nochmal als Einzelskript zu updaten. :o

Lg
Muddy
12/30/2010 17:42 P4r4n01d#107
keine ahnung ob der Tread noch aktuell ist, aber ich habe das Problem das der Bot keine Tps castet und auch nicht automatisch einer gruppe beitritt bzw. einladungen versendet. Irgendwer ne ahnung woran das liegt ?

///edit::

hat sich erledigt :))) Danke
12/30/2010 18:57 Muddy Waters#108
Quote:
Originally Posted by P4r4n01d View Post
keine ahnung ob der Tread noch aktuell ist, aber ich habe das Problem das der Bot keine Tps castet und auch nicht automatisch einer gruppe beitritt bzw. einladungen versendet. Irgendwer ne ahnung woran das liegt ?
Ist nicht mehr aktuell und ist hier auch inhaltlich fehl am Platz. ;)

Da die Antwort recht einfach ist, bin ich mal so nett:
Stell sicher, dass die Config Variable NTConfig_PublicMode mit true initialisiert wird.

Bitte weitere Rückfragen in das topic des von dir verwendeten Bots verlegen.

Lg
Muddy
01/31/2011 22:30 blackWorkx#109
Gibt es auch eine möglichkeit Baal Runs zu Joinen als Leecher / LeechFighter ohne die Leader auf der Frindlist zu haben.

Mit Frindlist finde ich keinen der mich adden will (24/7), und im channel OP pornobaal gibt es ja viele Bot Leader die Games posten, kann man also ohne Frindlist den games hinterher joinen? Also irgentwie über gettext what ever?
02/03/2011 18:32 Nuru der Stadtmasseur#110
Quote:
Originally Posted by blackWorkx View Post
Gibt es auch eine möglichkeit Baal Runs zu Joinen als Leecher / LeechFighter ohne die Leader auf der Frindlist zu haben.

Mit Frindlist finde ich keinen der mich adden will (24/7), und im channel OP pornobaal gibt es ja viele Bot Leader die Games posten, kann man also ohne Frindlist den games hinterher joinen? Also irgentwie über gettext what ever?
Versuch mal den GV Etal Bot, das ist - soweit ich weiß - der einzige, der ein friendless leeching Script mit an Board hat.
06/06/2011 20:28 Merch14#111
bruache hilfe meinen joint nichtden angegebenen channel =(
06/18/2011 18:32 venum-lk#112
Hi!
Ich habe das ganze hier in Bluebird verwendet, wo es tadellos funktioniert hat. Jetzt bin ich auf Sternenlooper umgestiegen und wollte es da auch wieder einbaun, aber er joint nur den Channel und sagt nix.

Die Variable joinChatAfterGame hat im am Anfang auch gefehlt, hab ich aber einfach dazugeschrieben.

Bis auf joinChatAfterGame ist es genau das Gleiche wie im Bluebird, wo es so funktioniert hat.

Code:
//########################################################################################################################################
//####################################CHAT SETTINGS#######################################################################################
//########################################################################################################################################
var joinChatAfterLogin		= true;		// join chat after login
var joinChatAfterGame		= true;		// join chat after game
var joinRandomChannel		= false;		// if this is true, will join a random channel, otherwise it will use the channel below..
var joinChannelInChat		= "OP baal-lk";		// leave blank not to join a private channel
var channelLogin		= false;	// type ".login" once after joining the channel
var channelUsers 		= new Array(); // dynamic array that holds channel users
//---------------------------------------------------------------------------------------------------------------------------------------------------------
// add any char/account here that is supposed to perform chat actions/game announcements or join a private channel
channelUsers.push("hammer-lk");
//----------------------------------------------------------------------------------------------------------------------------------------------------------
//These key expressions are replaced that way: %game --> "gamename-",%counter --> number of the next game, %time --> time in seconds till game creation, %password --> game password
//Note that the announcement will start after the first run, so there won't be any anncouncement right after login
var gameAnnouncement		= "Creating %game%counter in %time seconds."; // leave blank not to post a channel announcement
var gameAnnouncementDelay	= 5000;		// wait X milliseconds before posting the announcement message (don't set this too low!)
var gameAnnouncementDelayRandom = 500; // random amount of time to add to a to the announcement delay
//----------------------------------------------------------------------------------------------------------------------------------------------------------
var waitBeforeEnterChatMin	= 1000;		// min how long to wait before entering chat
var waitBeforeEnterChatMax	= 2000;		// max how long to wait before entering chat
var waitInChatBeforeActionsMin	= 2000;		// min how long to wait before joining channel
var waitInChatBeforeActionsMax	= 3000;		// max how long to wait before joining channel
Die üblichen Sachen wie User falsch geschrieben oder falscher Channel hab ich wegen Bluebird ausgeschlossen, hab s aber dann doch noch mal überprüft und nix gefunden ..

Danke für eure Hilfe
06/18/2011 19:41 Muddy Waters#113
Ich kann das Problem anhand der gegebene Informationen nicht nachvollziehen. :(

Sowohl Bluebird, als auch Sternenlooper sind beides Vanilla nahe Mods, es sollte dort genauso gut funktionieren, wie vorher auch. In deinem Auszug enddecke ich ebenfalls keine Fehler. Sicher, dass das alles korrekt eingefügt wurde?

LG
Muddy
06/19/2011 12:42 venum-lk#114
Du hast es uns ja zum Glück mit dem Einfügen sehr einfach gemacht .. da kann ja eigendlich nix schieflaufen :)

Ich hab s nochmal durchgelesen und ich bekomm beim Login in der Status Box nicht mehr des grüne "Chat Actions enabled" (ich glaub so hat s geheißen) angezeigt.

Hier noch n paar Daten
Sternenlooper v 3.8
Diablo II auf Englisch umgestellt (Hacken direct txt und data/local/use)
verwende 2 Keys

Hilft dir des?
06/19/2011 15:13 Muddy Waters#115
Das klingt für mich tatsächlich so, als würde der Entry Point gar nicht ausgeführt werden, denn ein "Chat actions enabled/disabled" müsste dort in jedem Fall auftauchen, wenn du den hier genannten Entry Point verwendest.

Stell nochmal genau sicher, welcher Entry Point im Profil eingestellt ist und ob dies auch der richtige ist. ;)

LG
Muddy
06/19/2011 15:22 venum-lk#116
NTBot.ntj, nicht? :)

Ne is so drinnen. Ich hab s auch in die Datei eingefügt. Hab sogar nochmal nachgeschaut, ob ich nicht ausversehen Bluebird und Sternenlooper verwechselt hab, aba da steht exakt des gleiche drinnen ...
06/22/2011 21:14 Morphsepp#117
Hallo,

wollte mal nachfragen wo ich die zeit verkürzen kann, wenn der bot das spiel verläst und anschließend ein neues game öffnen soll.

hab da dann eine zeitspanne von fast 200 s.

Weiterhin möchte ich gerne wissen, wie ich das chicken wg. blacksouls verhindern kann wenn der bot im thron angekommen ist ?
06/22/2011 23:20 Gorgonash#118
Quote:
Originally Posted by Morphsepp View Post
Hallo,

wollte mal nachfragen wo ich die zeit verkürzen kann, wenn der bot das spiel verläst und anschließend ein neues game öffnen soll.

hab da dann eine zeitspanne von fast 200 s.
Kannst du in der NTBot.ntj ändern, musst die MinGame Time und die Zeit zwischen den Spielen anpassen. Allerdings solltest du die Mingametime nicht unter ca 180sec bringen wegen den 20 Games die Stunde.

Quote:
Originally Posted by Morphsepp View Post
Weiterhin möchte ich gerne wissen, wie ich das chicken wg. blacksouls verhindern kann wenn der bot im thron angekommen ist ?
Chickt er immer wenn die Souls da sind, oder nur wenn er low life geht?





Jetzt noch nen Problem meinerseits:

Is mir jetzt nen paar mal aufgefallen wenn ich den Bot länger laufen lassen hab.
Er joint nach dem Game nicht mehr dem vorgegebenen Channel sondern ist in einem der Europe-DeuChannels drin. Dort schreibt er dann auch immer sein vorgegebenes Sprüchlein.
Konnte aber noch nicht beobachten wann das passiert, werd jetzt mal 1 oder 2 Stunden nen Auge drauf haben. Aber jetzt schonmal Ideen?

Also, es tritt nach nem ''Connection zum Router kannt nicht hergestellt werden und so' auf.
Wenns dann wieder weitergeht joint er dem Channel nicht mehr.
06/23/2011 08:47 Morphsepp#119
gibt es die Möglichkeit einen lev req fürs game zu hinterlegen?
08/18/2011 00:35 getgoodson#120
Auf die Gefahr hin, dass dieser thread nicht mehr ganz aktuell ist:
ich hab folgendes problem: der bot geht brav in den channel (chat functions enabled), sagt auch schön das game an, login tut er auch. aber im game macht er nix mehr.

er bleibt irgendwie bei seiner letzten aktion im channel hängen. d.h. beim ersten run steht dann ingame oben "login" und tut sich nix. wenn ich dann manuell rausgehe und warte bis er das zweite spiel erstellt, dann steht oben "creating game" (wie auf dem photo).
Kann mir jemand sagen, was ich falsch mache?

[Only registered and activated users can see links. Click Here To Register...]

Code:
/**
*    This file was modified by [Only registered and activated users can see links. Click Here To Register...]                
*    Check the programming section for updates and further scripts                            *
*    Last Update: 05/28/2010                            
*/

var gameMinLength        = 120000;    // time in milliseconds, minimum game length, 180 seconds default (1 game/3 minutes)
var unableToConnectRetry    = 5;        // time in minutes to retry connecting on connection fail (real value is +/- 1 min)
var realmDownRetry        = 300;        // time in minutes to retry connecting on a realm down (default is 300 minutes)
var disconnectedRetry        = 5;        // time in minutes to retry on a disconnection (usually ip ban related)
var cdkeyInUseRetry        = 5;        // time in minutes to retry on a cdkey in use error message (set to 0 to stop)
var connectingToBnetTimeout    = 20000;    // time in milliseconds to wait for a login to time out and click cancel and retry
var characterScreenTimeout    = 10000;    // time in milliseconds to wait for character screen to appear
var pleaseWaitTimeout        = 10000;    // time in milliseconds to wait for a please wait popup
var createGameThreshold        = 15000;        // time in milliseconds to wait between making games
var createGameThresholdRandom    = 5000;        // time in milliseconds to randomly add +/- to the game create time
var createGameTimeout        = 15000;    // time in milliseconds to register a failed to create game
var waitInLineTimeout        = 60000;    // time in milliseconds to wait in lines for a create game (60 second default)
var characterSelectDelay    = 1000;        // time in milliseconds to wait before selecting a character on the char screen
var loginDelay            = 1000;        // time in milliseconds to wait before submitting login information
var clickDelay            = 1000;        // wait X milliseconds before next action after a click event
var textDelay            = 1000;        // wait X milliseconds before next action after inserting text into a textbox
var clickDelayRandom        = 500;        // random amount of time to add to a click
var textDelayRandom        = 500;        // random amount of time to add to a text set
var gameDoesNotExistDelayMin    = 600000;    // how long to wait when a Game Does Not Exist occurs - minimum - default 10 minutes
var gameDoesNotExistDelayMax    = 900000;    // how long to wait when a Game Does Not Exist occurs - maximum - default 15 minutes
var gameDoesNotExistTimeout    = 30000;    // how long to wait for the dialog to disappear (default 30 seconds, don't change this)
var joinChatAfterLogin        = true;        // join chat after login
var joinRandomChannel        = false;        // if this is true, will join a random channel, otherwise it will use the channel below..
var joinChannelInChat        = "OP Pornobaal";        // leave blank not to join a private channel
var channelLogin            = true;    // type ".login" once after joining the channel
var channelUsers             = new Array(); // dynamic array that holds channel users
//---------------------------------------------------------------------------------------------------------------------------------------------------------
// add any char/account here that is supposed to perform chat actions/game announcements or join a private channel
channelUsers.push("getgoodson2");
channelUsers.push("Kneeling"); 
//----------------------------------------------------------------------------------------------------------------------------------------------------------
//These key expressions are replaced that way: %game --> "gamename-",%counter --> number of the next game, %time --> time in seconds till game creation, %password --> game password
//Note that the announcement will start after the first run, so there won't be any anncouncement right after login
var gameAnnouncement        = " Join %game%counter//%password in %time seconds."; // leave blank not to post a channel announcement
var gameAnnouncementDelay    = 5000;        // wait X milliseconds before posting the announcement message (don't set this too low!)
var gameAnnouncementDelayRandom = 500; // random amount of time to add to a to the announcement delay
//----------------------------------------------------------------------------------------------------------------------------------------------------------
var waitBeforeEnterChatMin    = 1000;        // min how long to wait before entering chat
var waitBeforeEnterChatMax    = 2000;        // max how long to wait before entering chat
var waitInChatBeforeActionsMin    = 2000;        // min how long to wait before joining channel
var waitInChatBeforeActionsMax    = 3000;        // max how long to wait before joining channel

// 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;
var    joinedChannel = false;
var justJoined = true;

Include("libs/controlInfo.ntl");

var controlData = new controlInfo();

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)
            {
                RunGC(); // run garbage collector between each game

                if(Load("NTBot/NTBotGame.ntj"))
                {
                    _ingame = true;

                    if(me.playtype > 0)
                        sendEventToOOG(D2NT_MGR_INGAME, "In Game [IP:" + me.gameserverip.split(".")[3] + "]", 0);
                    else
                        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(justJoined)
        {
            justJoined = false;
            if(isChannelUser(me.account, me.charname))
            {
                for(var i = 0; i < 3; i++)
                {
                    SetStatusText("ÿc2Chat actions enabled!");    
                    Delay(750);
                    SetStatusText("");    
                    Delay(750);
                }
            }
            else
            {
                for(var i = 0; i < 3; i++)
                {
                    SetStatusText("ÿc1Chat actions disabled!");    
                    Delay(750);
                    SetStatusText("");    
                    Delay(750);
                }
            }
        }
        if(!chatActionsDone && isChannelUser(me.account, me.charname))
        {
            chatActionsDone = true;
            Delay(Random(waitInChatBeforeActionsMin, waitInChatBeforeActionsMax));
            if(!joinedChannel && (joinRandomChannel || joinChannelInChat != ""))
            {
                var rndChannel = getRandomString(Random(3,10));
                SetStatusText("ÿc8Joining Channel " + (joinRandomChannel ? rndChannel : joinChannelInChat) );
                Delay(1000);
                Say("/join " + (joinRandomChannel ? rndChannel : joinChannelInChat));
                joinedChannel = true;
                Delay(1000);
                if(channelLogin)
                {
                    SetStatusText("ÿc8Channel Login...");
                    Say(".login");
                    Delay(1000);
                }
            }
        }
    case 1:    // Lobby
        if(location.id == 1 && joinChatAfterLogin)
        {
            Delay(Random(waitBeforeEnterChatMin, waitBeforeEnterChatMax));
            controlData.click(controlData.controls.lobby.button.enterChat);
            break;
        }
        if(GetTickCount() > nextGameMake)
        {
            var _control;

            lastGameFailed = false;

            switch(lastGameStatus)
            {
            case 0:
                _control = controlData.get(controlData.controls.lobby.button.create);
                if(_control && _control.pressed)
                {
                    controlData.click(controlData.controls.lobby.button.join);
                    Delay(500);
                }

                controlData.click(controlData.controls.lobby.button.create);
                nextGameMake = GetTickCount() + createGameTimeout; // set our timeout
                sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
                break;
            case 1: // game failed, rollover to reset timer
                inGameAt = GetTickCount();
                lastGameFailed = true;
                Delay(5000);
                
            case 2:
                outputGameLength();
                lastGameStatus = 0;
                setNextGameMake();
                if(lastGameFailed)
                {
                    SetStatusText("ÿc1Failed to join!");
                    sendEventToOOG(D2NT_MGR_PRINT_LOG, "ÿE00000Game " + ((getGameCounter(me.gamename, true)) ? ("(" + getGameCounter(me.gamename, true) + ")") : "") + " creation failed!", 0)
                    Delay(2500);
                }
                sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
                break;
            }
        }
        else
        {
            if(joinChannelInChat && gameAnnouncement && me.gamename && isChannelUser(me.account, me.charname))
            {
                var tempDelay = (gameAnnouncementDelay > 5000) ? gameAnnouncementDelay : 5000 + 
                            (gameAnnouncementDelayRandom > 500) ? Random(0, gameAnnouncementDelayRandom) : 500;
                var gameText = gameAnnouncement;
                gameText = gameText.replace("%password", me.gamepassword);
                gameText = gameText.replace("%game", getGameName(me.gamename));
                gameText = gameText.replace("%counter", getGameCounter(me.gamename, false));
                gameText = gameText.replace("%time", parseInt((nextGameMake - GetTickCount() - tempDelay)/1000+3.0));
                if(parseInt((nextGameMake - GetTickCount() - tempDelay)/1000+3.0) > 5)
                {    
                    Delay(tempDelay);
                    Say(gameText);
                }
            }
            timeoutDelay(nextGameMake-GetTickCount(), location, true);
        }
        break;

    case 2: // Waiting In Line
        if(GetTickCount()-lastGameMade > waitInLineTimeout)
            controlData.click(controlData.controls.lobby.inLine.button.cancel);
        break;

    case 4: // Create Game
        if(!controlData.get(controlData.controls.lobby.create.editBox.gameName))
        {
            controlData.click(controlData.controls.lobby.button.join);
            Delay (500);
            controlData.click(controlData.controls.lobby.button.create);
            Delay (500);
        }
        sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);

        locationTimeout(5000, location);

        lastGameMade = GetTickCount();
        lastGameStatus = 1; // pending creation
        break;

    case 5: // Join Game
        break;

    case 6: // Ladder
        break;

    case 7: // Channel List
        break;

    case 8: // Main Menu
        if(controlData.getCurrentRealmIndex() == me.gatewayid)
        {
            outputGameLength();
            controlData.click(controlData.gameTypes[me.playtype]);
        }
        else
            controlData.click(controlData.controls.mainMenu.button.gateway);
        break;

    case 9: // Login
        sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
        Delay(loginDelay);

        controlData.setText(controlData.controls.login.editBox.accountName, me.account);

        sendEventToOOG(D2NT_MGR_LOGIN, location.name, 0);

        locationTimeout(5000, location);
        break;

    case 10: // Login Error (this is a fatal error, so stop)
        sendEventToOOG(D2NT_MGR_RESTART, location.name, 10);
        Delay(3500);
        break;

    case 11: // Unable To Connect
        timeoutDelay(unableToConnectRetry*60*1000, location)
        controlData.click(controlData.controls.login.unableToConnect.button.ok);
        break;

    case 12: // Character Select
        var _time, _control;

        sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);

        for(_time = 0 ; _time < characterScreenTimeout ; _time += 500)
        {
            _control = controlData.get(controlData.controls.characterSelect.textBox.characterInfo[me.charloc]);
            if(_control && _control.GetText() != undefined)
                break;

            Delay(500);
        }

        if(_time < characterScreenTimeout)
        {
            Delay(characterSelectDelay);

            controlData.click(controlData.controls.characterSelect.textBox.characters[me.charloc], 0, 0, 1);
            controlData.click(controlData.controls.characterSelect.textBox.characterInfo[me.charloc], 0, 0, 1);

            // reset last game made, so it doesnt make a game immediately
            inGameAt = 0;
            setNextGameMake();
        }
        else
        {
            controlData.click(controlData.controls.characterSelect.button.exit);
            timeoutDelay(realmDownRetry*60*1000, location);
        }
        break;

    case 13: // Realm Down - Character Select screen
        controlData.click(controlData.controls.characterSelect.button.exit);
        timeoutDelay(realmDownRetry*60*1000, location);
        break;

    case 14: // Character Select - Disconnected
        timeoutDelay(disconnectedRetry*60*1000, location);
        controlData.click(controlData.controls.characterSelect.disconnected.button.ok);
        break;

    case 15: // New Character
        break;    

    case 16: // Character Select - Please Wait popup
        if(!locationTimeout(pleaseWaitTimeout, location))
            controlData.click(controlData.controls.characterSelect.pleaseWait.button.cancel);
        break;

    case 17: // Lobby - Lost Connection - just click okay, since we're toast anyway
        controlData.click(controlData.controls.lobby.lostConnection.button.ok);
        break;

    case 18: // D2 Splash
        controlData.click(controlData.controls.d2Splash.textBox.copyright);
        break;

    case 19: // Login - Cdkey In Use
        timeoutDelay(cdkeyInUseRetry*60*1000, location);
        controlData.click(controlData.controls.login.cdkeyInUse.button.ok);
        break;

    case 20: // Single Player - Select Difficulty
        controlData.click(controlData.singlePlayerDifficulties[me.diff]);
        break;

    case 21: // Main Menu - Connecting
        if(!locationTimeout(connectingToBnetTimeout, location))
            controlData.click(controlData.controls.mainMenu.connecting.button.cancel);
        break;

    case 22: // Login - Invalid Cdkey (classic or xpac)
        sendEventToOOG(D2NT_MGR_RESTART, location.name, 3600);
        Delay(3500);
        break;    

    case 23: // Character Select - Connecting
        if(!locationTimeout(characterScreenTimeout, location))
            controlData.click(controlData.controls.characterSelect.button.exit);
        break;

    case 24: // Server Down - not much to do but wait..
        break;

    case 25: // Lobby - Please Wait
        if(!locationTimeout(pleaseWaitTimeout, location))
            controlData.click(controlData.controls.lobby.pleaseWait.button.cancel);
        break;

    case 26: // Lobby - Game Name Exists
        sendEventToOOG(D2NT_MGR_PRINT_LOG, "ÿE00000Game already exists", 0);
        SetStatusText("ÿc1Game akready exists!");
        inGameAt = 0;
        lastGameStatus = 0;
        setNextGameMake();

        locationTimeout(15000, location);
        break;

    case 27: // Gateway Select
        controlData.clickRealmEntry(me.gatewayid);
        controlData.click(controlData.controls.gateway.button.ok);
        break;

    case 28: // Lobby - Game Does Not Exist
        inGameAt = Random(gameDoesNotExistDelayMin, gameDoesNotExistDelayMax);
        lastGameStatus = 0;
        setNextGameMake();

        locationTimeout(gameDoesNotExistTimeout, location);
        break;
    }
}

function sendEventToOOG(locationId, statusString, pendingTime)
{
    return SendCopyData("D2NT Manager", null, (locationId<<16)|pendingTime, statusString);
}

function setNextGameMake()
{
    lastGameMade = GetTickCount();
    nextGameMake = lastGameMade + createGameThreshold + Random(0-createGameThresholdRandom, createGameThresholdRandom) + inGameAt;
    inGameAt = 0;
    chatActionsDone = false;
}

function outputGameLength()
{
    if(inGameAt)
    {
        duration = GetTickCount() - inGameAt;

        inGameAt = (duration < gameMinLength ? gameMinLength - duration : 0);
    }
}

function locationTimeout(time, location)
{
    endtime = GetTickCount() + time;

    while(controlData.getLocation().id == location.id && endtime > GetTickCount())
    {
        sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name + " (" + parseInt((endtime-GetTickCount())/1000) + "s)", 0);
        Delay(500);
    }

    return (controlData.getLocation().id != location.id);
}

function timeoutDelay(time, location, showNextGameStatus)
{
    if(arguments.length < 3)
        showNextGameStatus = false;
    
    endtime = GetTickCount() + time;

    while(endtime > GetTickCount())
    {
        sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name + " (" + parseInt((endtime-GetTickCount())/1000) + "s)", 0);
        if(showNextGameStatus)
        {
            if(lastGameFailed && parseInt((endtime-GetTickCount())/1000) > 30)
            {
                if(parseInt((endtime-GetTickCount())/1000) % 30 == 0)
                {
                    SetStatusText("ÿc1Last game failed!");
                    Delay(5000);
                }
                if(me.gamename && getGameCounter(me.gamename, false))
                    SetStatusText("ÿc8Next game: " + getGameName(me.gamename) + getGameCounter(me.gamename, false) + " (" + parseInt((endtime-GetTickCount())/1000) + "s)");
                else
                    SetStatusText("ÿc8Game creation pending... (" + parseInt((endtime-GetTickCount())/1000) + "s)");
            }
            else if(parseInt((endtime-GetTickCount())/1000) >= 0)
            {
                if(me.gamename && getGameCounter(me.gamename, false))
                    SetStatusText("ÿc8Next game: " + getGameName(me.gamename) + getGameCounter(me.gamename, false) + " (" + parseInt((endtime-GetTickCount())/1000) + "s)");
                else
                    SetStatusText("ÿc8Game creation pending... (" + parseInt((endtime-GetTickCount())/1000) + "s)");
            }
            if(me.ingame)
                endtime = GetTickCount();
        }
        Delay(1000);
    }
    if(showNextGameStatus)
        SetStatusText("ÿc8Creating game...");
}

function getRandomString(_length)
{
    _retString = "";
    _charSet = "0123456789abcdefghijklmnopqrstuvwxyz";

    while(_length--)
    {
        _retString += _charSet.charAt(Random(0, _charSet.length-1));
        Delay(1);
    }

    return _retString;
}

function getGameName(lastGameString)
{
    if(!lastGameString)
        return "";
    else
        return (lastGameString.substr(0, lastGameString.lastIndexOf('-')+1));
}

function getGameCounter(lastGameString, simple)
{
    var myCount, countString;
    if(!lastGameString)
        return "-1";
    else
    {
        countString = lastGameString.slice(lastGameString.lastIndexOf('-')+1);
            
        switch(countString)
        {
            case "08":
                myCount = 9;
                break;
            case "09":
                myCount = 10;
                break;
            default:
                myCount = parseInt(countString) + 1;
                break;
        }
        if(!simple)
        {
            if(myCount <= 9)
                return ('0' + myCount);
        }
        return myCount;
    }
}

function isChannelUser(accountname, charname)
{
    for(var i = 0; i < channelUsers.length; i++)
    {
        if(accountname.toLowerCase() == channelUsers[i].toLowerCase() || charname.toLowerCase() == channelUsers[i].toLowerCase())
            return true;
    }
    return false;
}
Edit: Wenn ich mit der NTBot.ntj vom Startpost spiele, habe ich zwar alles wie oben beschrieben, aber kein bot der was macht (ingame)
Wenn ich mit der original NTBot.ntj spiele und nur die rot markierten teile einsetze, fightet er zwar, aber ich habe chat functions disabled und er geht weder in den channel, noch tut er sonst was davon..
evtl hilft das ja...

Danke für die Hilfe!