viewing paste logon cmd | C

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
//===== eAthena Script ======================================= 
//= Commands activation on player's login
//===== By: ================================================== 
//= Damlug, rev lighta
//===== Current Version: ===================================== 
//= 1.3
//===== Compatible With: ===================================== 
//= eAthena SVN 14250 (previous version untested but probably working)
//===== Description: ========================================= 
//= Allow a player to choose which commands activate automatically on login
//= Works for autoloot, showexp, guildhp, main, whosell
//= For autoloot, players can choose the percent limit
//= For whosell, players can choose 1 items ID
//Bits des commandes
    //Autoloot:     startCommands   bit 0 [0;1]
    //Showexp:          bit 1 [1;2]
    //Guildhp:          bit 2 [2;4] 
    //Ally  chat    startCommands2  bit 0 [0;1]
    //Main chat         bit 1 [1;2]
    //autosell          bit 2 [2:4]
//===== Additional Comments: ================================= 
//= 1.0 - Works for autoloot, showexp, guildhp  [2010/09/07]
//= 1.1 - Updated revision for char with space  [2010/12/10]
//= 1.2 - Add Main chat and whosell     [2011/01/13]
//= 1.3 - Add Ally chat
//============================================================ 
 
lof_vana,91,134,5   script  Serge   89,{
//prontera,159,162,5    script  Serge   89,{    
    while(1) {
        mes "Etat des commandes de démarrage";
        mes "[" + ((startCommands>>0)%2?"^009900"+ startAutolootRate +"%":"^FF0000OFF") + "^000000] Autoloot";
        mes "[" + ((startCommands>>1)%2?"^FF0000OFF":"^009900ON") + "^000000] Showexp"; //On inverse, vu que activée par défaut
        mes "[" + ((startCommands>>2)%2?"^009900ON":"^FF0000OFF") + "^000000] Guildhp";
        mes "[" + ((startCommands2>>0)%2?"^009900ON":"^FF0000OFF") + "^000000] Ally chat";
        mes "[" + ((startCommands2>>1)%2?"^009900ON":"^FF0000OFF") + "^000000] Main chat";
        mes "[" + ((startCommands2>>2)%2?"^009900 Item "+whosellitem :"^FF0000OFF") + "^000000] Auto whosell";
        mes "Choisissez la commande à modifier";
        switch(select("Autoloot:Showexp:Guildhp:Ally chat:Main chat:Whosell")) {
            case 1:                                                 //Autoloot
                if(! ((startCommands>>0)%2)) {                                  //Activation
                    mes "Entrez le pourcentage maximal";
                    //On limite la valeur entrée à 0-100
                    do {
                    input startAutolootRate;
                    if (startAutolootRate<0 || startAutolootRate>100) mes "Rates invalide veuillez recommencez";
                    } while (startAutolootRate<0 || startAutolootRate>100);
                    //Et si la valeur est comprise entre 1 et 100, on active la commande
                    if(startAutolootRate) set startCommands, startCommands +1;
                }                                               //Désactivation
                else set startCommands, startCommands -1;
                break;
            case 2:                                                 //Showexp
                if(! ((startCommands>>1)%2)) set startCommands, startCommands +2;               //Activation
                else set startCommands, startCommands -2;                           //Désactivation
                break;
            case 3:                                                 //Guildhp
                if(! ((startCommands>>2)%2)) set startCommands, startCommands +4;               //Activation
                else set startCommands, startCommands -4;                           //Désactivation
                break;
            case 4:                                                 //Ally chat
                if(! ((startCommands2>>0)%2)) set startCommands2, startCommands2 +1;                //Activation
                else set startCommands2, startCommands2 -1;                         //Désactivation                                    break;
            case 5:                                                 //Main chat
                if(! ((startCommands2>>1)%2)) set startCommands2, startCommands2 +2;                //Activation
                else set startCommands2, startCommands2 -2;                         //Désactivation
                break;
            case 6:                                                 //Whosell
                if(! ((startCommands2>>2)%2)) {                                 //Activation
                    mes "Entrez l'ID de l'iteml";
                    //On limite l'ID d'entrée à >0
                    do {
                        input whosellitem;
                        if (whosellitem<0) mes "ID invalide veuillez recommencez";
                    } while (whosellitem<0);            //ID max ?
                    if(whosellitem) set startCommands2, startCommands2 +4;
                }                                               //Désactivation
                else set startCommands2, startCommands2 -4;
                break;
        }
        mes "Modifications enregistrées !";
        next;
    }
    
    OnPCLoginEvent:     //Activation des commandes au moment du log
        if((startCommands>>0)%2) atcommand "@autoloot "+startAutolootRate;  //Autoloot
        if((startCommands>>1)%2) atcommand "@showexp";              //Showexp
        if((startCommands>>2)%2) atcommand "@guildhp";              //Guildhp
        if((startCommands2>>0)%2) atcommand "@ally on";             //Ally chat
        if((startCommands2>>1)%2) atcommand "@main on";             //Main chat
        if((startCommands2>>2)%2) atcommand "@whosell "+whosellitem;        //Auto whosell
        end;
}
Viewed 1248 times, submitted by lighta.